This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/56866] gcc 4.7.x/gcc-4.8.x with '-O3 -march=bdver2' misscompiles glibc-2.17/crypt/sha512.c
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 26 Apr 2013 09:00:42 +0000
- Subject: [Bug target/56866] gcc 4.7.x/gcc-4.8.x with '-O3 -march=bdver2' misscompiles glibc-2.17/crypt/sha512.c
- Auto-submitted: auto-generated
- References: <bug-56866-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56866
--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-26 09:00:42 UTC ---
Created attachment 29944
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29944
gcc49-pr56866.patch
The fix for gcc.c-torture/execute/pr51581* and pr53645.c etc. is quite obvious,
we obviously can't use xop_pmacsdqh with unsigned highpart odd multiplication,
say for the pr51581-1.c unsigned division by 3U, which is high part
multiplication by 0xaaaaaaabU, with the result shifted right by 1 at the end.
If we compute say 3ULL * 0xaaaaaaabULL, we can't use xop_pmacsdqh which
computes
3LL * 0xffffffffaaaaaaabLL instead.
That said, there are no vpmacsdqh insns in the sha512 code for -O3
-march=bdver2, so it must be something else.