This is the mail archive of the gcc-bugs@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: ICE in `find_reloads', at reload.c:4106


> Though I wonder if the no input reloads restriction could be further
> refined -- the idea behind that restriction is we can't guarantee
> that cc0 will always have the right value after emitting the reload
> insns.

I am currently testing.

2000-06-15  J. David Anglin  <dave@hiauly1.hia.nrc.ca>

	* reload.c (find_reloads): Don't reload a nonoffsettable memory address
	into an offsettable base register when no_input_reloads is true.

--- reload.c.orig	Thu Jun  1 10:50:59 2000
+++ reload.c	Wed Jun 14 20:20:03 2000
@@ -3560,7 +3560,8 @@
 	   so we don't bother with it.  It may not be worth doing.  */
 	else if (goal_alternative_matched[i] == -1
 		 && goal_alternative_offmemok[i]
-		 && GET_CODE (recog_data.operand[i]) == MEM)
+		 && GET_CODE (recog_data.operand[i]) == MEM
+		 && !no_input_reloads)
 	  {
 	    operand_reloadnum[i]
 	      = push_reload (XEXP (recog_data.operand[i], 0), NULL_RTX,

It results in roughly the following code for the line that previously
aborted:

        movzwl $387,-(sp)
	cmpl _maxtype,*_typevec
	clrl r1
	adwc $0,r1
	pushl r1
	calls $2,_my_friendly_assert

My guess is that "clrl r1; adwc $0,r1; pushl r1" is as efficient if not
more so than "clrl -(sp); adwc $0,(sp)".  It is clear that the compiler
wants to generate sCODE instructions with auto inc and dec's.  This is
not allowed by the vax sltu and sgeu instruction constraints, and thus
the reload attempt.  This doesn't happen very often, thus I wonder if
it is worth trying to find a way to handle this case.

There are not many cc0 friendly instructions on the vax, except for a
few that don't muck with the carry bit C.  It might be tricky to try
to further optimise the no_input_reload constraint.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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