Anders Torger <[EMAIL PROTECTED]> wrote:
> I found a case where GCC does not warn even with
> -Wstrict-aliasing, but makes incorrect asm code anyway.
> unsigned long
> hash(void *key)
> {
> unsigned long long u[1];
> u[0] = *(unsigned long long *)key;
> return ((unsigned long *)u)
On Nov 9, 2004, at 2:23 PM, Anders Torger wrote:
gcc 2.95 generates correct code.
It just generates code which you expected not the code which
the C standard says it is undefined (oh by the way we could wipe
your HD if you invoke undefined behavior).
Also a DR report says we cannot error out on u
/*
on x86, sizeof(long long) == 8, sizeof(long) == 4
Ok, I'm back. While fixing my strict aliasing breakerage as Andreas
told me to, I found a case where GCC does not warn even with
-Wstrict-aliasing, but makes incorrect asm code anyway. So I started
to investigate which optimisation