Serious code generation/optimisation bug (I think)

Ian Lance Taylor iant@google.com
Tue Jan 27 21:12:00 GMT 2009


Laurent GUERBY <laurent@guerby.net> writes:

> Just curious: is there a "portable" way to read from memory
> address zero in C code? "portable" here means likely to work
> on most compilers without exotic compile flags in 2009.

char *my_null_pointer;
char fn() { return *my_null_pointer; }

It will be quite a while before whole program optimization is good
enough to prove that my_null_pointer is not referenced by anything
else.

Ian



More information about the Gcc mailing list