annotate gcc/testsuite/gcc.dg/tree-ssa/vrp87.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Setting LOGICAL_OP_NON_SHORT_CIRCUIT to 0 leads to two conditional jumps
kono
parents:
diff changeset
2 when evaluating an && condition. */
kono
parents:
diff changeset
3 /* { dg-do compile { target { ! { logical_op_short_circuit || { m68k*-*-* mmix*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* } } } } } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 /* { dg-options "-O2 -fdump-tree-fre1-details" } */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 struct bitmap_head_def;
kono
parents:
diff changeset
8 typedef struct bitmap_head_def *bitmap;
kono
parents:
diff changeset
9 typedef const struct bitmap_head_def *const_bitmap;
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 typedef unsigned long BITMAP_WORD;
kono
parents:
diff changeset
13 typedef struct bitmap_element_def
kono
parents:
diff changeset
14 {
kono
parents:
diff changeset
15 struct bitmap_element_def *next;
kono
parents:
diff changeset
16 unsigned int indx;
kono
parents:
diff changeset
17 BITMAP_WORD bits[((128 + (8 * 8 * 1u) - 1) / (8 * 8 * 1u))];
kono
parents:
diff changeset
18 } bitmap_element;
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 typedef struct bitmap_head_def
kono
parents:
diff changeset
26 {
kono
parents:
diff changeset
27 bitmap_element *first;
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 } bitmap_head;
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 static __inline__ unsigned char
kono
parents:
diff changeset
34 bitmap_elt_ior (bitmap dst, bitmap_element * dst_elt,
kono
parents:
diff changeset
35 bitmap_element * dst_prev, const bitmap_element * a_elt,
kono
parents:
diff changeset
36 const bitmap_element * b_elt, unsigned char changed)
kono
parents:
diff changeset
37 {
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 if (a_elt)
kono
parents:
diff changeset
40 {
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 if (!changed && dst_elt)
kono
parents:
diff changeset
43 {
kono
parents:
diff changeset
44 changed = 1;
kono
parents:
diff changeset
45 }
kono
parents:
diff changeset
46 }
kono
parents:
diff changeset
47 else
kono
parents:
diff changeset
48 {
kono
parents:
diff changeset
49 changed = 1;
kono
parents:
diff changeset
50 }
kono
parents:
diff changeset
51 return changed;
kono
parents:
diff changeset
52 }
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 unsigned char
kono
parents:
diff changeset
55 bitmap_ior_into (bitmap a, const_bitmap b)
kono
parents:
diff changeset
56 {
kono
parents:
diff changeset
57 bitmap_element *a_elt = a->first;
kono
parents:
diff changeset
58 const bitmap_element *b_elt = b->first;
kono
parents:
diff changeset
59 bitmap_element *a_prev = ((void *) 0);
kono
parents:
diff changeset
60 unsigned char changed = 0;
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 while (b_elt)
kono
parents:
diff changeset
63 {
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 if (!a_elt || a_elt->indx == b_elt->indx)
kono
parents:
diff changeset
66 changed = bitmap_elt_ior (a, a_elt, a_prev, a_elt, b_elt, changed);
kono
parents:
diff changeset
67 else if (a_elt->indx > b_elt->indx)
kono
parents:
diff changeset
68 changed = 1;
kono
parents:
diff changeset
69 b_elt = b_elt->next;
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 }
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 return changed;
kono
parents:
diff changeset
75 }
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 /* Verify that FRE simplified an if stmt. */
kono
parents:
diff changeset
78 /* { dg-final { scan-tree-dump "Replaced a_elt_\[0-9\]+ != 0B with 1" "fre1" } } */
kono
parents:
diff changeset
79 /* { dg-final { scan-tree-dump "Replaced _\[0-9\]+ & _\[0-9\]+ with _\[0-9\]+" "fre1" } } */