------- Comment #6 from amylaar at gcc dot gnu dot org 2007-04-23 19:37 ------- (In reply to comment #5) > Fixed. >
I also see mayalias-2 failing with gcc 4.2 on arc at -O3 -fomit-frame-pointer. Life analysis finds a 'clever' way to initialize the pointer p by copying the frame pointer and then using pre-decrement addressing. The following rtl dump is from mayalias-2.c.134r.life2 ; note that insn 13 is the store of 1, and insn 15 is the dependent load. Because the address in insn 13 does not show the frame pointer explicitly, fixed_scalar_and_varying_struct_p decides that 'p' is varying, and hence the two memory accesses don't alias. (insn:HI 42 7 8 2 (set (reg/v/f:SI 149 [ p ]) (reg/f:SI 27 fp)) 12 {*movsi_insn} (nil) (nil)) (insn:HI 8 42 10 2 (set (mem/c/i:SI (pre_dec:SI (reg/v/f:SI 149 [ p ])) [3 a+0 S4 A32]) (reg:SI 151)) 12 {*movsi_insn} (insn_list:REG_DEP_TRUE 7 (insn_list:REG_DEP_TRUE 42 (nil))) (expr_list:REG_DEAD (reg:SI 151) (expr_list:REG_INC (reg/v/f:SI 149 [ p ]) (expr_list:REG_EQUAL (const_int 10 [0xa]) (nil))))) (note:HI 10 8 12 2 NOTE_INSN_DELETED) (insn:HI 12 10 13 2 (set (reg:HI 152) (const_int 1 [0x1])) 7 {*movhi_insn} (nil) (nil)) (insn:HI 13 12 15 2 (set (mem/s/j:HI (reg/v/f:SI 149 [ p ]) [0 <variable>.x+0 S2 A16]) (reg:HI 152)) 7 {*movhi_insn} (insn_list:REG_DEP_TRUE 10 (insn_list:REG_DEP_TRUE 12 (nil))) (expr_list:REG_DEAD (reg:HI 152) (expr_list:REG_DEAD (reg/v/f:SI 149 [ p ]) (expr_list:REG_EQUAL (const_int 1 [0x1]) (nil))))) (insn:HI 15 13 16 2 (set (reg:SI 153 [ a ]) (mem/c/i:SI (plus:SI (reg/f:SI 27 fp) (const_int -4 [0xfffffffc])) [3 a+0 S4 A32])) 12 {*movsi_insn} (nil) (nil)) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28812