[Ada] Use common routine Expand_Nonbinary_Modular_Op for XOR expressions
authorEd Schonberg <schonberg@adacore.com>
Mon, 16 Jul 2018 14:11:20 +0000 (14:11 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 16 Jul 2018 14:11:20 +0000 (14:11 +0000)
2018-07-16  Ed Schonberg  <schonberg@adacore.com>

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
gcc/ada/exp_ch4.adb

index cd1aac0..e75fcbb 100644 (file)
@@ -1,5 +1,10 @@
 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
 
+       * exp_ch4.adb (Expand_N_Op_Xor): Use common routine
+       Expand_Nonbinary_Modular_Op.  Needed for unnesting.
+
+2018-07-16  Ed Schonberg  <schonberg@adacore.com>
+
        * sem_ch3.adb (Inherit_Predicate_Flags): A non-discrete type may have a
        static predicate (for example True) but has no
        static_discrete_predicate.
index 222ca19..a98ffb3 100644 (file)
@@ -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;
 
    ----------------------