[Ada] Shutdown codepeer message

Message ID 20211025150903.GA346421@adacore.com
State Committed
Commit c652a33260b19ac1ee3cd15cadb4b3499ac587f9
Headers
Series [Ada] Shutdown codepeer message |

Commit Message

Pierre-Marie de Rodat Oct. 25, 2021, 3:09 p.m. UTC
  Which is a false positive, caused by a confusion on the expanded code
for pragma Loop_Variant.

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

gcc/ada/

	* libgnat/s-widthu.adb: Add pragma Annotate.
  

Patch

diff --git a/gcc/ada/libgnat/s-widthu.adb b/gcc/ada/libgnat/s-widthu.adb
--- a/gcc/ada/libgnat/s-widthu.adb
+++ b/gcc/ada/libgnat/s-widthu.adb
@@ -134,10 +134,13 @@  begin
          W := W + 1;
          Pow := Pow * 10;
 
-         pragma Loop_Variant (Decreases => T);
          pragma Loop_Invariant (W in 3 .. Max_W + 3);
          pragma Loop_Invariant (Pow = Big_10 ** (W - 2));
          pragma Loop_Invariant (Big (T) = Big (T_Init) / Pow);
+         pragma Loop_Variant (Decreases => T);
+         pragma Annotate
+           (CodePeer, False_Positive,
+            "validity check", "confusion on generated code");
       end loop;
 
       declare