[testsuite,committed] Make dependence on -fdelete-null-pointer-checks explicit in more test cases

Message ID e36ac181-6ea8-b7a5-ec4e-ecf4db0e7fc7@codesourcery.com
State New
Headers show
Series
  • [testsuite,committed] Make dependence on -fdelete-null-pointer-checks explicit in more test cases
Related show

Commit Message

Sandra Loosemore Aug. 30, 2018, 9:34 p.m.
As discussed here

https://gcc.gnu.org/ml/gcc-patches/2015-03/msg01510.html

a few years ago Altera requested that GCC default to 
-fno-delete-null-pointer-checks on nios2-elf target.  As part that 
change, I added an explicit -fdelete-null-pointer-checks option to a 
bunch of test cases that depend on it to work correctly.  Lately there 
have been another bunch of test cases failing on nios2-elf for the same 
reason, so now I have made the same fix to those as well.  I think this 
qualifies as obvious so I've checked it in.

-Sandra

Patch

Index: gcc/testsuite/g++.dg/cpp0x/noexcept30.C
===================================================================
--- gcc/testsuite/g++.dg/cpp0x/noexcept30.C	(revision 263998)
+++ gcc/testsuite/g++.dg/cpp0x/noexcept30.C	(working copy)
@@ -1,5 +1,6 @@ 
 // PR c++/69300
 // { dg-do compile { target c++11 } }
