This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Setting ARM PIC register (Was: RE: GCC 4.5.0 Status Report (2009-05-05))


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));
 	    }
 	}
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]