From: Oleg Endo Date: Sat, 7 Mar 2015 19:35:22 +0000 (+0000) Subject: re PR target/65153 ([SH][4.9 Regression] "insn does not satisfy its constraints"... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e291927919ac6a7bd0d6fa8848b2acf5f27c959f;p=gcc.git re PR target/65153 ([SH][4.9 Regression] "insn does not satisfy its constraints" when compiling libmcrypt) gcc/testsuite/ PR target/65153 * gcc.c-torture/compile/pr65153.c: New. From-SVN: r221257 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index baa485aa681..e303a395044 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-07 Oleg Endo + + PR target/65153 + * gcc.c-torture/compile/pr65153.c: New. + 2015-03-07 Oleg Endo 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 index 00000000000..3cc0df6947d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr65153.c @@ -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]; + } +}