------- Comment #4 from christian dot bruel at st dot com 2007-04-03 15:30 ------- This missed optimisation appears with all counted loops. The ir in gimple produces
j = 0; <D1202>:; j = j + 1; if (j <= 999) { goto <D1202>; } The transformation to do ( j=1000; j=j-1; if (j)...) will allow the decrement and test pattern to be catched by combine. Since this transformation needs to know about code selection (and is only useful if the number of issued instructions is > 1), it seems best to do it in rtl. I'm thinking about strength_reduce in loop.c when we optimize bivs. Question: does it make sense to do this transformation in loop.c ? I'm thinking at strength_reduce. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29953