1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fno-tree-vrp -fdump-tree-optimized-details-blocks" } */
3 
4 /* Testcase for PR31657.  */
5 
f(int x,int a,int b)6 int f(int x, int a, int b)
7 {
8   int t = 0;
9   int c = 1 << a;
10   if (!(x & 1))
11     t = 0;
12   else
13     if (x & (1 << 2))
14       t = 3;
15     else
16       t = 0;
17   return t;
18 }
19 /* { dg-final { scan-tree-dump "& 5" "optimized" } } */
20 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */
21