re PR target/65153 ([SH][4.9 Regression] "insn does not satisfy its constraints"...
authorOleg Endo <olegendo@gcc.gnu.org>
Sat, 7 Mar 2015 19:35:22 +0000 (19:35 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Sat, 7 Mar 2015 19:35:22 +0000 (19:35 +0000)
gcc/testsuite/
PR target/65153
* gcc.c-torture/compile/pr65153.c: New.

From-SVN: r221257

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr65153.c [new file with mode: 0644]

index baa485aa681bd7af34a6492025b2bc50e52e7a94..e303a39504414111ee8ca4d8884ae8cb9e1af400 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-07  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       PR target/65153
+       * gcc.c-torture/compile/pr65153.c: New.
+
 2015-03-07  Oleg Endo  <olegendo@gcc.gnu.org>
 
        PR target/65249
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr65153.c b/gcc/testsuite/gcc.c-torture/compile/pr65153.c
new file mode 100644 (file)
index 0000000..3cc0df6
--- /dev/null
@@ -0,0 +1,40 @@
+/* { dg-additional-options "-fPIC" { target fpic } }  */
+
+typedef unsigned long word32;
+typedef unsigned char byte;
+typedef struct cast256_instance { word32 l_key[96];} cast256_key;
+word32 cast256_sbox[4][256] = {};
+void
+key (cast256_key *key, const word32 *in_key, const int key_len)
+{
+  word32 i, j, t, u, cm, cr, lk[8], tm[8], tr[8];
+  for (i = 0; i < 96; i += 8)
+    {
+      for (j = 0; j < 8; ++j)
+       {
+         tm[j] = cm;
+         cm += 0x6ed9eba1;
+         tr[j] = cr;
+         cr += 17;
+       }
+      t = (((tm[0] + lk[7]) << ((word32)(tr[0] & 31)))
+          | ((tm[0] + lk[7]) >> (32 - (word32)(tr[0] & 31))));
+      u = cast256_sbox[0][((byte)((t) >> (8 * 3)))];
+      u ^= cast256_sbox[1][((byte)((t) >> (8 * 2)))];
+      lk[7] ^= u;
+      for (j = 0; j < 8; ++j)
+       {
+         cm += 0x6ed9eba1;
+         tr[j] = cr;
+         cr += 17;
+       }
+      t = (((tm[0] + lk[7]) << ((word32)(tr[0] & 31)))
+          | ((tm[0] + lk[7]) >> (32 - (word32)(tr[0] & 31))));
+      u = cast256_sbox[0][((byte)((t) >> (8 * 3)))];
+      u ^= cast256_sbox[1][((byte)((t) >> (8 * 2)))];
+      u -= cast256_sbox[2][((byte)((t) >> (8 * 1)))];
+      lk[2] ^= u;
+      lk[7] ^= u;
+      key->l_key[i + 1] = lk[2];
+    }
+}