From: vries Date: Fri, 7 Sep 2012 09:21:21 +0000 (+0000) Subject: 2012-09-07 Tom de Vries X-Git-Tag: upstream/4.9.2~10767 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd745d7cbef0b64a1978dc123f02d1acb88c2769;p=platform%2Fupstream%2Flinaro-gcc.git 2012-09-07 Tom de Vries PR tree-optimization/53986 * gcc.dg/tree-ssa/vrp80.c: New test. * gcc.dg/tree-ssa/vrp80-2.c: Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191058 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7622723..d9df173 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2012-09-07 Tom de Vries + + PR tree-optimization/53986 + * gcc.dg/tree-ssa/vrp80.c: New test. + * gcc.dg/tree-ssa/vrp80-2.c: Same. + 2012-09-06 Jason Merrill PR c++/54341 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp80-2.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp80-2.c new file mode 100644 index 0000000..bb38f27 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp80-2.c @@ -0,0 +1,38 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-switch-conversion -fdump-tree-vrp1" } */ + +extern void vrp_keep (void); + +/* Test <<. */ + +void +f3 (int s, int b) +{ + if (s >> 3 == -2) + /* s in range [-16, -9]. */ + { + s += 17; + /* s in range [1, 8]. */ + b = (b & 1) + 1; + /* b in range [1, 2]. */ + b = b << s; + /* b in range [bmin << smin, bmax << smax], + == [1 << 1, 2 << 8] + == [2, 512]. */ + if (b == 2) + vrp_keep (); + if (b == 512) + vrp_keep (); + } +} + +int +main () +{ + return 0; +} + +/* { dg-final { scan-tree-dump-times "vrp_keep \\(" 2 "vrp1"} } */ +/* { dg-final { cleanup-tree-dump "vrp1" } } */ + + diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp80.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp80.c new file mode 100644 index 0000000..2d00040 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp80.c @@ -0,0 +1,33 @@ +/* { dg-do link } */ +/* { dg-options "-O2 -fno-tree-switch-conversion" } */ + +extern void link_error (void); + +/* Test <<. */ + +void +f3 (int s, int b) +{ + if (s >> 3 == -2) + /* s in range [-16, -9]. */ + { + s += 17; + /* s in range [1, 8]. */ + b = (b & 1) + 1; + /* b in range [1, 2]. */ + b = b << s; + /* b in range [bmin << smin, bmax << smax], + == [1 << 1, 2 << 8] + == [2, 512]. */ + if (b == 1 || b == 513) + link_error (); + } +} + +int +main () +{ + return 0; +} + +