Setting ARM PIC register (Was: RE: GCC 4.5.0 Status Report (2009-05-05))
Michael Matz
matz@suse.de
Wed May 6 17:08:00 GMT 2009
Hi,
On Wed, 6 May 2009, Michael Matz wrote:
> > There's already emit_insn_at_entry in cfgrtl.c. Would that work?
>
> Unfortunately not. That one also wants to immediately commit the just
> inserted instructions, which doesn't work during the transition phase
> from GIMPLE to RTL. But just queuing them should be fine.
I.e. like so. It fixes the testcase and to my untrained eye the output
looks correct (at least there seems to be loads from something .PIC
related :) ). But better testing would be appreciated.
Ciao,
Michael.
--
Index: config/arm/arm.c
===================================================================
--- config/arm/arm.c (revision 147187)
+++ config/arm/arm.c (working copy)
@@ -3596,7 +3596,7 @@ require_pic_register (void)
seq = get_insns ();
end_sequence ();
- emit_insn_after (seq, entry_of_function ());
+ insert_insn_on_edge (seq, single_succ_edge (ENTRY_BLOCK_PTR));
}
}
}
More information about the Gcc
mailing list