------- Comment #4 from dalej at apple dot com 2007-01-12 20:13 ------- With pic, the load of the global's address is pulled outside the loop, so the "base" is a register rather than the global. This causes ivopts to represent index*step all in the index field rather than as two separate fields, so the dump looks like MEM[base: &arr_base, index: (int *) iter * 4B] = D.1877; instead of MEM[symbol: arr_base, index: (int *) iter, step: 4B] = D.1877; so the test fails, but the generated code is correct and optimal. I suggest adding -fno-pic to the test, does that look OK?
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25443