public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/16719] New: [ColdFire] Illegal move of byte itno address register causes compiler to ICE
@ 2004-07-26 17:25 peter at the-baradas dot com
  2004-07-26 17:26 ` [Bug target/16719] " peter at the-baradas dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: peter at the-baradas dot com @ 2004-07-26 17:25 UTC (permalink / raw)
  To: gcc-bugs

I've stumbled across yet another problem with trying to move a byte into an
address registe ron ColdFire.  This problem was pointed out to me by Brett
Swimley, and was reproducedd using today's version of uberbaum.

[peter@baradas peter]$ /tmp/uberbaum/bin/m68k-elf-gcc -I./ -Wall -Wsign-compare
-W -Wno-unused -Wshadow -m5206e -O3 -fomit-frame-pointer -funroll-loops   -S -o
/tmp/safer.s ~/tmp/safer.c
/home/peter/tmp/safer.c: In function `safer_ecb_encrypt':
/home/peter/tmp/safer.c:2494: error: insn does not satisfy its constraints:
(insn 319 318 320 10 (set (reg:QI 14 %a6)
        (mem/s:QI (plus:SI (reg:SI 14 %a6)
                (reg:SI 0 %d0 [104])) [0 safer_ebox S1 A8])) 34 {*m68k.md:752} (nil)
    (nil))
/home/peter/tmp/safer.c:2494: internal compiler error: in
reload_cse_simplify_operands, at postreload.c:378
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


Source code the reproduces the bug:



typedef unsigned char safer_key_t[(1 + 8 * (1 + 2 * 13))];
struct safer_key { safer_key_t key; };


typedef union Symmetric_key {

   struct safer_key safer;

} symmetric_key;

extern void crypt_argchk(char *v, char *s, int d);
extern const unsigned char safer_ebox[], safer_lbox[];

void safer_ecb_encrypt(const unsigned char *block_in,
                             unsigned char *block_out,
                             symmetric_key *skey)

{

    unsigned char a, b, c, d, e, f, g, h, t;
    unsigned int round;
    unsigned char *key;

    if (!(block_in != ((void *)0))) { crypt_argchk("block_in != NULL",
"safer.c", 248); };
    if (!(block_out != ((void *)0))) { crypt_argchk("block_out != NULL",
"safer.c", 249); };
    if (!(skey != ((void *)0))) { crypt_argchk("skey != NULL", "safer.c", 250); };

    key = skey->safer.key;
    a = block_in[0]; b = block_in[1]; c = block_in[2]; d = block_in[3];
    e = block_in[4]; f = block_in[5]; g = block_in[6]; h = block_in[7];
    if (13 < (round = *key)) round = 13;
    while(round-- > 0)
    {
        a ^= *++key; b += *++key; c += *++key; d ^= *++key;
        e ^= *++key; f += *++key; g += *++key; h ^= *++key;
        a = safer_ebox[(a) & 0xFF] + *++key; b = safer_lbox[(b) & 0xFF] ^ *++key;
        c = safer_lbox[(c) & 0xFF] ^ *++key; d = safer_ebox[(d) & 0xFF] + *++key;
        e = safer_ebox[(e) & 0xFF] + *++key; f = safer_lbox[(f) & 0xFF] ^ *++key;
        g = safer_lbox[(g) & 0xFF] ^ *++key; h = safer_ebox[(h) & 0xFF] + *++key;
        { b += a; a += b; }; { d += c; c += d; }; { f += e; e += f; }; { h += g;
g += h; };
        { c += a; a += c; }; { g += e; e += g; }; { d += b; b += d; }; { h += f;
f += h; };
        { e += a; a += e; }; { f += b; b += f; }; { g += c; c += g; }; { h += d;
d += h; };
        t = b; b = e; e = c; c = t; t = d; d = f; f = g; g = t;
    }
    a ^= *++key; b += *++key; c += *++key; d ^= *++key;
    e ^= *++key; f += *++key; g += *++key; h ^= *++key;
    block_out[0] = a & 0xFF; block_out[1] = b & 0xFF;
    block_out[2] = c & 0xFF; block_out[3] = d & 0xFF;
    block_out[4] = e & 0xFF; block_out[5] = f & 0xFF;
    block_out[6] = g & 0xFF; block_out[7] = h & 0xFF;
}

-- 
           Summary: [ColdFire] Illegal move of byte itno address register
                    causes compiler to ICE
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: peter at the-baradas dot com
                CC: gcc-bugs at gcc dot gnu dot org,peter at the-baradas dot
                    com
GCC target triplet: m68k-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16719


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2005-07-26 20:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-26 17:25 [Bug target/16719] New: [ColdFire] Illegal move of byte itno address register causes compiler to ICE peter at the-baradas dot com
2004-07-26 17:26 ` [Bug target/16719] " peter at the-baradas dot com
2004-10-25  0:49 ` pinskia at gcc dot gnu dot org
2004-10-25  0:59 ` pinskia at gcc dot gnu dot org
2005-01-27 17:33 ` ralf dot corsepius at rtems dot org
2005-01-27 18:16 ` peter at the-baradas dot com
2005-01-28 14:11 ` ralf dot corsepius at rtems dot org
2005-07-11 23:32 ` cvs-commit at gcc dot gnu dot org
2005-07-11 23:32 ` bernie at develer dot com
2005-07-11 23:35 ` bernie at develer dot com
2005-07-26  4:49 ` cvs-commit at gcc dot gnu dot org
2005-07-26 20:32 ` cvs-commit at gcc dot gnu dot org
2005-07-26 20:38 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).