From: Richard Guenther Date: Thu, 19 Jan 2012 09:37:58 +0000 (+0000) Subject: re PR tree-optimization/37997 (PHI translation does not simplify to non-constants) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b4eaf7e352385b571bb75fd60eccf973b24c451;p=gcc.git re PR tree-optimization/37997 (PHI translation does not simplify to non-constants) 2012-01-19 Richard Guenther PR tree-optimization/37997 * gcc.dg/tree-ssa/ssa-pre-28.c: New testcase. From-SVN: r183297 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a0d5a199013..2fe1ddd13d3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-01-19 Richard Guenther + + PR tree-optimization/37997 + * gcc.dg/tree-ssa/ssa-pre-28.c: New testcase. + 2012-01-19 Andrey Belevantsev PR rtl-optimization/51505 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c new file mode 100644 index 00000000000..3c27a1a29f5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c @@ -0,0 +1,21 @@ +/* PR37997 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-pre-details" } */ + +int foo (int i, int b, int result) +{ + int mask; + if (b) + mask = -1; + else + mask = 0; + result = i + 1; + result = result & mask; + return result; +} + +/* We should insert i + 1 into the if (b) path as well as the simplified + i + 1 & -1 expression. And do replacement with two PHI temps. */ + +/* { dg-final { scan-tree-dump-times "with prephitmp" 2 "pre" } } */ +/* { dg-final { cleanup-tree-dump "pre" } } */