Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / pr81192.c
blobc46ac18fd9af1927bd46afa5b8646b0b58e8c30a
1 /* { dg-options "-Os -fgimple -fdump-tree-pre-details -fdisable-tree-evrp -fno-tree-dse" } */
3 #if __SIZEOF_INT__ == 2
4 #define unsigned __UINT32_TYPE__
5 #define int __INT32_TYPE__
6 #endif
8 unsigned a;
9 int b, c;
11 void __GIMPLE(ssa, startwith("pre")) fn2 ()
13 int b_lsm6;
14 int j;
15 int c0_1;
16 int iftmp2_8;
18 __BB(2):
19 a = _Literal (unsigned)30;
20 c0_1 = c;
21 b_lsm6_9 = b;
22 goto __BB7;
24 __BB(3):
25 if (j_6(D) != _Literal (int)2147483647)
26 goto __BB4;
27 else
28 goto __BB5;
30 __BB(4):
31 iftmp2_8 = j_6(D) + _Literal (int)1;
32 goto __BB5;
34 __BB(5):
35 b_lsm6_10 = _Literal (int)2147483647;
36 goto __BB6;
38 __BB(6):
39 if (c0_1 != _Literal (int) 0)
40 goto __BB3;
41 else
42 goto __BB8;
44 __BB(8):
45 goto __BB7;
47 __BB(7):
48 goto __BB6;
52 #if 0
53 /* This used to be a C based testcase but ccp3 would now would remove
54 the setting of iftmp2_8 (in the above gimple) which would cause PRE
55 not to test what PRE was doing incorrectly. The original code is below. */
56 /* Disable tree-evrp because the new version of evrp sees
57 <bb 3> :
58 if (j_8(D) != 2147483647)
59 goto <bb 4>; [50.00%]
60 else
61 goto <bb 5>; [50.00%]
62 <bb 4> :
63 iftmp.2_11 = j_8(D) + 1;
64 <bb 5> :
65 # iftmp.2_12 = PHI <j_8(D)(3), iftmp.2_11(4)>
67 EVRP now recognizes a constant can be propagated into the 3->5 edge and
68 produces
69 # iftmp.2_12 = PHI <2147483647(3), iftmp.2_11(4)>
70 which causes the situation being tested to dissapear before we get to PRE. */
72 /* Likewise disable DSE which also elides the tail merging "opportunity". */
74 static int
75 fn1 (int p1, int p2)
77 return p1 > 2147483647 - p2 ? p1 : p1 + p2;
80 void
81 fn2 (void)
83 int j;
84 a = 30;
85 for (; a;)
86 for (; c; b = fn1 (j, 1))
89 #endif
91 /* { dg-final { scan-tree-dump-times "(?n)find_duplicates: <bb .*> duplicate of <bb .*>" 1 "pre" } } */