This is the mail archive of the gcc-bugs@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]

[Bug target/56866] gcc 4.7.x/gcc-4.8.x with '-O3 -march=bdver2' misscompiles glibc-2.17/crypt/sha512.c


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.


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