http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51088

             Bug #: 51088
           Summary: undefined symbol [local label]  (optimization of
                    indirect goto)
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: etienne.berge...@octasic.com


This test case fail to compile with a error 'missing label'.
A label seem to be optimized and is missing at the end.

int test()
{
    return ({ for ( void* L[] = {
                (1?&&A:({goto *(*L?&&A:&&end); (void*)0;})),
                ((1||({B: goto *1[L]; 1;})),&&C),
                ({if (0) C: goto *&&end; &&B;}),
            }; ({A: goto *L[2]; 1;}); ({end: return 42; 0;}))
        goto *(0[L]); -1; });
}

* gcc (Debian 4.4.5-8) 4.4.5 (x86_64)

gcc -std=c99 -o blah blah.c
/tmp/ccWabCoL.o: In function `test':
blah.c:(.text+0x5): undefined reference to `.L2'
collect2: ld returned 1 exit status

* gcc (Debian 4.6.1-4) 4.6.1 (x86_64)

gcc -o blah blah.c -std=c99
/tmp/ccOX241S.o:blah.c:function test: error: undefined reference to '.L4'
collect2: ld returned 1 exit status

Reply via email to