2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.target / hppa / shadd-3.c
blobf0443ea997776e9e5c9ec9cccef876317a71931d
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
3 /* In this test we want to verify that combine canonicalizes the
4 MULT into an ASHIFT which in turn allows postreload-gcse to
5 find the common subexpression.
7 Neither pass dumps stuff in a format that is particularly good
8 for parsing here, so we count the shadd insns. More is not
9 necessarily better in this test. If this test is too fragile
10 over time we'll have to revisit the combine and/or postreload
11 dumps. */
12 /* { dg-final { scan-assembler-times "sh.add" 5 } } */
14 extern void oof (void);
15 typedef struct simple_bitmap_def *sbitmap;
16 struct simple_bitmap_def
18 unsigned char *popcount;
19 unsigned int n_bits;
20 unsigned long elms[1];
22 __inline__ void
23 SET_BIT (sbitmap map, unsigned int bitno)
25 if (map->popcount)
27 unsigned char oldbit;
28 oldbit =
29 ((map)->elms[bitno / 64]);
30 if (!oldbit)
31 oof ();
33 map->elms[bitno / 64] |= 1;
36 void
37 fix_bb_placements (int indx1, int indx2, sbitmap in_queue)
39 SET_BIT (in_queue, indx1);
40 SET_BIT (in_queue, indx2);