From 9cd7bc5e000a2be07995aea4ff762f89c0e0661e Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Mon, 16 Jul 2018 14:11:20 +0000 Subject: [PATCH] [Ada] Use common routine Expand_Nonbinary_Modular_Op for XOR expressions 2018-07-16 Ed Schonberg gcc/ada/ * exp_ch4.adb (Expand_N_Op_Xor): Use common routine Expand_Nonbinary_Modular_Op. Needed for unnesting. From-SVN: r262717 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/exp_ch4.adb | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index cd1aac0971d..e75fcbbcfe4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-07-16 Ed Schonberg + + * exp_ch4.adb (Expand_N_Op_Xor): Use common routine + Expand_Nonbinary_Modular_Op. Needed for unnesting. + 2018-07-16 Ed Schonberg * sem_ch3.adb (Inherit_Predicate_Flags): A non-discrete type may have a diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 222ca19706d..a98ffb3df73 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -4072,7 +4072,7 @@ package body Exp_Ch4 is -- we avoid never-ending loops expanding them, and we also ensure -- the back end never receives nonbinary modular type expressions. - if Nkind_In (Nkind (N), N_Op_And, N_Op_Or) then + if Nkind_In (Nkind (N), N_Op_And, N_Op_Or, N_Op_Xor) then Set_Left_Opnd (Op_Expr, Unchecked_Convert_To (Standard_Unsigned, New_Copy_Tree (Left_Opnd (N)))); @@ -10021,6 +10021,8 @@ package body Exp_Ch4 is elsif Is_Intrinsic_Subprogram (Entity (N)) then Expand_Intrinsic_Call (N, Entity (N)); end if; + + Expand_Nonbinary_Modular_Op (N); end Expand_N_Op_Xor; ---------------------- -- 2.30.2