This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.
gcc.c-torture/execute/990222-1.c fails on m68k-linux because global alloc
invalidates REG_INC notes, which confuses flow2.
This is how the loop looks like before global alloc:
----------------------------------------------------------------------
;; Start of basic block 1, registers live: 14 [%a6] 15 [%sp] 29
(code_label 23 10 81 5 "")
(note 81 23 24 [bb 1] NOTE_INSN_BASIC_BLOCK)
(insn 24 81 25 (set (mem:QI (reg/v:SI 29) 0)
(const_int 48)) 51 {movqi+1} (nil)
(nil))
(note 25 24 79 "" NOTE_INSN_LOOP_CONT)
(note 79 25 12 "" NOTE_INSN_LOOP_VTOP)
(note 12 79 15 "" NOTE_INSN_DELETED)
(insn 15 12 17 (set (reg/s:QI 31)
(plus:QI (mem:QI (pre_dec:SI (reg/v:SI 29)) 0)
(const_int 1))) 132 {addqi3} (nil)
(expr_list:REG_INC (reg/v:SI 29)
(nil)))
(insn 17 15 19 (set (mem:QI (reg/v:SI 29) 0)
(reg/s:QI 31)) 51 {movqi+1} (insn_list 15 (nil))
(nil))
(insn 19 17 20 (set (cc0)
(compare (reg/s:QI 31)
(const_int 57))) 24 {cmpqi+1} (nil)
(expr_list:REG_DEAD (reg/s:QI 31)
(nil)))
(jump_insn 20 19 31 (set (pc)
(if_then_else (gt (cc0)
(const_int 0))
(label_ref 23)
(pc))) 385 {bgt} (nil)
(nil))
;; End of basic block 1
(note 31 20 32 "" NOTE_INSN_LOOP_END)
----------------------------------------------------------------------
After reload the memory reference in insn 15 is split out into insn 92,
but the REG_INC note hasn't been moved:
(insn 92 12 15 (set (reg/s:QI 0 %d0)
(mem:QI (pre_dec:SI (reg/v:SI 8 %a0)) 0)) 51 {movqi+1} (nil)
(nil))
(insn 15 92 17 (set (reg/s:QI 0 %d0)
(plus:QI (reg/s:QI 0 %d0)
(const_int 1))) 132 {addqi3} (nil)
(expr_list:REG_INC (reg/v:SI 8 %a0)
(nil)))
I think the easiest way to fix that would be to recompute all REG_INC
notes after reload.
--
Andreas Schwab "And now for something
schwab@issan.cs.uni-dortmund.de completely different"
schwab@gnu.org