[Ada] Restore general case for folding comparison of static strings
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 3 Nov 2020 23:59:00 +0000 (00:59 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 27 Nov 2020 09:15:51 +0000 (04:15 -0500)
commitcc7c52c1d9c9524e3ee0764808de343127b5e9fc
tree680be8144491670b9d5279e950f55568bc9b91e2
parenta2481afdfca17659293d61e613167ec1cd6e1414
[Ada] Restore general case for folding comparison of static strings

gcc/ada/

* exp_ch4.adb (Rewrite_Comparison): Add assertion to confirm
that evaluation folds comparisons with static operands; when
folding comparison with non-static operands, the resulting
literal is non-static.
* sem_eval.adb (Eval_Relational_Op): Refactor nested IF
statement for the special case in the THEN branch; move code for
the "general case" out of the ELSE branch.
* sem_res.adb (Resolve_Comparison_Op): Only apply a dubious
special-case for GNATprove in the GNATprove_Mode.
gcc/ada/exp_ch4.adb
gcc/ada/sem_eval.adb
gcc/ada/sem_res.adb