]> gcc.gnu.org Git - gcc.git/commitdiff
[Ada] Handle non-standard booleans in if_expression condition
authorAlexandre Oliva <oliva@adacore.com>
Wed, 29 Dec 2021 07:10:45 +0000 (04:10 -0300)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 10 May 2022 08:19:29 +0000 (08:19 +0000)
We failed to call Adjust_Condition for the condition expression of an
if_expression, so non-standard booleans were expanded like standard
booleans, disregarding representation clauses. Fixed.

gcc/ada/

* exp_ch4.adb (Expand_N_If_Expression): Call Adjust_Condition to
handle non-standard booleans.

gcc/ada/exp_ch4.adb

index 9de384a4eb94693a438a8961aba7dabdd4c0d76f..98ce797be682f37d9f81481cb0abb91481e26712 100644 (file)
@@ -5794,6 +5794,10 @@ package body Exp_Ch4 is
    --  Start of processing for Expand_N_If_Expression
 
    begin
+      --  Deal with non-standard booleans
+
+      Adjust_Condition (Cond);
+
       --  Check for MINIMIZED/ELIMINATED overflow mode.
       --  Apply_Arithmetic_Overflow_Check will not deal with Then/Else_Actions
       --  so skip this step if any actions are present.
This page took 0.067702 seconds and 5 git commands to generate.