This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: reload getting the mode of (subreg:HI (reg:QI pseudo)) wrong
- From: Ian Lance Taylor <iant at google dot com>
- To: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- Cc: gcc at gcc dot gnu dot org
- Date: 03 Aug 2006 23:55:49 -0700
- Subject: Re: reload getting the mode of (subreg:HI (reg:QI pseudo)) wrong
- References: <20060804003033.GA6661@sygehus.dk>
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