diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2018-02-01 15:54:20 +0000 |
---|---|---|
committer | Georg-Johann Lay <gjl@gcc.gnu.org> | 2018-02-01 15:54:20 +0000 |
commit | 19416210b37db0584cd0b3f3b3961324b8973d25 (patch) | |
tree | e5bef7116d39c34d03bd7f558e1ced448eb9d1f8 /gcc/common/config/avr/avr-common.c | |
parent | 4d0bf3e1e184f78d4a2716245aa963aef0e918cf (diff) | |
download | gcc-19416210b37db0584cd0b3f3b3961324b8973d25.zip gcc-19416210b37db0584cd0b3f3b3961324b8973d25.tar.gz gcc-19416210b37db0584cd0b3f3b3961324b8973d25.tar.bz2 |
avr.c (avr_option_override): Move disabling of -fdelete-null-pointer-checks to...
gcc/
* config/avr/avr.c (avr_option_override): Move disabling of
-fdelete-null-pointer-checks to...
* common/config/avr/avr-common.c (avr_option_optimization_table):
...here.
testsuite/
* gcc.dg/tree-ssa/vrp111.c (dg-options): Add
-fdelete-null-pointer-checks.
From-SVN: r257301
Diffstat (limited to 'gcc/common/config/avr/avr-common.c')
-rw-r--r-- | gcc/common/config/avr/avr-common.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/common/config/avr/avr-common.c b/gcc/common/config/avr/avr-common.c index 078584d..d6293b1 100644 --- a/gcc/common/config/avr/avr-common.c +++ b/gcc/common/config/avr/avr-common.c @@ -27,6 +27,12 @@ /* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */ static const struct default_options avr_option_optimization_table[] = { + // With -fdelete-null-pointer-checks option, the compiler assumes + // that dereferencing of a null pointer would halt the program. + // For AVR this assumption is not true and a program can safely + // dereference null pointers. Changes made by this option may not + // work properly for AVR. So disable this option. + { OPT_LEVELS_ALL, OPT_fdelete_null_pointer_checks, NULL, 0 }, // The only effect of -fcaller-saves might be that it triggers // a frame without need when it tries to be smart around calls. { OPT_LEVELS_ALL, OPT_fcaller_saves, NULL, 0 }, |