diff options
author | Richard Biener <rguenther@suse.de> | 2016-08-16 11:22:47 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-08-16 11:22:47 +0000 |
commit | f4eec0a3e34cd709476b5062e44ef0075c75f426 (patch) | |
tree | b0fc0fa96f99c94f842f790b5049f90e7d5fec39 /gcc/testsuite/gcc.dg | |
parent | 8f21990a676b65040761886e54fc9d5149ec014c (diff) | |
download | gcc-f4eec0a3e34cd709476b5062e44ef0075c75f426.zip gcc-f4eec0a3e34cd709476b5062e44ef0075c75f426.tar.gz gcc-f4eec0a3e34cd709476b5062e44ef0075c75f426.tar.bz2 |
re PR tree-optimization/76783 (wrong code with conditional vector assignment @ -Og)
2016-08-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/76783
* tree-ssa-propagate.c (ssa_prop_init): Use RPO order. Clear
BB visited flags at start.
* gcc.dg/pr76783.c: New testcase.
* gcc.dg/tree-ssa/pr69270-2.c: Adjust.
From-SVN: r239496
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr76783.c | 28 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/pr69270-2.c | 14 |
2 files changed, 31 insertions, 11 deletions
diff --git a/gcc/testsuite/gcc.dg/pr76783.c b/gcc/testsuite/gcc.dg/pr76783.c new file mode 100644 index 0000000..22aef56 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr76783.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-require-effective-target int128 } */ +/* { dg-options "-Og -w -Wno-psabi" } */ + +typedef unsigned __int128 u128; +typedef unsigned __int128 v64u128 __attribute__ ((vector_size (64))); + +u128 __attribute__ ((noinline, noclone)) +foo (unsigned c, v64u128 v) +{ + v64u128 u; + if (c) { + u = (v64u128){(u128)0, (u128)0}; + } else { + u = (v64u128){(u128)0, (u128)1}; + } + u += v; + return u[1]; +} + +int +main () +{ + u128 x = foo (0, (v64u128){ }); + if (x != 1) + __builtin_abort(); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr69270-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr69270-2.c index 15c7bdd..b617f2d 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr69270-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr69270-2.c @@ -1,16 +1,8 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-dom3-details -w" } */ +/* { dg-options "-O2 -fdump-tree-dce2 -w" } */ -/* There should be a reference to usecount that turn into - constants. */ -/* { dg-final { scan-tree-dump-times "Replaced .usecount_\[0-9\]+. with constant .1." 1 "dom3"} } */ - -/* And an assignment using usecount ought to fold down to constants. */ -/* { dg-final { scan-tree-dump-times "Folded to: usecount_\[0-9\]+ = 2;" 1 "dom3"} } */ - -/* The arithmetic using usecount should be gone, except for the one in the - details debugging. */ -/* { dg-final { scan-tree-dump-times "usecount_\[0-9\]+ = usecount_\[0-9\]+ . 1;" 1 "dom3"} } */ +/* The arithmetic using usecount should be gone. */ +/* { dg-final { scan-tree-dump-times "usecount_\[0-9\]+ = usecount_\[0-9\]+ . 1;" 0 "dce2"} } */ typedef union tree_node *tree; typedef union gimple_statement_d *gimple; |