diff mbox series

[Ada] Do not catch 'N rem -1' in CodePeer_Mode

Message ID 20210705131337.GA2222049@adacore.com
State New
Headers show
Series [Ada] Do not catch 'N rem -1' in CodePeer_Mode | expand

Commit Message

Pierre-Marie de Rodat July 5, 2021, 1:13 p.m. UTC
The special case used for catching the 'rem -1' operation is not useful
to CodePeer, and in fact may be detrimental to its precision. Remove
it in CodePeer_Mode.

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

gcc/ada/

	* exp_ch4.adb (Expand_N_Op_Rem): Remove special case for rem -1
	in CodePeer_Mode.
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
@@ -10393,7 +10393,9 @@  package body Exp_Ch4 is
       --  types and this is really marginal). We will just assume that we need
       --  the test if the left operand can be negative at all.
 
-      if Lneg and Rneg then
+      if (Lneg and Rneg)
+         and then not CodePeer_Mode
+      then
          Rewrite (N,
            Make_If_Expression (Loc,
              Expressions => New_List (