This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix up pr19476-{1,5}.C (PR testsuite/86649)


On Tue, Jul 24, 2018 at 12:08:35PM +0200, Richard Biener wrote:
> OK - can you add a variant with -O2 that tests it at EVRP time then?

Here is what I've committed to trunk then:

2018-07-24  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/86649
	* g++.dg/tree-ssa-/pr19476-1.C: Check dom2 dump instead of ccp1.
	* g++.dg/tree-ssa-/pr19476-5.C: Likewise.
	* g++.dg/tree-ssa-/pr19476-6.C: New test.
	* g++.dg/tree-ssa-/pr19476-7.C: New test.

--- gcc/testsuite/g++.dg/tree-ssa/pr19476-1.C.jj	2015-05-29 15:04:33.037803445 +0200
+++ gcc/testsuite/g++.dg/tree-ssa/pr19476-1.C	2018-07-24 11:39:10.108897097 +0200
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O -fdump-tree-ccp1 -fdelete-null-pointer-checks" } */
+/* { dg-options "-O -fdump-tree-dom2 -fdelete-null-pointer-checks" } */
 /* { dg-skip-if "" keeps_null_pointer_checks } */
 
 // See pr19476-5.C for a version without including <new>.
@@ -12,5 +12,5 @@ int g(){
   return 42 + (0 == new int[50]);
 }
 
-/* { dg-final { scan-tree-dump     "return 42" "ccp1" } } */
-/* { dg-final { scan-tree-dump-not "return 33" "ccp1" } } */
+/* { dg-final { scan-tree-dump     "return 42" "dom2" } } */
+/* { dg-final { scan-tree-dump-not "return 33" "dom2" } } */
--- gcc/testsuite/g++.dg/tree-ssa/pr19476-5.C.jj	2015-05-29 15:04:33.038803430 +0200
+++ gcc/testsuite/g++.dg/tree-ssa/pr19476-5.C	2018-07-24 11:39:26.190913802 +0200
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O -fdump-tree-ccp1 -fdelete-null-pointer-checks" } */
+/* { dg-options "-O -fdump-tree-dom2 -fdelete-null-pointer-checks" } */
 /* { dg-skip-if "" keeps_null_pointer_checks } */
 
 // See pr19476-1.C for a version that includes <new>.
@@ -8,4 +8,4 @@ int g(){
   return 42 + (0 == new int[50]);
 }
 
-/* { dg-final { scan-tree-dump     "return 42" "ccp1" } } */
+/* { dg-final { scan-tree-dump     "return 42" "dom2" } } */
--- gcc/testsuite/g++.dg/tree-ssa/pr19476-6.C.jj	2018-07-24 12:09:30.321890628 +0200
+++ gcc/testsuite/g++.dg/tree-ssa/pr19476-6.C	2018-07-24 12:10:49.812987922 +0200
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-evrp -fdelete-null-pointer-checks" } */
+/* { dg-skip-if "" keeps_null_pointer_checks } */
+
+// See pr19476-7.C for a version without including <new>.
+#include <new>
+
+int f(){
+  return 33 + (0 == new(std::nothrow) int);
+}
+int g(){
+  return 42 + (0 == new int[50]);
+}
+
+/* { dg-final { scan-tree-dump     "return 42" "evrp" } } */
+/* { dg-final { scan-tree-dump-not "return 33" "evrp" } } */
--- gcc/testsuite/g++.dg/tree-ssa/pr19476-7.C.jj	2018-07-24 12:09:33.034893945 +0200
+++ gcc/testsuite/g++.dg/tree-ssa/pr19476-7.C	2018-07-24 12:11:03.657004866 +0200
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-evrp -fdelete-null-pointer-checks" } */
+/* { dg-skip-if "" keeps_null_pointer_checks } */
+
+// See pr19476-6.C for a version that includes <new>.
+
+int g(){
+  return 42 + (0 == new int[50]);
+}
+
+/* { dg-final { scan-tree-dump     "return 42" "evrp" } } */


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]