[Bug middle-end/28581] Illegal loading the address of a label with -O2
sparc64 at rediffmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Nov 18 06:41:00 GMT 2007
------- Comment #7 from sparc64 at rediffmail dot com 2007-11-18 06:41 -------
> No, this extension is not designed that way. It is only designed for computed
> goto's.
So, Are programmers expected to see their code work differently with
optimization enabled ? I dont think so.
> Please read:
> http://gcc.gnu.org/onlinedocs/gcc-4.2.2/gcc/Labels-as-Values.html
I dont find anything in this site that says that the compiler will generate
correct code only when used on a "goto" statement.
I am sure that even the "goto" statement mentioned in this site will not work
with optimization enabled. I am referring to this:
"
void *ptr;
ptr = &&foo;
....
goto *ptr;
"
I will do a quick check and get back. Thanks.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28581
More information about the Gcc-bugs
mailing list