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

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 /* { dg-options "-O2 -fdump-tree-vrp1-details" } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 typedef const struct bitmap_head_def *const_bitmap;
kono
parents:
diff changeset
7 typedef unsigned long BITMAP_WORD;
kono
parents:
diff changeset
8 typedef struct bitmap_element_def {
kono
parents:
diff changeset
9 struct bitmap_element_def *next;
kono
parents:
diff changeset
10 BITMAP_WORD bits[((128 + (8 * 8 * 1u) - 1) / (8 * 8 * 1u))];
kono
parents:
diff changeset
11 } bitmap_element;
kono
parents:
diff changeset
12 typedef struct bitmap_head_def {
kono
parents:
diff changeset
13 bitmap_element *first;
kono
parents:
diff changeset
14 } bitmap_head;
kono
parents:
diff changeset
15 unsigned char
kono
parents:
diff changeset
16 bitmap_single_bit_set_p (const_bitmap a)
kono
parents:
diff changeset
17 {
kono
parents:
diff changeset
18 unsigned long count = 0;
kono
parents:
diff changeset
19 const bitmap_element *elt;
kono
parents:
diff changeset
20 unsigned ix;
kono
parents:
diff changeset
21 if ((!(a)->first))
kono
parents:
diff changeset
22 return 0;
kono
parents:
diff changeset
23 elt = a->first;
kono
parents:
diff changeset
24 if (elt->next != ((void *)0))
kono
parents:
diff changeset
25 return 0;
kono
parents:
diff changeset
26 for (ix = 0; ix != ((128 + (8 * 8 * 1u) - 1) / (8 * 8 * 1u)); ix++)
kono
parents:
diff changeset
27 {
kono
parents:
diff changeset
28 count += __builtin_popcountl (elt->bits[ix]);
kono
parents:
diff changeset
29 if (count > 1)
kono
parents:
diff changeset
30 return 0;
kono
parents:
diff changeset
31 }
kono
parents:
diff changeset
32 return count == 1;
kono
parents:
diff changeset
33 }
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 /* Verify that VRP simplified an "if" statement. */
kono
parents:
diff changeset
36 /* { dg-final { scan-tree-dump "Folded into: if.*" "vrp1"} } */
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38