This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/81706] std::sin vectorization bug
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 04 Aug 2017 10:35:30 +0000
- Subject: [Bug libstdc++/81706] std::sin vectorization bug
- Auto-submitted: auto-generated
- References: <bug-81706-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81706
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 41923
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41923&action=edit
gcc8-pr81706.patch
The reason for why cmath does this is that C++ wants to have sin overloads.
And the problem is that we have the simd attributes only on ::sinf, ::sin etc.,
but not on __builtin_sinf, __builtin_sin etc.
So, either we change libstdc++ like with this untested patch, or change the
compiler, so that when seeing a matching decl for a builtin which has simd
attribute on it, we duplicate the attribute to the __builtin_* decl too.
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #2)
> Created attachment 41923 [details]
> gcc8-pr81706.patch
>
> The reason for why cmath does this is that C++ wants to have sin overloads.
> And the problem is that we have the simd attributes only on ::sinf, ::sin
> etc., but not on __builtin_sinf, __builtin_sin etc.
> So, either we change libstdc++ like with this untested patch, or change the
> compiler, so that when seeing a matching decl for a builtin which has simd
> attribute on it, we duplicate the attribute to the __builtin_* decl too.
I'd prefer the attached patch to libstdc++ (which is incomplete of course).