aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/misc.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-11-08 15:53:47 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-11-08 15:53:47 +0000
commit0274dd3f8d6bcbc4935fae1e0cc815197c48bb0c (patch)
treeb0226107b3a22640d2d717c7b833cb9b7f5a9201 /gcc/ada/gcc-interface/misc.c
parent4174a33ac66f45536e3d7bd46167d7f678310931 (diff)
downloadgcc-0274dd3f8d6bcbc4935fae1e0cc815197c48bb0c.zip
gcc-0274dd3f8d6bcbc4935fae1e0cc815197c48bb0c.tar.gz
gcc-0274dd3f8d6bcbc4935fae1e0cc815197c48bb0c.tar.bz2
fe.h (Suppress_Checks): Declare.
* fe.h (Suppress_Checks): Declare. * gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions only if checks are not suppressed and -faggressive-loop-optimizations only if they are. * gcc-interface/trans.c (struct loop_info_d): Remove has_checks and warned_aggressive_loop_optimizations fields. (gigi): Do not clear warn_aggressive_loop_optimizations here. (Raise_Error_to_gnu): Do not set has_checks. (gnat_to_gnu) <N_Indexed_Component>: Remove support for aggressive loop optimizations. From-SVN: r265921
Diffstat (limited to 'gcc/ada/gcc-interface/misc.c')
-rw-r--r--gcc/ada/gcc-interface/misc.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index 98ec277..eadbd36 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -392,7 +392,7 @@ gnat_init_gcc_eh (void)
using_eh_for_cleanups ();
/* Turn on -fexceptions, -fnon-call-exceptions and -fdelete-dead-exceptions.
- The first one triggers the generation of the necessary exception tables.
+ The first one activates the support for exceptions in the compiler.
The second one is useful for two reasons: 1/ we map some asynchronous
signals like SEGV to exceptions, so we need to ensure that the insns
which can lead to such signals are correctly attached to the exception
@@ -402,10 +402,18 @@ gnat_init_gcc_eh (void)
for such calls to actually raise in Ada.
The third one is an optimization that makes it possible to delete dead
instructions that may throw exceptions, most notably loads and stores,
- as permitted in Ada. */
+ as permitted in Ada.
+ Turn off -faggressive-loop-optimizations because it may optimize away
+ out-of-bound array accesses that we want to be able to catch.
+ If checks are disabled, we use the same settings as the C++ compiler. */
flag_exceptions = 1;
- flag_non_call_exceptions = 1;
flag_delete_dead_exceptions = 1;
+ if (!Suppress_Checks)
+ {
+ flag_non_call_exceptions = 1;
+ flag_aggressive_loop_optimizations = 0;
+ warn_aggressive_loop_optimizations = 0;
+ }
init_eh ();
}