The recent SRA changes triggered a testsuite regression on the c6x port for ssa-dse-26.c.
There was always a degree of difference between the targets, for constraint_expr_equal. Depending on target characteristics there may or may not be DSE opportunities in this function. More importantly is constraint_equal. For most targets we remove an aggregate assignment to "x" and "y". We could probably do better than we are, but that would require further improvements to DSE and perhaps one of the redundancy eliminators such as FRE or DOM or twiddles in the SRA heuristics. On the c6 we actually remove aggregate stores to "a" and "b" which are arguments. Perhaps the differences are related to how structs are passed accounts for this difference. Anyway, on the c6x we fully scalarize the "x" and "y" objects, so there's really nothing for DSE to do with them. So this change to the test makes the original pattern we scanned for apply to everything but the c6x and adds a separate pattern that's only used on the c6x. That new pattern checks for the opportunities in both functions. Committing to the trunk. I'm also watching for other targets that may need similar handling as a result of the SRA work. Jeff
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0247d2cd083..269adb29e94 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-01-30 Jeff Law <l...@redhat.com + + * gcc.dg/tree-ssa/ssa-dse-26.c: Make existing dg-final scan + conditional on !c6x. Add dg-final scan pattern for c6x. + 2020-01-30 Martin Sebor <mse...@redhat.com> PR middle-end/92323 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c index 836a8092ab9..8abc28baccb 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c @@ -30,6 +30,13 @@ constraint_equal (struct constraint a, struct constraint b) && constraint_expr_equal (a.rhs, b.rhs); } -/* { dg-final { scan-tree-dump-times "Deleted dead store: x = " 1 "dse1" } } */ -/* { dg-final { scan-tree-dump-times "Deleted dead store: y = " 1 "dse1" } } */ +/* Most targets should be using this test. */ +/* { dg-final { scan-tree-dump-times "Deleted dead store: x = " 1 "dse1" { target { ! tic6x-*-* } } } } */ +/* { dg-final { scan-tree-dump-times "Deleted dead store: y = " 1 "dse1" { target { ! tic6x-*-* } } } } */ + +/* The c6x port generates significantly different gimple which + changes the SRA and DSE decisions. Verify we remove all + dead stores. */ +/* { dg-final { scan-tree-dump-times "Deleted dead store: \[ax\].. = " 2 "dse1" { target tic6x-*-* } } } */ +/* { dg-final { scan-tree-dump-times "Deleted dead store: \[by\].. = " 2 "dse1" { target tic6x-*-* } } } */