aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2017-09-19 22:56:54 -0600
committerJeff Law <law@gcc.gnu.org>2017-09-19 22:56:54 -0600
commitee8f15c69e324cdb1fa553ac14f760f799c425e2 (patch)
tree2808704ba1fbdc80b9f1cc9c3962f746872013ef /gcc/toplev.c
parent8fca13953b551bb75af0a31d737a297de97676a7 (diff)
downloadgcc-ee8f15c69e324cdb1fa553ac14f760f799c425e2.zip
gcc-ee8f15c69e324cdb1fa553ac14f760f799c425e2.tar.gz
gcc-ee8f15c69e324cdb1fa553ac14f760f799c425e2.tar.bz2
common.opt (-fstack-clash-protection): New option.
* common.opt (-fstack-clash-protection): New option. * flag-types.h (enum stack_check_type): Note difference between -fstack-check= and -fstack-clash-protection. * params.def (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE): New PARAM. (PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL): Likewise. * toplev.c (process_options): Issue warnings/errors for cases not handled with -fstack-clash-protection. * doc/invoke.texi (-fstack-clash-protection): Document new option. (-fstack-check): Note additional problem with -fstack-check=generic. Note that -fstack-check is primarily for Ada and refer users to -fstack-clash-protection for stack-clash-protection. Document new params for stack clash protection. * gcc.dg/stack-check-2.c: New test. * lib/target-supports.exp (check_effective_target_supports_stack_clash_protection): New function. (check_effective_target_frame_pointer_for_non_leaf): Likewise. (check_effective_target_caller_implicit_probes): Likewise. From-SVN: r252994
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 7d2b8ff..6f48e10 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1605,6 +1605,26 @@ process_options (void)
flag_associative_math = 0;
}
+ /* -fstack-clash-protection is not currently supported on targets
+ where the stack grows up. */
+ if (flag_stack_clash_protection && !STACK_GROWS_DOWNWARD)
+ {
+ warning_at (UNKNOWN_LOCATION, 0,
+ "%<-fstack-clash-protection%> is not supported on targets "
+ "where the stack grows from lower to higher addresses");
+ flag_stack_clash_protection = 0;
+ }
+
+ /* We can not support -fstack-check= and -fstack-clash-protection at
+ the same time. */
+ if (flag_stack_check != NO_STACK_CHECK && flag_stack_clash_protection)
+ {
+ warning_at (UNKNOWN_LOCATION, 0,
+ "%<-fstack-check=%> and %<-fstack-clash_protection%> are "
+ "mutually exclusive. Disabling %<-fstack-check=%>");
+ flag_stack_check = NO_STACK_CHECK;
+ }
+
/* With -fcx-limited-range, we do cheap and quick complex arithmetic. */
if (flag_cx_limited_range)
flag_complex_method = 0;