Bug 18603 - [3.4 only] local label names can collide with function names
Summary: [3.4 only] local label names can collide with function names
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.3
: P2 normal
Target Milestone: 3.4.6
Assignee: Not yet assigned to anyone
URL:
Keywords: assemble-failure
Depends on:
Blocks:
 
Reported: 2004-11-21 23:22 UTC by wolfgang.thaller
Modified: 2006-02-28 09:45 UTC (History)
2 users (show)

See Also:
Host:
Target: powerpc64-unknown-linux
Build:
Known to work: 4.0.0
Known to fail: 3.4.3
Last reconfirmed: 2006-02-20 18:32:06


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wolfgang.thaller 2004-11-21 23:22:23 UTC
GCC uses local label names .L1, .L2, etc. on this platform.
However these same assembly labels are used for functions named "L1" or "L2".

wolfgang@gorecki wolfgang $ cat L.c
int L2(int x)
{
        if(x > 5)
                return -42;
        else
                return 42;
}
wolfgang@gorecki wolfgang $ gcc -c L.c
/tmp/ccL2lhwX.s: Assembler messages:
/tmp/ccL2lhwX.s:26: Error: symbol `.L2' is already defined

Observed on gentoo powerpc64; also observed on a gcc-3.4.2 cross-compiling from powerpc-apple-
darwin to powerpc64-unknown-linux.
Comment 1 Andrew Pinski 2004-11-21 23:58:15 UTC
Confirmed.
Comment 2 Alan Modra 2004-11-23 22:56:31 UTC
This has been fixed on mainline.  Note that you need a recent (2004-09) binutils
with support for new dot-symbol conventions when you configure and build GCC.

I can make a patch available for 3.4.3 if there's sufficient interest.
Comment 3 Gabriel Dos Reis 2005-11-21 02:23:13 UTC
(In reply to comment #2)
> This has been fixed on mainline.  Note that you need a recent (2004-09)
> binutils
> with support for new dot-symbol conventions when you configure and build GCC.
> 
> I can make a patch available for 3.4.3 if there's sufficient interest.
> 
Hi Alan,

  Are you still willing to make the patch for 3.4.x?

-- Gaby

Comment 4 Gabriel Dos Reis 2006-02-28 09:45:46 UTC
won't fix for 3.4.6