diff mbox series

[Ada] In CodePeer mode, use regular-exception handling

Message ID 20210506075812.GA125708@adacore.com
State New
Headers show
Series [Ada] In CodePeer mode, use regular-exception handling | expand

Commit Message

Pierre-Marie de Rodat May 6, 2021, 7:58 a.m. UTC
After a change done for GNATProve in 2016, CodePeer_Mode was not using
the regular exception mechanism. This resulted in imprecise control-flow
graphs in some cases. Revert that change for CodePeer. And, since for
GNATprove_Mode Operating_Mode is never Generate_Code, we can simplify
the code a bit.

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


	* gnat1drv.adb (Adjust_Global_Switches): Simplify logic.
diff mbox series


diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb
--- a/gcc/ada/gnat1drv.adb
+++ b/gcc/ada/gnat1drv.adb
@@ -633,13 +633,9 @@  procedure Gnat1drv is
       end if;
       --  Set and check exception mechanism. This is only meaningful when
-      --  compiling, and in particular not meaningful for special modes used
-      --  for program analysis rather than compilation: CodePeer mode and
-      --  GNATprove mode.
+      --  generating code.
-      if Operating_Mode = Generate_Code
-        and then not (CodePeer_Mode or GNATprove_Mode)
-      then
+      if Operating_Mode = Generate_Code then
          case Targparm.Frontend_Exceptions_On_Target is
             when True =>
                case Targparm.ZCX_By_Default_On_Target is