1 /* PR tree-optimization/77664 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-reassoc1-details" } */
4
5 extern void foo (void);
6
7 /* { dg-final { scan-tree-dump-times "Optimizing range test \[^\n\r]* and comparison" 6 "reassoc1" } } */
8
9 __attribute__((noinline, noclone)) void
fn1(long long int a,unsigned short b,int c)10 fn1 (long long int a, unsigned short b, int c)
11 {
12 if (a >= 0 && c && a < b)
13 foo ();
14 }
15
16 __attribute__((noinline, noclone)) void
fn2(long long int a,unsigned short b,int c)17 fn2 (long long int a, unsigned short b, int c)
18 {
19 if (a < 0 || c || a >= b)
20 foo ();
21 }
22
23 __attribute__((noinline, noclone)) void
fn3(long long int a,unsigned short b)24 fn3 (long long int a, unsigned short b)
25 {
26 if (a < 0 || b < a)
27 foo ();
28 }
29
30 __attribute__((noinline, noclone)) void
fn4(long long int a,unsigned short b)31 fn4 (long long int a, unsigned short b)
32 {
33 if (a <= b && a >= 0)
34 foo ();
35 }
36
37 __attribute__((noinline, noclone)) void
fn5(long long int a,unsigned short b)38 fn5 (long long int a, unsigned short b)
39 {
40 if (a < 0 | a > b)
41 foo ();
42 }
43
44 __attribute__((noinline, noclone)) void
fn6(long long int a,unsigned short b)45 fn6 (long long int a, unsigned short b)
46 {
47 if (b >= a & a >= 0)
48 foo ();
49 }
50