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

[Bug middle-end/35768] gcc.c-torture/compile/20010226-1.c:22: ICE: in do_output_reload, at reload1.c:7331



------- Comment #4 from rsandifo at nildram dot co dot uk  2008-03-31 16:11 -------
Subject: Re:  gcc.c-torture/compile/20010226-1.c:22: ICE: in do_output_reload,
at reload1.c:7331

"danglin at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
> Richard, does match_scratch now require a mode?  The pattern causing
> the problem was written without a mode so that it could handle both
> SImode and DImode.

Hmm.  Well, the use of a modeless "match_scratch" in a matching context
is OK.  It's the use of a modeless "(scratch)" rtx (and thus a modeless
"match_scratch" in an expander or named insn) that's the problem.

It does seem odd for an output "(scratch)" to have no mode.  From a
quick check, it seems PA is the only port to use voidless "(scratch)"
rtxes for output operands that really do need reloads.  Other ports
either add the mode to the "match_scratch" or get the associated
expander to call "gen_rtx_SCRATCH (mode)".  See s390.md for an
example of the latter.

I suppose the assumption in pa.md is that the scratch output reload
should be in the same mode as the input operand.  However, the point
of my patch was that they needn't be: matched input-output operands
can have different modes, and in every other case except the PA one,
the mode of the output value determines the mode of the output reload
register.

If we want to continue to allow this, the fix is to change:

  if (rl->out && reg_rtx)

into:

  if (rl->out
      && reg_rtx
      && !(GET_CODE (rl->out) == SCRATCH && GET_MODE (rl->out) == VOIDmode))

in reload1.c.

What do you think?  Should pa.md be changed (probably along the same
lines as s390.md) or do you want to go with the reload change?

Richard


-- 


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


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