1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-ifcombine-details-blocks" } */
3 
4 void bar (void);
5 
6 void
foo1(unsigned int a)7 foo1 (unsigned int a)
8 {
9   if (a & 1)
10     goto heaven;
11   if (a & 4)
12     goto heaven;
13   return;
14 
15  heaven:
16   bar ();
17 }
18 
19 void
foo2(unsigned int a)20 foo2 (unsigned int a)
21 {
22   if (a & 1)
23     if (a & 4)
24       goto heaven;
25   return;
26 
27  heaven:
28   bar ();
29 }
30 
31 
32 /* The special treatment of a & 1 != 0 in fold caused the pattern not
33    to be recognized due to extra conversions inserted.  */
34 
35 /* { dg-final { scan-tree-dump "optimizing bits or bits test" "ifcombine" } } */
36 /* { dg-final { scan-tree-dump "optimizing double bit test" "ifcombine" } } */
37 /* { dg-final { scan-tree-dump-not "Invalid sum" "ifcombine" } } */
38