[NDS32] Disable -fdelete-null-pointer-checks by default for nds32*-*-elf.
authorChung-Ju Wu <jasonwucj@gmail.com>
Sun, 3 Jun 2018 03:17:40 +0000 (03:17 +0000)
committerChung-Ju Wu <jasonwucj@gcc.gnu.org>
Sun, 3 Jun 2018 03:17:40 +0000 (03:17 +0000)
gcc/
* common/config/nds32/nds32-common.c (nds32_option_optimization_table):
Disable -fdelete-null-pointer-checks for ELF toolchain.

From-SVN: r261122

gcc/ChangeLog
gcc/common/config/nds32/nds32-common.c

index 0e6eef70fbb6e32bd692e5edd803b00e40043c12..18f539dfa13a339fa2459996ce0ee24d9f8ade9f 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-03  Chung-Ju Wu  <jasonwucj@gmail.com>
+
+       * common/config/nds32/nds32-common.c (nds32_option_optimization_table):
+       Disable -fdelete-null-pointer-checks for ELF toolchain.
+
 2018-06-02  Chung-Ju Wu  <jasonwucj@gmail.com>
            Kito Cheng  <kito.cheng@gmail.com>
 
index e4478f166c51ec9a724dd75684fab4b171762dad..197f06c8b906c4ad963d24acc8a8da1f01660b19 100644 (file)
@@ -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.  */