2 /* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms" } */
5 typedef __SIZE_TYPE__
size_t;
6 extern void *malloc (size_t);
7 extern void free (void *);
8 extern void abort (void);
10 struct regstat_n_sets_and_refs_t
16 struct regstat_n_sets_and_refs_t
*regstat_n_sets_and_refs
;
25 struct df_reg_info
**def_regs
;
26 struct df_reg_info
**use_regs
;
31 REG_N_SETS (int regno
)
33 return regstat_n_sets_and_refs
[regno
].sets
;
36 __attribute__ ((noinline
))
37 int max_reg_num (void)
42 __attribute__ ((noinline
))
43 void regstat_init_n_sets_and_refs (void)
46 unsigned int max_regno
= max_reg_num ();
48 for (i
= 0; i
< max_regno
; i
++)
50 (regstat_n_sets_and_refs
[i
].sets
= (df
->def_regs
[(i
)]->n_refs
));
51 (regstat_n_sets_and_refs
[i
].refs
=
52 (df
->use_regs
[(i
)]->n_refs
) + REG_N_SETS (i
));
57 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
58 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
60 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
62 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
64 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
68 { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38,
69 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76,
71 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116,
73 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150,
75 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186,
83 struct df_reg_info
*b
[100], *c
[100];
85 size_t s
= sizeof (struct df_reg_info
);
86 struct regstat_n_sets_and_refs_t a
[100];
89 regstat_n_sets_and_refs
= a
;
92 for (i
= 0; i
< 100; i
++)
94 b
[i
] = (struct df_reg_info
*) malloc (s
);
96 c
[i
] = (struct df_reg_info
*) malloc (s
);
102 regstat_init_n_sets_and_refs ();
104 for (i
= 0; i
< 100; i
++)
105 if ((a
[i
].sets
!= a_sets
[i
]) || (a
[i
].refs
!= a_refs
[i
]))
108 for (i
= 0; i
< 100; i
++)
117 /* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target powerpc*-*-* } } } */