Hi!
When looking at PR86569 testresults, I must have missed these two tests
(but looking at test_summary outputs, I see it now).
When we no longer fold this during cp_fold (to avoid code generation
changes between -Wnonnull-compare and -Wno-nonnull-compare), it isn't
folded from the first pass; with -O2 it is folded during evrp and with
-O1 during dom2.
Note, the test would fail before with -Wnonnull-compare, e.g. on 8
branch (which doesn't have the PR86569 changes), I see:
make check-c++-all RUNTESTFLAGS='--target_board=unix\{,-Wnonnull-compare\}
dg.exp=pr19476*'
=== g++ Summary for unix ===
# of expected passes 72
Running target unix/-Wnonnull-compare
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using /usr/src/gcc-8/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /usr/src/gcc-8/gcc/testsuite/g++.dg/dg.exp ...
FAIL: g++.dg/tree-ssa/pr19476-1.C -std=gnu++98 scan-tree-dump ccp1 "return 42"
FAIL: g++.dg/tree-ssa/pr19476-1.C -std=gnu++11 scan-tree-dump ccp1 "return 42"
FAIL: g++.dg/tree-ssa/pr19476-1.C -std=gnu++14 scan-tree-dump ccp1 "return 42"
FAIL: g++.dg/tree-ssa/pr19476-1.C -std=gnu++17 scan-tree-dump ccp1 "return 42"
FAIL: g++.dg/tree-ssa/pr19476-1.C -std=gnu++2a scan-tree-dump ccp1 "return 42"
FAIL: g++.dg/tree-ssa/pr19476-1.C -std=gnu++17 -fconcepts scan-tree-dump ccp1
"return 42"
FAIL: g++.dg/tree-ssa/pr19476-5.C -std=gnu++98 scan-tree-dump ccp1 "return 42"
FAIL: g++.dg/tree-ssa/pr19476-5.C -std=gnu++11 scan-tree-dump ccp1 "return 42"
FAIL: g++.dg/tree-ssa/pr19476-5.C -std=gnu++14 scan-tree-dump ccp1 "return 42"
FAIL: g++.dg/tree-ssa/pr19476-5.C -std=gnu++17 scan-tree-dump ccp1 "return 42"
FAIL: g++.dg/tree-ssa/pr19476-5.C -std=gnu++2a scan-tree-dump ccp1 "return 42"
FAIL: g++.dg/tree-ssa/pr19476-5.C -std=gnu++17 -fconcepts scan-tree-dump ccp1
"return 42"
=== g++ Summary for unix/-Wnonnull-compare ===
# of expected passes 60
# of unexpected failures 12
Especially for -O2 that people use most, folding it at evrp time seems to be
early enough for me.
Fixed by testing this only in dom2, tested on x86_64-linux, ok for trunk?
2018-07-24 Jakub Jelinek <[email protected]>
PR testsuite/86649
* g++.dg/tree-ssa-/pr19476-1.C: Check dom2 dump instead of ccp1.
* g++.dg/tree-ssa-/pr19476-5.C: Likewise.
--- 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" } } */
Jakub