Possible CSE quirk involving SUBREG on the i386

John Wehle john@feith.com
Thu Jul 2 00:53:00 GMT 1998


>   > Why is there a requirement that MODES_TIEABLE_P be symmetrical?
> I believe it is related to HARD_REGNO_MODE_OK.  See MODES_TIEABLE_P
> in the manual.

I did. :-)

> Basically local-alloc will try to tie two registers together if
> MODES_TIEABLE_P is nonzero for two pseudos.

I noticed that. :-)

> If we tie the pseudos together, they will be allocated into the
> same hard reg -- and if HARD_REGNO_MODE_OK was nonzero for one
> of them, then we lose.

Right, which is why I'm proposing that combine_regs in local-alloc.c
be changed from using:

  || !MODES_TIEABLE_P (GET_MODE (usedreg), GET_MODE (setreg))

to:

  || !MODES_TIEABLE_P (GET_MODE (usedreg), GET_MODE (setreg))
  || !MODES_TIEABLE_P (GET_MODE (setreg), GET_MODE (usedreg))

and then update the manual to allow MODES_TIEABLE_P to be asymmetric.
This allows combine to handle zero extending a QImode register in an
optimal fashion on the i386.  Any reason I shouldn't go ahead and submit
a patch for this?

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------




More information about the Gcc mailing list