From: Richard Guenther Date: Thu, 28 Apr 2011 09:55:41 +0000 (+0000) Subject: re PR tree-optimization/40052 (missed optimizations on (extended) logical types:... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ecde111c12993f6aace9f151b30e1d9dbcfd8be;p=gcc.git re PR tree-optimization/40052 (missed optimizations on (extended) logical types: (x | 1) --> 1) 2011-04-28 Richard Guenther PR tree-optimization/40052 PR tree-optimization/15347 * gcc.dg/tree-ssa/vrp57.c: New testcase. * gcc.dg/pr15347.c: Likewise. From-SVN: r173064 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9891d226562..7f3804b98cb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2011-04-28 Richard Guenther + + PR tree-optimization/40052 + PR tree-optimization/15347 + * gcc.dg/tree-ssa/vrp57.c: New testcase. + * gcc.dg/pr15347.c: Likewise. + 2011-04-28 Paolo Carlini PR c++/48530 diff --git a/gcc/testsuite/gcc.dg/pr15347.c b/gcc/testsuite/gcc.dg/pr15347.c new file mode 100644 index 00000000000..b95b0ea2a5e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr15347.c @@ -0,0 +1,10 @@ +/* { dg-do link } */ + +extern void link_error (void); +int +main () +{ + if ("<12ers" + 1 == 0) + link_error (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp57.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp57.c new file mode 100644 index 00000000000..c736adc9e3e --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp57.c @@ -0,0 +1,17 @@ +/* PR40052 */ +/* { dg-do compile } */ +/* { dg-options "-O -ftree-vrp -fdump-tree-optimized" } */ + +int foo(_Bool b) +{ + return b | 1; +} + +int bar(_Bool b) +{ + return b & -2; +} + +/* { dg-final { scan-tree-dump "return 0;" "optimized" } } */ +/* { dg-final { scan-tree-dump "return 1;" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */