2 /* { dg-do compile } */
3 /* { dg-options "-O2 -ftree-loop-if-convert -fdump-tree-widening_mul" } */
5 extern void abort (void);
10 #define T(n, type, op, cond) \
11 __attribute__((noinline, noclone)) \
13 f##n (type x, type y) \
20 T (1, unsigned int, x
- y
, if (r
>= x
) foo (0))
21 T (2, unsigned long, x
- y
, if (r
< x
) foo (0))
22 T (3, unsigned short, x
- y
, if (x
<= r
) foo (r
))
23 T (4, unsigned long long, x
- y
, if (d
|| x
> r
) foo (0))
24 T (5, unsigned int, x
- y
, if (d
|| r
>= x
) foo (0))
25 T (6, unsigned long, x
- y
, if (d
|| r
< x
) foo (0))
26 T (7, unsigned short, x
- y
, if (d
|| x
<= r
) foo (0))
27 T (8, unsigned long long, x
- y
, if (d
|| x
> r
) foo (0))
28 T (9, unsigned int, x
- y
, if (r
> y
) foo (0))
29 T (10, unsigned long, x
- y
, if (r
<= y
) foo (0))
30 T (11, unsigned short, x
- y
, if (y
< r
) foo (r
))
31 T (12, unsigned long long, x
- y
, if (y
>= r
) foo (0))
32 T (13, unsigned int, x
- y
, if (r
>= y
) foo (0))
33 T (14, unsigned long, x
- y
, if (r
< y
) foo (0))
34 T (15, unsigned short, x
- y
, if (y
<= r
) foo (r
))
35 T (16, unsigned long long, x
- y
, if (d
|| y
> r
) foo (0))
36 T (17, unsigned int, x
- y
, if (d
|| r
> y
) foo (0))
37 T (18, unsigned long, x
- y
, if (d
|| r
<= y
) foo (0))
38 T (19, unsigned char, x
- y
, if (d
|| y
< r
) foo (0))
39 T (20, unsigned long long, x
- y
, if (d
|| y
>= r
) foo (0))
40 T (21, unsigned int, x
- y
, if (d
|| r
>= y
) foo (0))
41 T (22, unsigned long, x
- y
, if (d
|| r
< y
) foo (0))
42 T (23, unsigned short, x
- y
, if (d
|| y
<= r
) foo (0))
43 T (24, unsigned long long, x
- y
, if (d
|| y
> r
) foo (0))
44 T (25, unsigned int, x
+ y
, if (r
> x
) foo (0))
45 T (26, unsigned long, x
+ y
, if (r
<= x
) foo (0))
46 T (27, unsigned short, x
+ y
, if (x
< r
) foo (r
))
47 T (28, unsigned long long, x
+ y
, if (x
>= r
) foo (0))
48 T (29, unsigned int, x
+ y
, if (d
|| r
> x
) foo (0))
49 T (30, unsigned long, x
+ y
, if (d
|| r
<= x
) foo (0))
50 T (31, unsigned char, x
+ y
, if (d
|| x
< r
) foo (0))
51 T (32, unsigned long long, x
+ y
, if (d
|| x
>= r
) foo (0))
52 T (33, unsigned int, x
+ y
, if (r
> y
) foo (0))
53 T (34, unsigned long, x
+ y
, if (r
<= y
) foo (0))
54 T (35, unsigned short, x
+ y
, if (y
< r
) foo (r
))
55 T (36, unsigned long long, x
+ y
, if (y
>= r
) foo (0))
56 T (37, unsigned int, x
+ y
, if (d
|| r
> y
) foo (0))
57 T (38, unsigned long, x
+ y
, if (d
|| r
<= y
) foo (0))
58 T (39, unsigned char, x
+ y
, if (d
|| y
< r
) foo (0))
59 T (40, unsigned long long, x
+ y
, if (d
|| y
>= r
) foo (0))
61 /* { dg-final { scan-tree-dump-not "ADD_OVERFLOW" "widening_mul" } } */
62 /* { dg-final { scan-tree-dump-not "SUB_OVERFLOW" "widening_mul" } } */