diff options
author | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2017-12-05 11:46:16 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2017-12-05 11:46:16 +0000 |
commit | f4ac86dd5c3569dac8b395e823296ed89a2030e9 (patch) | |
tree | 57d352202f49c7f2af29b144069b0623b04af894 /gcc/ada/exp_ch4.adb | |
parent | 16d92641c44532b83fc9ff6009ada3a769a15731 (diff) | |
download | gcc-f4ac86dd5c3569dac8b395e823296ed89a2030e9.zip gcc-f4ac86dd5c3569dac8b395e823296ed89a2030e9.tar.gz gcc-f4ac86dd5c3569dac8b395e823296ed89a2030e9.tar.bz2 |
[multiple changes]
2017-12-05 Arnaud Charlet <charlet@adacore.com>
* opt.ads (Expand_Nonbinary_Modular_Ops): New flag.
* exp_ch4.adb (Expand_Nonbinary_Modular_Op): Use
Expand_Nonbinary_Modular_Ops instead of Modify_Tree_For_C, so that
other back-ends can also benefit from the front-end expansion. Remove
test for Modify_Tree_For_C in all callers to better share code.
* gnat1drv.adb (Adjust_Global_Switches): Set
Expand_Nonbinary_Modular_Ops when generating C code.
2017-12-05 Ed Schonberg <schonberg@adacore.com>
* exp_ch5.adb (Expand_Formal_Container_Loop): Ensure that the loop
parameter becomes invisible after analyzing the loop, which has been
rewritten as a while-loop.
2017-12-05 Doug Rupp <rupp@adacore.com>
* vxaddr2line.adb: Revise and enhance for new ports, remove dead ports,
and update for 64bit ports.
From-SVN: r255410
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r-- | gcc/ada/exp_ch4.adb | 56 |
1 files changed, 10 insertions, 46 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 88303c66..aac0c5c 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -4172,10 +4172,10 @@ package body Exp_Ch4 is -- Start of processing for Expand_Nonbinary_Modular_Op begin - -- No action needed if we are not generating C code for a nonbinary - -- modular operand. + -- No action needed if front-end expansion is not required or if we + -- have a binary modular operand. - if not Modify_Tree_For_C + if not Expand_Nonbinary_Modular_Ops or else not Non_Binary_Modulus (Typ) then return; @@ -6899,12 +6899,7 @@ package body Exp_Ch4 is Check_Float_Op_Overflow (N); - -- When generating C code, convert nonbinary modular additions into code - -- that relies on the front-end expansion of operator Mod. - - if Modify_Tree_For_C then - Expand_Nonbinary_Modular_Op (N); - end if; + Expand_Nonbinary_Modular_Op (N); end Expand_N_Op_Add; --------------------- @@ -6930,12 +6925,7 @@ package body Exp_Ch4 is Expand_Intrinsic_Call (N, Entity (N)); end if; - -- When generating C code, convert nonbinary modular operators into code - -- that relies on the front-end expansion of operator Mod. - - if Modify_Tree_For_C then - Expand_Nonbinary_Modular_Op (N); - end if; + Expand_Nonbinary_Modular_Op (N); end Expand_N_Op_And; ------------------------ @@ -7178,12 +7168,7 @@ package body Exp_Ch4 is Check_Float_Op_Overflow (N); - -- When generating C code, convert nonbinary modular divisions into code - -- that relies on the front-end expansion of operator Mod. - - if Modify_Tree_For_C then - Expand_Nonbinary_Modular_Op (N); - end if; + Expand_Nonbinary_Modular_Op (N); end Expand_N_Op_Divide; -------------------- @@ -8687,12 +8672,7 @@ package body Exp_Ch4 is Analyze_And_Resolve (N, Typ); end if; - -- When generating C code, convert nonbinary modular minus into code - -- that relies on the front-end expansion of operator Mod. - - if Modify_Tree_For_C then - Expand_Nonbinary_Modular_Op (N); - end if; + Expand_Nonbinary_Modular_Op (N); end Expand_N_Op_Minus; --------------------- @@ -9170,12 +9150,7 @@ package body Exp_Ch4 is Check_Float_Op_Overflow (N); - -- When generating C code, convert nonbinary modular multiplications - -- into code that relies on the front-end expansion of operator Mod. - - if Modify_Tree_For_C then - Expand_Nonbinary_Modular_Op (N); - end if; + Expand_Nonbinary_Modular_Op (N); end Expand_N_Op_Multiply; -------------------- @@ -9487,12 +9462,7 @@ package body Exp_Ch4 is Expand_Intrinsic_Call (N, Entity (N)); end if; - -- When generating C code, convert nonbinary modular operators into code - -- that relies on the front-end expansion of operator Mod. - - if Modify_Tree_For_C then - Expand_Nonbinary_Modular_Op (N); - end if; + Expand_Nonbinary_Modular_Op (N); end Expand_N_Op_Or; ---------------------- @@ -9926,12 +9896,7 @@ package body Exp_Ch4 is Check_Float_Op_Overflow (N); - -- When generating C code, convert nonbinary modular subtractions into - -- code that relies on the front-end expansion of operator Mod. - - if Modify_Tree_For_C then - Expand_Nonbinary_Modular_Op (N); - end if; + Expand_Nonbinary_Modular_Op (N); end Expand_N_Op_Subtract; --------------------- @@ -9955,7 +9920,6 @@ package body Exp_Ch4 is elsif Is_Intrinsic_Subprogram (Entity (N)) then Expand_Intrinsic_Call (N, Entity (N)); - end if; end Expand_N_Op_Xor; |