This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Don't error about x86 return value in SSE reg (or x86 reg) or argument in SSE reg too early (PR target/80298)
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 5 Apr 2017 10:26:47 +0200
- Subject: Re: [PATCH] Don't error about x86 return value in SSE reg (or x86 reg) or argument in SSE reg too early (PR target/80298)
- Authentication-results: sourceware.org; auth=none
- References: <20170404192447.GL17461@tucnak> <CAFULd4YxXU=wwE0Yygime6RMMWiR3RwrH=vRXeoGsF8CNoOwsQ@mail.gmail.com> <20170405080007.GN17461@tucnak> <CAFULd4ZmYZcnyBw2DBruo9J8s3J2e_Xq9pw7871rX54yb7771w@mail.gmail.com> <20170405082014.GO17461@tucnak>
On Wed, Apr 5, 2017 at 10:20 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Apr 05, 2017 at 10:12:02AM +0200, Uros Bizjak wrote:
>> Oh, I forgot to point out that on x86_64 ABI specifies MMX values in
>> SSE registers.
>
> I know it does. And if people have their own function that returns
> __m64 or takes such arguments, they surely have to.
> The question is only about the case when no function (in the assembly)
> returns in SSE registers nor gets arguments in them, when all the
> MMX code is inside of a function.
> With your patch, it is - the MMX intrinsics are functions and we error on
> them even when they are inlined.
> With my patch we count only the non-inlined functions, something we emit
> assembly for or call them from other TUs.
>
> If you think requiring SSE for MMX always in 64-bit code is fine, even
> when not strictly needed (as in, you really don't need SSE ISA to execute
> such code, although there are no CPUs without that HW), so be it, then
> let's go with your patch.
Yes, I think that we should consistently warn even in case intrinsic
is inlined. I'm afraid that otherwise we will have endless stream of
bugreports that something warns with -O0, but not -O1+, when LTO is
used, etc, etc... The rule is: When user uses (or intends to use) MMX
value (that goes in SSE reg on x86_64), -msse is needed on x86_64,
otherwise warning is emitted.
Uros.