This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/28581] Illegal loading the address of a label with -O2
- From: "sparc64 at rediffmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Nov 2007 06:41:42 -0000
- Subject: [Bug middle-end/28581] Illegal loading the address of a label with -O2
- References: <bug-28581-5993@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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