+// { dg-options "-fdelete-null-pointer-checks" }
 
 template<typename A>
 struct F {
Index: gcc/testsuite/g++.dg/cpp1y/constexpr-82218.C
===================================================================
--- gcc/testsuite/g++.dg/cpp1y/constexpr-82218.C	(revision 263998)
+++ gcc/testsuite/g++.dg/cpp1y/constexpr-82218.C	(working copy)
@@ -1,5 +1,6 @@ 
 // PR c++/82218
 // { dg-do compile { target c++14 } }
+// { dg-options "-fdelete-null-pointer-checks" }
 
 template<typename _Tp>
 struct identity
Index: gcc/testsuite/g++.dg/expr/pmf-3.C
===================================================================
--- gcc/testsuite/g++.dg/expr/pmf-3.C	(revision 263998)
+++ gcc/testsuite/g++.dg/expr/pmf-3.C	(working copy)
@@ -1,5 +1,6 @@ 
 // PR c++/80485
 // { dg-do compile { target c++11 } }
+// { dg-options "-fdelete-null-pointer-checks" }
 
 struct dummy {
   void nonnull() {};
Index: gcc/testsuite/g++.dg/ext/attr-returns-nonnull.C
===================================================================
--- gcc/testsuite/g++.dg/ext/attr-returns-nonnull.C	(revision 263998)
+++ gcc/testsuite/g++.dg/ext/attr-returns-nonnull.C	(working copy)
@@ -4,7 +4,7 @@ 
 // does not "inherit" attribute nonnull from an argument declared with
 // one in the primary template.
 // { dg-do compile }
-// { dg-options "-O -Wall -fdump-tree-optimized" }
+// { dg-options "-O -Wall -fdump-tree-optimized -fdelete-null-pointer-checks" }
 
 template <class T>
 void* __attribute__ ((returns_nonnull))
Index: gcc/testsuite/g++.dg/tree-ssa/lifetime-dse1.C
===================================================================
--- gcc/testsuite/g++.dg/tree-ssa/lifetime-dse1.C	(revision 263998)
+++ gcc/testsuite/g++.dg/tree-ssa/lifetime-dse1.C	(working copy)
@@ -1,5 +1,5 @@ 
 // PR c++/61982
-// { dg-additional-options "-O2 -fdump-tree-optimized" }
+// { dg-additional-options "-O2 -fdump-tree-optimized -fdelete-null-pointer-checks" }
 // { dg-final { scan-tree-dump-not "= 0" "optimized" } }
 
 struct X { 
Index: gcc/testsuite/g++.dg/tree-ssa/pr61034.C
===================================================================
--- gcc/testsuite/g++.dg/tree-ssa/pr61034.C	(revision 263998)
+++ gcc/testsuite/g++.dg/tree-ssa/pr61034.C	(working copy)
@@ -1,5 +1,5 @@ 
 // { dg-do compile }
-// { dg-options "-O2 -fdump-tree-fre3 -fdump-tree-optimized" }
+// { dg-options "-O2 -fdump-tree-fre3 -fdump-tree-optimized -fdelete-null-pointer-checks" }
 
 #define assume(x) if(!(x))__builtin_unreachable()
 
Index: gcc/testsuite/gcc.dg/addr_equal-1.c
===================================================================
--- gcc/testsuite/gcc.dg/addr_equal-1.c	(revision 263998)
+++ gcc/testsuite/gcc.dg/addr_equal-1.c	(working copy)
@@ -2,7 +2,7 @@ 
 /* { dg-require-effective-target nonpic } */
 /* { dg-require-weak "" } */
 /* { dg-require-alias "" } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O2 -fdelete-null-pointer-checks" } */
 /* { dg-skip-if "" { powerpc-ibm-aix* } } */
 void abort (void);
 extern int undef_var0, undef_var1;
Index: gcc/testsuite/gcc.dg/ipa/pr85734.c
===================================================================
--- gcc/testsuite/gcc.dg/ipa/pr85734.c	(revision 263998)
+++ gcc/testsuite/gcc.dg/ipa/pr85734.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wsuggest-attribute=malloc" } */
+/* { dg-options "-O2 -Wsuggest-attribute=malloc -fdelete-null-pointer-checks" } */
 
 __attribute__((noinline))
 static void *f1(__SIZE_TYPE__ sz) /* { dg-bogus "function might be candidate for attribute 'malloc'" } */
Index: gcc/testsuite/gcc.dg/ipa/propmalloc-1.c
===================================================================
--- gcc/testsuite/gcc.dg/ipa/propmalloc-1.c	(revision 263998)
+++ gcc/testsuite/gcc.dg/ipa/propmalloc-1.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-ipa-pure-const-details" } */
+/* { dg-options "-O2 -fdump-ipa-pure-const-details -fdelete-null-pointer-checks" } */
 
 __attribute__((noinline, no_icf, used))
 static void *f(__SIZE_TYPE__ n)
Index: gcc/testsuite/gcc.dg/ipa/propmalloc-2.c
===================================================================
--- gcc/testsuite/gcc.dg/ipa/propmalloc-2.c	(revision 263998)
+++ gcc/testsuite/gcc.dg/ipa/propmalloc-2.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-ipa-pure-const-details" } */
+/* { dg-options "-O2 -fdump-ipa-pure-const-details -fdelete-null-pointer-checks" } */
 
 __attribute__((noinline, used, no_icf))
 static void *foo (__SIZE_TYPE__ n)
Index: gcc/testsuite/gcc.dg/ipa/propmalloc-3.c
===================================================================
--- gcc/testsuite/gcc.dg/ipa/propmalloc-3.c	(revision 263998)
+++ gcc/testsuite/gcc.dg/ipa/propmalloc-3.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-ipa-pure-const-details" } */
+/* { dg-options "-O2 -fdump-ipa-pure-const-details -fdelete-null-pointer-checks" } */
 
 static void *foo(__SIZE_TYPE__, int) __attribute__((noinline, no_icf, used));
 
Index: gcc/testsuite/gcc.dg/tree-ssa/pr78154.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/pr78154.c	(revision 263998)
+++ gcc/testsuite/gcc.dg/tree-ssa/pr78154.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-evrp-slim" } */
+/* { dg-options "-O2 -fdump-tree-evrp-slim -fdelete-null-pointer-checks" } */
 
 void f(void *d, const void *s, __SIZE_TYPE__ n)
 {
Index: gcc/testsuite/gcc.dg/tree-ssa/pr83648.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/pr83648.c	(revision 263998)
+++ gcc/testsuite/gcc.dg/tree-ssa/pr83648.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-local-pure-const-details" } */
+/* { dg-options "-O2 -fdump-tree-local-pure-const-details -fdelete-null-pointer-checks" } */
 
 void *g(unsigned n)
 {
Index: libstdc++-v3/testsuite/experimental/propagate_const/observers/1.cc
===================================================================
--- libstdc++-v3/testsuite/experimental/propagate_const/observers/1.cc	(revision 263998)
+++ libstdc++-v3/testsuite/experimental/propagate_const/observers/1.cc	(working copy)
@@ -1,4 +1,5 @@ 
 // { dg-do run { target c++14 } }
+// { dg-options "-fdelete-null-pointer-checks" }
 
 // Copyright (C) 2015-2018 Free Software Foundation, Inc.
 //