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

Re: reload getting the mode of (subreg:HI (reg:QI pseudo)) wrong


Rask Ingemann Lambertsen <rask@sygehus.dk> writes:

> In my i8086 backend experiments, I seem to have come across a corner case
> which confuses reload.

Interesting case.

> It seems necessary to recover the mode of the operand when computing
> rld[i].mode.  There is operand_mode[rld[i].opnum] and in case of a "0"
> constraint, I'm sure it is possible to find the matching operand too
> somehow. Then that information can be used to ensure rld[i].mode is large
> enough. Is there any reason that operand_mode[] would not be reliable?

In general, operand_mode[] will be unreliable in cases where it is not
specified.  This is frowned upon but more or less permitted, and a few
backends take advantage of it for relatively nefarious purposes.

Still, I can't think of a better approach for this problem.  It's
worth a try to set rld[i].mode to operand_mode[] when operand_mode[]
is larger.  I don't see that you will have to worry about matching
constraints.  A big-endian system might be an issue; hopefully
reload_adjust_reg_for_mode is called whereever necessary.

Ian


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