This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR target/35767: x86 backend uses aligned load on unaligned memory
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, Uros Bizjak <ubizjak at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 5 Jun 2010 23:54:55 +0200
- Subject: Re: PATCH: PR target/35767: x86 backend uses aligned load on unaligned memory
- References: <20080527141116.GA15631@lucon.org> <5787cf470805270741p244ccb86u27b40230499cd139@mail.gmail.com> <20080527145145.GA17888@lucon.org> <483C54B8.5040603@gmail.com> <6dc9ffc80805271202k6b0e2b36yf8d0abc02ac33208@mail.gmail.com> <483C6789.4090005@gnu.org>
On Tue, May 27, 2008 at 9:56 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
>> Here is the updated patch with a new testcase to check aligned load.
>> Is there still a problem with canonical type?
>
> No no, the problem was anyway not with the patch -- I only wondered about
> the testcases.
Using TYPE_CANONICAL here is indeed bogus. I'm now running into
issues with this patch and LTO. If you want to disregard user alignment
specifiers use TYPE_MAIN_VARIANT instead.
The question is of course what the ABI says - and I suspect that the right
fix for the original problem is at the caller side, not the callee one
(the caller shouldn't look at the alignment of the type of the passed
value but at the alignment requirement of the argument type as specified
in the function signature).
I can make the testcases work for me with using TYPE_MAIN_VARIANT
(but is this really implementing the ABI correctly?)
Richard.