From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23969 invoked by alias); 18 Nov 2007 06:41:51 -0000 Received: (qmail 23927 invoked by uid 48); 18 Nov 2007 06:41:42 -0000 Date: Sun, 18 Nov 2007 06:41:00 -0000 Message-ID: <20071118064142.23926.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/28581] Illegal loading the address of a label with -O2 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sparc64 at rediffmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg01658.txt.bz2 ------- 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