This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC/RFT] Generate (truncate ...) in gen_lowpart_common
Adam Nemet <anemet@caviumnetworks.com> writes:
> I was assuming that all the code in GCC calling gen_lowpart
> knew that it was safe to do implicit truncation and started adding
> TRULY_NOOP_TRUNCATION checks to places where I found it was not.
Right, that was my understanding too. And I thought that gen_lowpart
was supposed to return an lvalue if it was given an value. That usage
is probably too far in-grained to be changed easily.
>> Can anybody test this patch on a MIPS to understand if it works and
>> has performance problems? Does what I wrote above sound like crap?
One thing to bear in mind is that the MIPS backend itself uses
gen_lowpart to get subregs, and relies on the lvalue assumption too.
See e.g. the *addsi3_extended_mips16 pattern and the various
(sign_extend (truncate ...)) patterns.
Richard