This is the mail archive of the gcc-patches@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]

Re: builtin_setjmp_receiver expander for SH


Alexandre Oliva <aoliva@redhat.com> wrote:
> On Apr  8, 2001, Richard Henderson <rth@redhat.com> wrote:
> 
>> On Sun, Apr 08, 2001 at 09:35:09AM +0900, kaz Kojima wrote:
>>> +  emit_insn (gen_GOTaddr2picreg ());
>>> +  emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
> 
>> Why do you emit the use?  The PIC register should be fixed
>> (or you have other more serious problems) at which point I
>> don't think we remove references to it.
> 
> Presumably because flow might delete restores after which the register
> is not explicitly used.  I don't think that's necessary, though.  All
> cases that need the PIC register to be properly set are marked as
> such, so, if flow finds a restore is not necessary, it's very likely
> that it really isn't.

Agreed. The reason why I emit the use rtl is just as you say. I was
affected with the comments at the end of load_pic_register in sparc.c
and arm_finalize_pic in arm.c. I attach the revised patch.
Thanks!

	kaz
--
	* sh.md (builtin_setjmp_receiver): New expander.

Index: sh.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/sh.md,v
retrieving revision 1.82
diff -u -r1.82 sh.md
--- sh.md	2001/04/03 15:06:11	1.82
+++ sh.md	2001/04/09 02:07:54
@@ -3752,6 +3752,15 @@
   operands[1] = gen_rtx_SYMBOL_REF (VOIDmode, GOT_SYMBOL_NAME);
 }
 ")
+
+(define_expand "builtin_setjmp_receiver"
+  [(label_ref (match_operand 0 "" ""))]
+  "flag_pic"
+  "
+{
+  emit_insn (gen_GOTaddr2picreg ());
+  DONE;
+}")
 
 (define_expand "call_site"
   [(unspec [(match_dup 0)] UNSPEC_CALLER)]


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