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]

Fix Solaris bootstrap failure


This patch:
2004-07-19  Roger Sayle  <roger@eyesopen.com>

        * rtlanal.c (reg_set_p): Add check for regs_invalidated_by_call.

caused a bootstrap failure on Sparc.  The problem is caused by the fact that
the argument registers are no longer marked as set by calls.  In
gengtype.c:do_scalar_typedef (the first function to ICE), we have a very
simple function with a tail call.  The first instruction in the function
copies %i0 to a pseudo; the last instruction is a call which reads %i0.
%i0 is marked as dying in the call.  regmove.c:optimize_reg_copy_1 moves the
REG_DEAD note from the call to the set.  Which is bogus, and we abort during
scheduling when we discover death notes have disappeared when we rescanned.

Reverting the patch fixes the ICE, but isn't a desirable solution.  I think
the correct thing to do is to not try to replace when src is a hard register
and some call uses it; validate_replace_rtx doesn't get a chance to complain
about this, because it is only passed the PATTERN, but it's another kind of
failed replacement.

I am testing the attached patch.  OK if it passes?

[By the way, there's another workaround in regmove.c for the old behavior of
reg_set_p; it can probably be removed now.  There may be some more around
GCC.]

-- 
Daniel Jacobowitz

2004-07-22  Daniel Jacobowitz  <dan@debian.org>

	* regmove.c (optimize_reg_copy_1): Don't try to replace call-used
	hard registers.

Index: regmove.c
===================================================================
RCS file: /big/fsf/rsync/gcc-cvs/gcc/gcc/regmove.c,v
retrieving revision 1.160
diff -u -p -r1.160 regmove.c
--- regmove.c	9 Jul 2004 03:29:34 -0000	1.160
+++ regmove.c	22 Jul 2004 19:49:33 -0000
@@ -431,6 +431,9 @@ optimize_reg_copy_1 (rtx insn, rtx dest,
 	  || (sregno < FIRST_PSEUDO_REGISTER
 	      && asm_noperands (PATTERN (p)) >= 0
 	      && reg_overlap_mentioned_p (src, PATTERN (p)))
+	  /* Don't change hard registers used by a call.  */
+	  || (CALL_P (p) && sregno < FIRST_PSEUDO_REGISTER
+	      && find_reg_fusage (p, USE, src))
 	  /* Don't change a USE of a register.  */
 	  || (GET_CODE (PATTERN (p)) == USE
 	      && reg_overlap_mentioned_p (src, XEXP (PATTERN (p), 0))))


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