This is the mail archive of the
mailing list for the GCC project.
Re: Setting ARM PIC register (Was: RE: GCC 4.5.0 Status Report (2009-05-05))
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.
--- config/arm/arm.c (revision 147187)
+++ config/arm/arm.c (working copy)
@@ -3596,7 +3596,7 @@ require_pic_register (void)
seq = get_insns ();
- emit_insn_after (seq, entry_of_function ());
+ insert_insn_on_edge (seq, single_succ_edge (ENTRY_BLOCK_PTR));