Bug 136714 - GCC generates undefined label references
GCC generates undefined label references
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc (Show other bugs)
4.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-21 16:59 EDT by Steve Singer
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version: 3.4.2-6.fc3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-26 13:36:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
A C program that shows the bug (9.30 KB, text/html)
2004-10-21 17:02 EDT, Steve Singer
no flags Details

  None (edit)
Description Steve Singer 2004-10-21 16:59:48 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616

Description of problem:
Run the code snippet attached

gcc -fwriteable-strings GCC_Bug.c 

It generates errors of the form 
/tmp/ccTJfIEe.o(.rodata+0xc): undefined reference to `.LC766'


If you run gcc with the -S option you can look at the assembly generated.


If you search for LC766 it is used in  a segment of assembly code like:

# cpWordMatch:
        .long   .LC766


but the label LC766 is  not defined anywhere.

If you look at the label used on the line of assemebly above it, it is
# cpType:
        .long   .LC535

label LC536 is defined but never referenced.  I belive LC536 contains
should be at LC766 (or alternativly the references to LC766 should
really be a reference to LC535)

I think there is something 'special' about LC766 when encounter the
problem in my actual program it's LC766 that is the undefined label
but the unreferenced value(LC536) changes as I vary the input program.




Version-Release number of selected component (if applicable):
gcc-3.4.1-10

How reproducible:
Always

Steps to Reproduce:
1.gcc -fwritable-strings GCC_Bug.c  where GCC_Bug.c contains the
program specified in additional information.
2. The -fwritable-strings seems to be important(Yes I know it won't be
supported in GCC 4, but this isn't GCC 4 and if the compiler is going
to support the option then it should work)
3.
    

Actual Results:  cc1: note: -fwritable-strings is deprecated; see
documentation for details
/tmp/cckzurUT.o(.rodata+0xc): undefined reference to `.LC766'
/tmp/cckzurUT.o(.rodata+0x60): undefined reference to `.LC767'
/tmp/cckzurUT.o(.rodata+0x70): undefined reference to `.LC768'
/tmp/cckzurUT.o(.rodata+0x7c): undefined reference to `.LC769'
/tmp/cckzurUT.o(.rodata+0x9c): undefined reference to `.LC770'
/tmp/cckzurUT.o(.rodata+0xbc): undefined reference to `.LC771'
/tmp/cckzurUT.o(.rodata+0xcc): undefined reference to `.LC772'
/tmp/cckzurUT.o(.rodata+0xf0): undefined reference to `.LC773'
/tmp/cckzurUT.o(.rodata+0x120): undefined reference to `.LC774'
/tmp/cckzurUT.o(.rodata+0x19c): undefined reference to `.LC775'
/tmp/cckzurUT.o(.rodata+0x1a0): undefined reference to `.LC776'
/tmp/cckzurUT.o(.rodata+0x1b0): undefined reference to `.LC777'
/tmp/cckzurUT.o(.rodata+0x1bc): undefined reference to `.LC778'
/tmp/cckzurUT.o(.rodata+0x1cc): undefined reference to `.LC779'
/tmp/cckzurUT.o(.rodata+0x20c): undefined reference to `.LC780'
/tmp/cckzurUT.o(.rodata+0x260): undefined reference to `.LC781'
/tmp/cckzurUT.o(.rodata+0x2c0): undefined reference to `.LC782'
/tmp/cckzurUT.o(.rodata+0x2dc): undefined reference to `.LC783'
/tmp/cckzurUT.o(.rodata+0x37c): undefined reference to `.LC784'
/tmp/cckzurUT.o(.rodata+0x3ec): undefined reference to `.LC785'
/tmp/cckzurUT.o(.rodata+0x40c): undefined reference to `.LC786'
/tmp/cckzurUT.o(.rodata+0x41c): undefined reference to `.LC787'
/tmp/cckzurUT.o(.rodata+0x4ac): undefined reference to `.LC788'
/tmp/cckzurUT.o(.rodata+0x500): undefined reference to `.LC789'
/tmp/cckzurUT.o(.rodata+0x50c): undefined reference to `.LC790'
/tmp/cckzurUT.o(.rodata+0x52c): undefined reference to `.LC791'
/tmp/cckzurUT.o(.rodata+0x570): undefined reference to `.LC792'
/tmp/cckzurUT.o(.rodata+0x580): undefined reference to `.LC793'
/tmp/cckzurUT.o(.rodata+0x59c): undefined reference to `.LC794'
/tmp/cckzurUT.o(.rodata+0x5a0): undefined reference to `.LC795'
/tmp/cckzurUT.o(.rodata+0x5e0): undefined reference to `.LC796'
/tmp/cckzurUT.o(.rodata+0x5f0): undefined reference to `.LC797'
/tmp/cckzurUT.o(.rodata+0x63c): undefined reference to `.LC798'
/tmp/cckzurUT.o(.rodata+0x650): undefined reference to `.LC799'
/tmp/cckzurUT.o(.rodata+0x68c): undefined reference to `.LC800'
/tmp/cckzurUT.o(.rodata+0x6a0): undefined reference to `.LC801'
/tmp/cckzurUT.o(.rodata+0x730): undefined reference to `.LC802'
collect2: ld returned 1 exit status


Expected Results:  A program that compiles and links.


Additional info:
Comment 1 Steve Singer 2004-10-21 17:02:57 EDT
Created attachment 105610 [details]
A C program that shows the bug
Comment 3 Jakub Jelinek 2004-10-26 13:36:20 EDT
Should be fixed in gcc-3.4.2-6.fc3.

Note You need to log in before you can comment on or make changes to this bug.