annotate gcc/testsuite/gcc.dg/pr67089-6.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR target/67089 */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3 /* { dg-options "-O2 -ftree-loop-if-convert -fdump-tree-widening_mul" } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 extern void abort (void);
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 int cnt;
kono
parents:
diff changeset
8 unsigned int a[16], b[16], c[16], d;
kono
parents:
diff changeset
9 void foo (int x);
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 __attribute__((noinline, noclone)) void
kono
parents:
diff changeset
12 f0 (unsigned int x)
kono
parents:
diff changeset
13 {
kono
parents:
diff changeset
14 for (int i = 0; i < 16; i++)
kono
parents:
diff changeset
15 {
kono
parents:
diff changeset
16 unsigned int r = x - a[i];
kono
parents:
diff changeset
17 b[i] = r;
kono
parents:
diff changeset
18 c[i] = r > x ? 7 : x;
kono
parents:
diff changeset
19 }
kono
parents:
diff changeset
20 }
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 #define T(n, type, op, cond) \
kono
parents:
diff changeset
23 __attribute__((noinline, noclone)) \
kono
parents:
diff changeset
24 type \
kono
parents:
diff changeset
25 f##n (type x, type y) \
kono
parents:
diff changeset
26 { \
kono
parents:
diff changeset
27 type r = op; \
kono
parents:
diff changeset
28 cond; \
kono
parents:
diff changeset
29 return r; \
kono
parents:
diff changeset
30 }
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 T (1, unsigned int, x - y, if (r > x) foo (0))
kono
parents:
diff changeset
33 T (2, unsigned long, x - y, if (r <= x) foo (0))
kono
parents:
diff changeset
34 T (3, unsigned short, x - y, if (x < r) foo (r))
kono
parents:
diff changeset
35 T (4, unsigned long long, x - y, if (x >= r) foo (0))
kono
parents:
diff changeset
36 T (5, unsigned int, x - y, if (d || r > x) foo (0))
kono
parents:
diff changeset
37 T (6, unsigned long, x - y, if (d || r <= x) foo (0))
kono
parents:
diff changeset
38 T (7, unsigned char, x - y, if (d || x < r) foo (0))
kono
parents:
diff changeset
39 T (8, unsigned long long, x - y, if (d || x >= r) foo (0))
kono
parents:
diff changeset
40 T (9, unsigned int, x + y, if (r >= x) foo (0))
kono
parents:
diff changeset
41 T (10, unsigned long, x + y, if (r < x) foo (0))
kono
parents:
diff changeset
42 T (11, unsigned short, x + y, if (x <= r) foo (r))
kono
parents:
diff changeset
43 T (12, unsigned long long, x + y, if (d || x > r) foo (0))
kono
parents:
diff changeset
44 T (13, unsigned int, x + y, if (d || r >= x) foo (0))
kono
parents:
diff changeset
45 T (14, unsigned long, x + y, if (d || r < x) foo (0))
kono
parents:
diff changeset
46 T (15, unsigned short, x + y, if (d || x <= r) foo (0))
kono
parents:
diff changeset
47 T (16, unsigned long long, x + y, if (d || x > r) foo (0))
kono
parents:
diff changeset
48 T (17, unsigned int, x + y, if (r >= y) foo (0))
kono
parents:
diff changeset
49 T (18, unsigned long, x + y, if (r < y) foo (0))
kono
parents:
diff changeset
50 T (19, unsigned short, x + y, if (y <= r) foo (r))
kono
parents:
diff changeset
51 T (20, unsigned long long, x + y, if (d || y > r) foo (0))
kono
parents:
diff changeset
52 T (21, unsigned int, x + y, if (d || r >= y) foo (0))
kono
parents:
diff changeset
53 T (22, unsigned long, x + y, if (d || r < y) foo (0))
kono
parents:
diff changeset
54 T (23, unsigned short, x + y, if (d || y <= r) foo (0))
kono
parents:
diff changeset
55 T (24, unsigned long long, x + y, if (d || y > r) foo (0))
kono
parents:
diff changeset
56 T (25, unsigned short, 2U - x, if (r > 2U) foo (0))
kono
parents:
diff changeset
57 T (26, unsigned char, 2U - x, if (r <= 2U) foo (0))
kono
parents:
diff changeset
58
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
59 /* { dg-final { scan-tree-dump-times "ADD_OVERFLOW" 16 "widening_mul" { target { i?86-*-* x86_64-*-* } } } } */
111
kono
parents:
diff changeset
60 /* { dg-final { scan-tree-dump-times "SUB_OVERFLOW" 11 "widening_mul" { target { { i?86-*-* x86_64-*-* } && { ! ia32 } } } } } */
kono
parents:
diff changeset
61 /* { dg-final { scan-tree-dump-times "SUB_OVERFLOW" 9 "widening_mul" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */