From 1cc591084717fcabbdbddf79601fb8545ac111b6 Mon Sep 17 00:00:00 2001 From: Chung-Ju Wu Date: Sun, 3 Jun 2018 03:17:40 +0000 Subject: [PATCH] [NDS32] Disable -fdelete-null-pointer-checks by default for nds32*-*-elf. gcc/ * common/config/nds32/nds32-common.c (nds32_option_optimization_table): Disable -fdelete-null-pointer-checks for ELF toolchain. From-SVN: r261122 --- gcc/ChangeLog | 5 +++++ gcc/common/config/nds32/nds32-common.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0e6eef70fbb..18f539dfa13 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-06-03 Chung-Ju Wu + + * common/config/nds32/nds32-common.c (nds32_option_optimization_table): + Disable -fdelete-null-pointer-checks for ELF toolchain. + 2018-06-02 Chung-Ju Wu Kito Cheng diff --git a/gcc/common/config/nds32/nds32-common.c b/gcc/common/config/nds32/nds32-common.c index e4478f166c5..197f06c8b90 100644 --- a/gcc/common/config/nds32/nds32-common.c +++ b/gcc/common/config/nds32/nds32-common.c @@ -74,6 +74,11 @@ nds32_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED, /* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */ static const struct default_options nds32_option_optimization_table[] = { +#if TARGET_LINUX_ABI == 0 + /* Disable -fdelete-null-pointer-checks by default in ELF toolchain. */ + { OPT_LEVELS_ALL, OPT_fdelete_null_pointer_checks, + NULL, 0 }, +#endif /* Enable -fsched-pressure by default at -O1 and above. */ { OPT_LEVELS_1_PLUS, OPT_fsched_pressure, NULL, 1 }, /* Enable -fomit-frame-pointer by default at all optimization levels. */ -- 2.30.2