This is the mail archive of the gcc@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: Possible CSE quirk involving SUBREG on the i386


> Ho hum.  The explanation is simple here -- MODES_TIEABLE_P.
> 
> I believe that we can do slightly better for this; while only
> the first four int regs can hold QImode values, all of them 
> can hold HImode values.
> 
> This happens to cure this exact problem, but the same problem
> will occur with unsigned char, and I don't see that we can do
> anything about it.

Why is there a requirement that MODES_TIEABLE_P be symmetrical?
On the i386 a QI mode register is accessible in SI mode so I
would think that adding:

  ((MODE1) == QImode && (MODE2) == SImode)

to MODES_TIEABLE_P would be useful.  BTW, this change solves
the unsigned char problem and survives a bootstrap.  I realize
that we need to avoid trying to use %esi and %edi in a situation
which requires QImode access ... though this seems like a register
allocation issue which could be handled separate from CSE and
COMBINE.  What are the thoughts on refining the definition of
MODES_TIEABLE_P so that it can be asymmetric and change:

  MODES_TIEABLE_P (X, Y)

to:

  MODES_TIEABLE_P (X, Y) && MODES_TIEABLE_P (Y, X)

where necessary to prevent the wrong kind of register from
being allocated?

I known ... things aren't that simple :-) though I welcome
being enlightened as to the complexities.

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



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