diff mbox series

[Ada] Handle non-standard booleans in if_expression condition

Message ID 20220510082113.GA3029332@adacore.com
State New
Headers show
Series [Ada] Handle non-standard booleans in if_expression condition | expand

Commit Message

Pierre-Marie de Rodat May 10, 2022, 8:21 a.m. UTC
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.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

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

Patch

diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -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.