1 /* PR rtl-optimization/38245 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
4
5 extern void link_error (void);
6
7 void
f1(unsigned int a)8 f1 (unsigned int a)
9 {
10 if (a != 28)
11 {
12 if (4 / a == 5)
13 link_error ();
14 }
15 }
16
17 void
f2(unsigned int a)18 f2 (unsigned int a)
19 {
20 if (4 / a == 5)
21 link_error ();
22 }
23
24 void
f3(unsigned int a)25 f3 (unsigned int a)
26 {
27 if (4 / (a & 0xff) == 5)
28 link_error ();
29 }
30
31 void
f4(unsigned int a,unsigned int b)32 f4 (unsigned int a, unsigned int b)
33 {
34 if ((b & 3) / ((a & 0xff) + 1) == 5)
35 link_error ();
36 }
37
38 void
f5(int a)39 f5 (int a)
40 {
41 if (a != 28)
42 {
43 if (4 / a == 5)
44 link_error ();
45 }
46 }
47
48 void
f6(int a)49 f6 (int a)
50 {
51 if (4 / a == 5)
52 link_error ();
53 }
54
55 void
f7(int a)56 f7 (int a)
57 {
58 if (4 / (a & 0xff) == 5)
59 link_error ();
60 }
61
62 void
f8(int a,int b)63 f8 (int a, int b)
64 {
65 if ((b & 3) / ((a & 0xff) + 1) == 5)
66 link_error ();
67 }
68
69 void
f9(int a,int b)70 f9 (int a, int b)
71 {
72 if (b >= 4)
73 if ((a / b) == __INT_MAX__ / 2)
74 link_error ();
75 }
76
77 void
f10(unsigned int a,unsigned int b)78 f10 (unsigned int a, unsigned int b)
79 {
80 if (b >= 16)
81 if ((a / b) == __INT_MAX__ / 4)
82 link_error ();
83 }
84
85 void
f11(int a,int b)86 f11 (int a, int b)
87 {
88 if (b <= -32)
89 if ((a / b) == -__INT_MAX__ / 16)
90 link_error ();
91 }
92
93 void
f12(int a,int b)94 f12 (int a, int b)
95 {
96 if (a >= -6 && a <= 4)
97 if ((a / b) == -7 || (a / b) == 7)
98 link_error ();
99 }
100
101 void
f13(unsigned int a,unsigned int b)102 f13 (unsigned int a, unsigned int b)
103 {
104 if (a <= 4)
105 if ((a / b) == 5)
106 link_error ();
107 }
108
109 /* { dg-final { scan-tree-dump-not "link_error" "optimized" } } */
110