aboutsummaryrefslogtreecommitdiff
path: root/4.7.3
diff options
context:
space:
mode:
authorRyan Hill <rhill@gentoo.org>2013-04-29 02:37:07 +0000
committerRyan Hill <rhill@gentoo.org>2013-04-29 02:37:07 +0000
commit1b55316e4b64b08d88da7087b0c2de5783eabe03 (patch)
tree0d030a55e8e0274e23748434ec041361c5930783 /4.7.3
parentDrop upstreamed hunk. (diff)
downloadgcc-patches-1b55316e4b64b08d88da7087b0c2de5783eabe03.tar.gz
gcc-patches-1b55316e4b64b08d88da7087b0c2de5783eabe03.tar.bz2
gcc-patches-1b55316e4b64b08d88da7087b0c2de5783eabe03.zip
Fix a couple wrong code bugs with -march=bdver2.
Diffstat (limited to '4.7.3')
-rw-r--r--4.7.3/gentoo/95_all_4.7.4_mxop-wrong-code.patch102
-rw-r--r--4.7.3/gentoo/README.history1
2 files changed, 103 insertions, 0 deletions
diff --git a/4.7.3/gentoo/95_all_4.7.4_mxop-wrong-code.patch b/4.7.3/gentoo/95_all_4.7.4_mxop-wrong-code.patch
new file mode 100644
index 0000000..270d6c4
--- /dev/null
+++ b/4.7.3/gentoo/95_all_4.7.4_mxop-wrong-code.patch
@@ -0,0 +1,102 @@
+[4.7/4.8/4.9 Regression] with '-O3 -march=bdver2' misscompiles glibc-2.17/crypt/sha512.c
+
+http://gcc.gnu.org/PR56866
+
+commit ce7a0ccefac3b135cf62c9317771f40c6bda5308
+Author: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sat Apr 27 12:28:45 2013 +0000
+
+ PR target/56866
+ * config/i386/sse.md (xop_rotr<mode>3): Fix up computation of
+ the immediate rotate count.
+
+ * gcc.c-torture/execute/pr56866.c: New test.
+ * gcc.target/i386/pr56866.c: New test.
+
+
+ git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@198357 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ gcc/config/i386/sse.md | 3 +-
+ gcc/testsuite/gcc.c-torture/execute/pr56866.c | 45 +++++++++++++++++++++++++++
+ gcc/testsuite/gcc.target/i386/pr56866.c | 16 ++++++++++
+ 5 files changed, 75 insertions(+), 1 deletion(-)
+
+--- a/gcc/config/i386/sse.md
++++ b/gcc/config/i386/sse.md
+@@ -11167,7 +11167,8 @@
+ (match_operand:SI 2 "const_0_to_<sserotatemax>_operand" "n")))]
+ "TARGET_XOP"
+ {
+- operands[3] = GEN_INT ((<ssescalarnum> * 8) - INTVAL (operands[2]));
++ operands[3]
++ = GEN_INT (GET_MODE_BITSIZE (<ssescalarmode>mode) - INTVAL (operands[2]));
+ return \"vprot<ssemodesuffix>\t{%3, %1, %0|%0, %1, %3}\";
+ }
+ [(set_attr "type" "sseishft")
+--- /dev/null
++++ b/gcc/testsuite/gcc.c-torture/execute/pr56866.c
+@@ -0,0 +1,45 @@
++/* PR target/56866 */
++
++int
++main ()
++{
++#if __CHAR_BIT__ == 8 && __SIZEOF_LONG_LONG__ == 8 && __SIZEOF_INT__ == 4 && __SIZEOF_SHORT__ == 2
++ unsigned long long wq[256], rq[256];
++ unsigned int wi[256], ri[256];
++ unsigned short ws[256], rs[256];
++ unsigned char wc[256], rc[256];
++ int t;
++
++ __builtin_memset (wq, 0, sizeof wq);
++ __builtin_memset (wi, 0, sizeof wi);
++ __builtin_memset (ws, 0, sizeof ws);
++ __builtin_memset (wc, 0, sizeof wc);
++ wq[0] = 0x0123456789abcdefULL;
++ wi[0] = 0x01234567;
++ ws[0] = 0x4567;
++ wc[0] = 0x73;
++
++ asm volatile ("" : : "g" (wq), "g" (wi), "g" (ws), "g" (wc) : "memory");
++
++ for (t = 0; t < 256; ++t)
++ rq[t] = (wq[t] >> 8) | (wq[t] << (sizeof (wq[0]) * __CHAR_BIT__ - 8));
++ for (t = 0; t < 256; ++t)
++ ri[t] = (wi[t] >> 8) | (wi[t] << (sizeof (wi[0]) * __CHAR_BIT__ - 8));
++ for (t = 0; t < 256; ++t)
++ rs[t] = (ws[t] >> 9) | (ws[t] << (sizeof (ws[0]) * __CHAR_BIT__ - 9));
++ for (t = 0; t < 256; ++t)
++ rc[t] = (wc[t] >> 5) | (wc[t] << (sizeof (wc[0]) * __CHAR_BIT__ - 5));
++
++ asm volatile ("" : : "g" (rq), "g" (ri), "g" (rs), "g" (rc) : "memory");
++
++ if (rq[0] != 0xef0123456789abcdULL || rq[1])
++ __builtin_abort ();
++ if (ri[0] != 0x67012345 || ri[1])
++ __builtin_abort ();
++ if (rs[0] != 0xb3a2 || rs[1])
++ __builtin_abort ();
++ if (rc[0] != 0x9b || rc[1])
++ __builtin_abort ();
++#endif
++ return 0;
++}
+--- /dev/null
++++ b/gcc/testsuite/gcc.target/i386/pr56866.c
+@@ -0,0 +1,16 @@
++/* PR target/56866 */
++/* { dg-do run } */
++/* { dg-require-effective-target xop } */
++/* { dg-options "-O3 -mxop" } */
++
++#define main xop_test_main
++#include "../../gcc.c-torture/execute/pr56866.c"
++#undef main
++
++#include "xop-check.h"
++
++static void
++xop_test (void)
++{
++ xop_test_main ();
++}
diff --git a/4.7.3/gentoo/README.history b/4.7.3/gentoo/README.history
index 803584e..83919d9 100644
--- a/4.7.3/gentoo/README.history
+++ b/4.7.3/gentoo/README.history
@@ -24,3 +24,4 @@
+ 74_all_gcc47_cloog-dl.patch
+ 90_all_gcc-4.7-x32.patch
+ 92_all_freebsd-pie.patch
+ + 95_all_4.7.4_mxop-wrong-code.patch