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]

[PATCH] Fix sparc64 sibcall-related sig11


On Fri, Jul 07, 2000 at 02:41:42AM -0700, Richard Henderson wrote:
> On Fri, Jul 07, 2000 at 10:26:05AM +0200, Jakub Jelinek wrote:
> > 	* gcc.dg/20000707-1.c: New test.
> 
> Ok.
> 

The issue is that integrate creates a
(insn_list:REG_LABEL 0 (nil)) with points to nowhere (there is another label
created for it in the destination function).
jump.c then attaches a valid REG_LABEL for it, but leaves the invalid
REG_LABEL in the chain and the compiler chokes later on on it.
Here is what fixes this testcase for me. I don't think REG_LABEL notes
should be copied from inline functions, they will be created later on
anyway and are not used till then.

2000-07-07  Jakub Jelinek  <jakub@redhat.com>

	* integrate.c (copy_insn_list): Remove REG_LABEL notes.

	* gcc.dg/20000707-1.c: New test.

--- gcc/testsuite/gcc.dg/20000707-1.c.jj	Fri Jul  7 10:01:36 2000
+++ gcc/testsuite/gcc.dg/20000707-1.c	Fri Jul  7 10:02:07 2000
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+extern void foo(void *here);
+extern inline void bar(void)
+{
+  __label__ here;
+  foo(&&here);
+here:
+  ;
+}
+
+void baz(void)
+{
+  bar();
+}
--- gcc/integrate.c.jj	Wed Jun  7 08:41:06 2000
+++ gcc/integrate.c	Fri Jul  7 10:57:11 2000
@@ -1581,13 +1581,21 @@ copy_insn_list (insns, map, static_chain
 	&& map->insn_map[INSN_UID (insn)]
 	&& REG_NOTES (insn))
       {
-	rtx tem = copy_rtx_and_substitute (REG_NOTES (insn), map, 0);
+	rtx next, note = copy_rtx_and_substitute (REG_NOTES (insn), map, 0);
 
 	/* We must also do subst_constants, in case one of our parameters
 	   has const type and constant value.  */
-	subst_constants (&tem, NULL_RTX, map, 0);
+	subst_constants (&note, NULL_RTX, map, 0);
 	apply_change_group ();
-	REG_NOTES (map->insn_map[INSN_UID (insn)]) = tem;
+	REG_NOTES (map->insn_map[INSN_UID (insn)]) = note;
+
+	/* Finally, delete any REG_LABEL notes from the chain.  */	          
+	for (; note; note = next)
+	  {
+	    next = XEXP (note, 1);
+	    if (REG_NOTE_KIND (note) == REG_LABEL)
+	      remove_note (map->insn_map[INSN_UID (insn)], note);
+	  }
       }
 
   if (local_return_label)


	Jakub

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