This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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)


On Tue, Apr 4, 2017 at 9:24 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> aggregate_value_p is called often very early during compilation, e.g.
> from allocate_function or during gimplification of a call with lhs.
> The problem with that is e.g. that on x86_64 -m64 -mno-sse we can't
> include <x86intrin.h>, because the always_inline inline functions
> in mmx and 3dnow intrinsic headers return __m64 or take __m64 as arguments
> and that in the 64-bit ABI is in SSE register.
>
> The following patch makes sure we diagnose this only later (e.g. when
> expanding a function to RTL or when expanding calls to other functions),
> which means we don't diagnose e.g. inline functions that got successfully
> inlined (because then there is really no function return in SSE or x87
> reg) or e.g. for builtin calls if they are emitted inline rather than
> as a library call (again, I think that is desirable).
> I had to tweak a few tests because the reported line changed slightly,
> and in the last test add -fno-builtin-fminl, because otherwise fminl
> is expanded inline and again there is no call left with the problem.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

No, I think the issue should be fixed in intrinsics.

Attached patch solves this problem for me, and also fixes a couple of
similar problems (one with -m3dnowa, that is nowadays a regular
compile option). The patched intrinsics were tested with combinations
of -m{,no-}sse{,2}, -m{,no-}mmx, -m{-no}3dnow{,a}, -m64, and there
were no problems with any combination.

Uros.

Attachment: p.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]