This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/28581] Illegal loading the address of a label with -O2



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]