This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: ICE in `find_reloads', at reload.c:4106
- To: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Subject: Re: ICE in `find_reloads', at reload.c:4106
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 26 Jul 2000 20:15:26 -0600
- cc: gcc-bugs at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <200006151747.NAA27641@hiauly1.hia.nrc.ca>you write:
> > 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.
IMHO, the vax machine description is in error. This insn uses cc0 and
therefore must never need reloading.
You may be able to fix the problem by writing a tighter predicate, another
would be to actually include the set of cc0 within that pattern, then
split it up into multiple patterns after reload. ie
(define_insn "sltu"
[(set (match_operand:SI 0 "general_operand" "=ro")
(ltu (compare (op1, op2)) (const_int 0)))]
""
"#"
Then have a splitter which emits a cmpsi insn followed by an insn that looks
like the current sltu.
jeff