------- Comment #8 from pranav dot bhandarkar at gmail dot com 2007-08-24 13:28 ------- Created an attachment (id=14102) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14102&action=view) Another testcase displaying the said behaviour
IMHO, the code generated for the following can benefit from Strength reduction. It will be possible to generate post_inc due to strength reduction. for (dp = i = 0; i < c; i++) { dp += a[i] * b[i]; } The RTL code generated for the loop is of the form ( numbers represent pseudo reg numbers) 137 and 136 hold the base addresses of the two arrays before entry into the loop. 132 = 0 ; #i, 133 = 132 ; #dp Label: 139 = *(137 + 132) 140 = *(136 + 132) 141 = 140 * 139 133 += 141 ;#dp 132 += 2 conditional_jump back to Label. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32283