This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] gen_lowpart and lvalues
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Eric Botcazou <ebotcazou at adacore dot com>, <gcc-patches at gcc dot gnu dot org>, Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Date: Thu, 24 Feb 2005 18:10:56 -0700 (MST)
- Subject: Re: [PATCH] gen_lowpart and lvalues
On Thu, 24 Feb 2005, Richard Henderson wrote:
> Right or wrong, I'd guess that > 50% of all uses of gen_lowpart
> expect lvalue semantics. You've simply got to accept that.
Conceded. I'll investigate some way of reverting my patch with out
introducing a 1% slow-down on the compiler, and also still be able
to optimize "var = 0; return x + (short)var".
However...
> On Thu, Feb 24, 2005 at 04:32:36PM -0700, Roger Sayle wrote:
> > 1.1 (law 11-Aug-97): /* Must be a hard reg that's not valid in MODE. */
> > 1.1 (law 11-Aug-97): result = gen_lowpart_common (mode, copy_to_reg (x));
>
> Not an lvalue to begin with.
at this point GET_CODE (x) is a REG, which is obviously an lvalue.
It should even be possible to trigger this in gcc-2.9x using a local
register variable to a hard FP register that isn't MODES_TIEABLE_P to
its intended use.
Roger
--