From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27591 invoked by alias); 9 Feb 2006 00:29:23 -0000 Received: (qmail 27571 invoked by uid 48); 9 Feb 2006 00:29:21 -0000 Date: Thu, 09 Feb 2006 00:29:00 -0000 Subject: [Bug middle-end/26187] New: computed goto code does not produce jumps X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "bje at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-02/txt/msg00860.txt.bz2 List-Id: When compiling the test case below, the assembly output shows jmps through eax to the destination pointer, p, for the functions goto0 and goto2 (which contain zero and two expressions that take the address of a label). In function goto1, which only takes the address of one label, there is no jmp instruction generated. The test case originally assigned the label addresses to void * auto variables, but I removed those while simplifying the test. I've been able to reproduce this problem on powerpc-linux-gnu also, so it appears to be target independent. Compile with gcc -S foo.c and examine foo.s. extern int printf (const char *format, ...); int x; void goto0 (void *p) { goto *p; } void goto1 (void *p) { &&label; goto *p; label: x = 0; } void goto2 (void *p) { &&label1; &&label2; goto *p; label1: label2: x = 0; } -- Summary: computed goto code does not produce jumps Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bje at gcc dot gnu dot org GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26187