Do not override -fnon-call-exceptions in default mode
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 9 May 2020 20:52:21 +0000 (22:52 +0200)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 9 May 2020 20:52:21 +0000 (22:52 +0200)
This was already the case in -gnatp mode.

* gcc-interface/misc.c (gnat_init_gcc_eh): Do not override the user
for -fnon-call-exceptions in default mode.

gcc/ada/ChangeLog
gcc/ada/gcc-interface/misc.c

index c118afd..6ee4942 100644 (file)
@@ -1,5 +1,10 @@
 2020-05-09  Eric Botcazou  <ebotcazou@adacore.com>
 
+       * gcc-interface/misc.c (gnat_init_gcc_eh): Do not override the user
+       for -fnon-call-exceptions in default mode.
+
+2020-05-09  Eric Botcazou  <ebotcazou@adacore.com>
+
        * gcc-interface/trans.c (lvalue_required_p) <N_Selected_Component>:
        Merge with N_Slice.
        <N_Allocator>: Move to...
index d68b373..2950cb8 100644 (file)
@@ -417,7 +417,8 @@ gnat_init_gcc_eh (void)
     }
   else
     {
-      flag_non_call_exceptions = 1;
+      if (!global_options_set.x_flag_non_call_exceptions)
+        flag_non_call_exceptions = 1;
       flag_aggressive_loop_optimizations = 0;
       warn_aggressive_loop_optimizations = 0;
     }