[PATCH] Fix PR67203

Richard Biener rguenther@suse.de
Thu Nov 26 11:53:00 GMT 2015


This fixes the g++.dg/tree-ssa/pr61034.C to make the expected result
dependent on PUSH_ARGS_REVERSED (via an explicit list of targets).

With swapping the final cd_dce and dse passes I get all targets
to produce zero 'free' calls in .optimized but that doesn't
sound appropriate at this stage.

And instead of swapping order DSE and DCE should be merged.  I'll
see what I can do for next stage1 or maybe this is an interesting
GSoC project as well.

Tested on x86_64, applied.

Richard.

2015-11-26  Richard Biener  <rguenther@suse.de>

	PR testsuite/67203
	* g++.dg/tree-ssa/pr61034.C: Make expected optimization result
	dependent on PUSH_ARGS_REVERSED.  Drop optimization level and
	also monitor final optimization result.

Index: gcc/testsuite/g++.dg/tree-ssa/pr61034.C
===================================================================
--- gcc/testsuite/g++.dg/tree-ssa/pr61034.C	(revision 230925)
+++ gcc/testsuite/g++.dg/tree-ssa/pr61034.C	(working copy)
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-O3 -fdump-tree-fre2" }
+// { dg-options "-O2 -fdump-tree-fre2 -fdump-tree-optimized" }
 
 #define assume(x) if(!(x))__builtin_unreachable()
 
@@ -43,5 +43,12 @@ bool f(I a, I b, I c, I d) {
 // This works only if everything is inlined into 'f'.
 
 // { dg-final { scan-tree-dump-times ";; Function" 1 "fre2" } }
-// { dg-final { scan-tree-dump-times "free" 10 "fre2" } }
 // { dg-final { scan-tree-dump-times "unreachable" 11 "fre2" } }
+
+// Note that depending on PUSH_ARGS_REVERSED we are presented with
+// a different initial CFG and thus the final outcome is different
+
+// { dg-final { scan-tree-dump-times "free" 10 "fre2" { target x86_64-*-* i?86-*-* } } }
+// { dg-final { scan-tree-dump-times "free" 3 "optimized" { target x86_64-*-* i?86-*-* } } }
+// { dg-final { scan-tree-dump-times "free" 14 "fre2" { target aarch64-*-* ia64-*-* arm-*-* hppa*-*-* sparc*-*-* powerpc*-*-* } } }
+// { dg-final { scan-tree-dump-times "free" 4 "optimized" { target aarch64-*-* ia64-*-* arm-*-* hppa*-*-* sparc*-*-* powerpc*-*-* } } }



More information about the Gcc-patches mailing list