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 COMMITTED: Remove retval notes when we lower a subreg


This patch fixes the problem reported here:
    http://gcc.gnu.org/ml/gcc/2007-05/msg00167.html

When gcc creates a REG_NO_CONFLICT block, it will create a REG_RETVAL
note but no REG_EQUAL note.  If lower-subreg is able to decompose the
insn, it may produce a simpler insn.  If you are rather unlucky, a
later pass may add a REG_EQUAL note to the insn with the REG_RETVAL
note.  This will make the whole libcall look like it sets the value in
the REG_EQUAL note, though it actually does more.  This will then lead
to confusion.

Without lower-subreg, this is not a problem, as the REG_NO_CONFLICT
insn will set a subreg, and thus will not get a useful REG_EQUAL note.

With lower-subreg, this is rarely a problem, as REG_NO_CONFLICT blocks
are generally already fully decomposed.  The problem in question
arises for an unusual target (16-bit x86), for which the SImode
operations created in the REG_NO_CONFLICT block are decomposed into
HImode operations.

This patch fixes the problem.  The cost is low for other systems.

Bootstrapped and tested on i686-pc-linux-gnu.

Committed.

Ian


2007-05-22  Ian Lance Taylor  <iant@google.com>

	* lower-subreg.c (decompose_multiword_subregs): If we change an
	insn, call remove_retval_note on it.


Index: lower-subreg.c
===================================================================
--- lower-subreg.c	(revision 124930)
+++ lower-subreg.c	(working copy)
@@ -1128,6 +1128,8 @@ decompose_multiword_subregs (bool update
 			{
 			  changed = true;
 
+			  remove_retval_note (insn);
+
 			  recog_memoized (insn);
 			  extract_insn (insn);
 
@@ -1157,6 +1159,8 @@ decompose_multiword_subregs (bool update
 		      i = apply_change_group ();
 		      gcc_assert (i);
 
+		      remove_retval_note (insn);
+
 		      changed = true;
 		    }
 		}


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