1 /* PR debug/49580 */ 2 /* { dg-do compile } */ 3 /* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details" } */ 4 5 #include <stdarg.h> 6 #include <stdlib.h> 7 8 #define N 1600 9 10 unsigned int ub[N]; 11 unsigned char reg_has_output_reload[N]; 12 unsigned int uc[N]; 13 14 __attribute__ ((noinline)) main2(unsigned int regno,unsigned int n_reloads)15 void main2 (unsigned int regno, unsigned int n_reloads) 16 { 17 unsigned int nr=0; 18 19 if (regno> ub[regno]) 20 nr=regno; 21 else 22 nr=ub[nr]; 23 24 while (nr-- > 0) 25 if (n_reloads == 0 || reg_has_output_reload[regno + nr] == 0) 26 ub[regno + nr] = 0; 27 } 28 main(void)29int main (void) 30 { 31 main2 (799, 0); 32 return 0; 33 } 34 35 36 /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */ 37 /* { dg-final { cleanup-tree-dump "parloops" } } */ 38 39