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]
Other format: [Raw text]

patch to solve PR39856


The following patch solves the PR39856. The details of the PR can be found on

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39856

The patch was successfully bootstrapped on x86 with default options and with -march=586 -fomit-frame-pointer -msse3.

Ok to commit into the trunk and gcc-4.4 branch?

2009-04-24 Vladimir Makarov <vmakarov@redhat.com>

   PR target/39856
   * reg-stack.c (subst_stack_regs_pat): Remove gcc_assert for note
   for clobber.


Index: reg-stack.c
===================================================================
--- reg-stack.c	(revision 146648)
+++ reg-stack.c	(working copy)
@@ -1371,21 +1371,23 @@ subst_stack_regs_pat (rtx insn, stack re
 
 	    if (pat != PATTERN (insn))
 	      {
-		/* The fix_truncdi_1 pattern wants to be able to allocate
-		   its own scratch register.  It does this by clobbering
-		   an fp reg so that it is assured of an empty reg-stack
-		   register.  If the register is live, kill it now.
-		   Remove the DEAD/UNUSED note so we don't try to kill it
-		   later too.  */
+		/* The fix_truncdi_1 pattern wants to be able to
+		   allocate its own scratch register.  It does this by
+		   clobbering an fp reg so that it is assured of an
+		   empty reg-stack register.  If the register is live,
+		   kill it now.  Remove the DEAD/UNUSED note so we
+		   don't try to kill it later too.
+
+		   In reality the UNUSED note can be absent in some
+		   complicated cases when the register is reused for
+		   partially set variable.  */
 
 		if (note)
 		  emit_pop_insn (insn, regstack, *dest, EMIT_BEFORE);
 		else
-		  {
-		    note = find_reg_note (insn, REG_UNUSED, *dest);
-		    gcc_assert (note);
-		  }
-		remove_note (insn, note);
+		  note = find_reg_note (insn, REG_UNUSED, *dest);
+		if (note)
+		  remove_note (insn, note);
 		replace_reg (dest, FIRST_STACK_REG + 1);
 	      }
 	    else

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