Patch: rs6000 -mno-sched-prolog option
Dale Johannesen
dalej@apple.com
Fri Apr 12 11:25:00 GMT 2002
The indicated option causes an ICE on, for example, hello world.
This is because final() expects insns to have INSN_ADDRESSES
attached, and this is not done for the unscheduled prolog/epilog
insns. This adds the INSN_ADDRESSES and makes the option work
again. Bootstrapping on Darwin.
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.305
diff -u -d -b -w -c -3 -p -r1.305 rs6000.c
cvs server: conflicting specifications of output style
*** rs6000.c 12 Apr 2002 16:57:47 -0000 1.305
--- rs6000.c 12 Apr 2002 18:13:24 -0000
*************** rs6000_output_function_prologue (file, s
*** 9025,9030 ****
--- 9034,9050 ----
rs6000_emit_prologue ();
emit_note (0, NOTE_INSN_DELETED);
+ /* Expand INSN_ADDRESSES so final() doesn't crash. */
+ {
+ rtx insn;
+ unsigned addr = 0;
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ {
+ INSN_ADDRESSES_NEW (insn, addr);
+ addr += 4;
+ }
+ }
+
if (TARGET_DEBUG_STACK)
debug_rtx_list (get_insns (), 100);
final (get_insns (), file, FALSE, FALSE);
*************** rs6000_output_function_epilogue (file, s
*** 9411,9416 ****
--- 9431,9447 ----
emit_note (0, NOTE_INSN_DELETED);
rs6000_emit_epilogue (FALSE);
emit_note (0, NOTE_INSN_DELETED);
+
+ /* Expand INSN_ADDRESSES so final() doesn't crash. */
+ {
+ rtx insn;
+ unsigned addr = 0;
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ {
+ INSN_ADDRESSES_NEW (insn, addr);
+ addr += 4;
+ }
+ }
if (TARGET_DEBUG_STACK)
debug_rtx_list (get_insns (), 100);
More information about the Gcc-patches
mailing list