------- Comment #10 from pinskia at gcc dot gnu dot org 2007-06-11 00:47 ------- There are a couple of issues here, first pointer_plus improves the aliasing set issue, but then PRE comes around and messes it up because it does not add pointer types which have DECL_BASED_ON_RESTRICT_P/DECL_GET_RESTRICT_BASE setup correctly.
Disabling PRE on powerpc-linux-gnu (on the pointer_plus branch) is enough to get the RTL optimizers to optimize away the extra loads and we get for the inner loop: .L3: stfsx 0,9,3 addi 9,9,4 bdnz .L3 Which is almost the best you can do :). One more issue (for x86) is expand emits code that causes the rtl optimizers not to optimize well as they only look into loads in sets. I don't know how to fix that issue without fixing restrict at the tree level. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16913