Hello,
I've been trying to compile some crypto code, and it seems 8c
isn't always too happy about it. I eventually got the monster ting
reduced to the below (now very-nonsense code) snippet which dies with;
a.c:22 out of fixed registers
8c 2655: suicide: sys: trap: fault read addr=0x0 pc=0x00036d93

So, for anyone that's bored, and wants to fix the compiler:
#include <u.h>

static uvlong T7[256];

void f(unsigned char *key)
{
        uvlong K1;
        int r;
        uvlong *S = T7;

        for (r = 1; r < 16; r++) {
                K1 =
                    T7[S[(int)(K1 >> 56)       ] & 0xff] ^
                    T7[(int)S[(int)(K1 >> 48) & 0xff] & 0xff] ^
                    T7[(int)S[(int)(K1 >> 40) & 0xff] & 0xff] ^
                    T7[(int)S[(int)(K1 >> 32) & 0xff] & 0xff] ^
                    T7[(int)S[(int)(K1 >> 24) & 0xff] & 0xff] ^
                    T7[(int)S[(int)(K1 >> 16) & 0xff] & 0xff] ^
                    T7[(int)S[(int)(K1 >>  8) & 0xff] & 0xff] ^
                    T7[(int)S[(int)(K1      ) & 0xff] & 0xff];
        }
}


In the mean time, I'll rewrite the piece of code...

--
Nils O. SelÃsdal

Reply via email to