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]

Re: [PATCH] Reload fixes for EXTRA_MEMORY_CONSTRAINT problems


Richard Henderson wrote:

>On Tue, Nov 19, 2002 at 06:36:14PM +0100, Ulrich Weigand wrote:
>>       * reload.c (find_reloads): Always reload EXTRA_ADDRESS_CONSTRAINT
>>       operands in Pmode.
>
>Ok.

Interestingly, today I've seen an ICE when building Linux kernel 2.5.48
with current gcc, which is caused by an attempted reload of a 'p'
constraint in an invalid mode.

My patch to set the operand_mode to Pmode deliberately changed only the
EXTRA_ADDRESS_CONSTRAINT case, not the 'p' case, because 'p' never needs
a reload (it is always fixed up by find_reloads_address).

However, with the ICE I've seen there was an *optional* reload for a 'p'
operand, generated by code in find_reloads starting with:

  /* For each non-matching operand that's a MEM or a pseudo-register
     that didn't get a hard register, make an optional reload.
     This may get done even if the insn needs no reloads otherwise.  */

This case hits if we have an address operand that happens to be just
a single pseudo-register (which didn't get a hard register).  Now,
usually you won't see this because the load-address patterns typically
degenerate to a simple move in this case, and thus you won't see this
reloaded as 'p'.  However, I've recently added s390 patterns that take
an address_operand but don't degenerate to something else if the address
is simply a register: *la_31_and and *la_31_and_cc.

I can work around this in the backend (and this is probably the best
do to for 3.3 in any case), but it does appear to be a reload bug.

Now, I'm not sure how to best fix it: either by just setting the
operand_mode to Pmode in the 'p' case as well, or by prohibiting
optional reloads for address operands.  (However, there is a comment
which I don't understand that says optional reloads are necessary
in that case or else reload inheritance might break ?!)

Any suggestions?


Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand
  Linux for S/390 Design & Development
  IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
  Phone: +49-7031/16-3727   ---   Email: Ulrich.Weigand@de.ibm.com


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