diff mbox

[COMMITTED] Fix 70240

Message ID 56E9F437.7010607@redhat.com
State New
Headers show

Commit Message

Richard Henderson March 17, 2016, 12:03 a.m. UTC
As discussed in the PR, the fix for 68215 was a bit too aggressive and caused 
this one.  There's a simple alternate fix, first suggested by Richi in 68714, 
that cures both.

Thus I apply one patch and revert another, in order, so that nothing breaks in 
between yet keeps the two commits separate.

Tested on i686 and x86_64 linux.
Committed as approved in the PR,


r~
diff mbox

Patch

	PR middle-end/70240
	* gcc.c-torture/compile/pr70240.c: New.

diff --git a/gcc/testsuite/gcc.c-torture/compile/pr70240.c b/gcc/testsuite/gcc.c-torture/compile/pr70240.c
new file mode 100644
index 0000000..830d4dd
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr70240.c
@@ -0,0 +1,26 @@ 
+typedef short v16hi __attribute__ ((vector_size (32)));
+typedef int v8si __attribute__ ((vector_size (32)));
+typedef long long v4di __attribute__ ((vector_size (32)));
+
+int
+foo(int u16_0, int u32_0, int u64_0, int u16_1, int u32_1, int u64_1, v16hi v32u16_0, v8si v32u32_0, v4di v32u64_0, v16hi v32u16_1, v8si v32u32_1, v4di v32u64_1)
+{
+  do {
+    v32u16_1 += (v16hi){ v32u32_1[7], ~v32u32_1[3], 0, v32u64_0[0]};
+    u32_0 = (u32_0 << 31) | (u32_0 >> ~v32u32_0[1]);
+    u64_0 += 1;
+    v32u64_0[2] <<= v32u64_0[2] & 63;
+    u16_1 = (u16_1 >> (v32u16_0[11] & 15)) | (u16_1 << (-v32u16_0[11] & 15));
+    v32u16_0 -= ~v32u16_1;
+    v32u32_1[5] += u32_1;
+    if (v32u32_1[3] >= 0) {
+      u64_1 -= ~v32u64_1[1];
+      v32u16_1 += (v16hi){ -u64_1, ~u32_0, ~u16_1, v32u32_1[1], 0, ~v32u16_1[2], ~v32u64_1[2], ~v32u32_0[7]};
+    }
+    v32u64_1 += (v4di){0, 0, ~v32u32_0[5]};
+    v32u32_1 *= (v8si){0, ~v32u32_1[6]};
+    v32u64_0[3] &= 0x1234;
+    v32u64_0 += (v4di){v32u32_1[6]};
+  } while (u16_0 < 0x1234);
+  return u64_0 + u16_1;
+}
-- 
2.1.0