[Bug lto/40721] New: [LTO] complains about two tentative definitions

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Jul 11 17:45:00 GMT 2009


This breaks a lot of benchmarks in SPEC CPU 2000.

t.c

int i;

t2.c

int i;
int main() { return i; }

$ ./xgcc -B. -o t t1.c t2.c
$ ./xgcc -B. -o t t1.c t2.c -flto
t2.c:1:5: error: 'i' has already been defined
t1.c:1:5: error: previously defined here
lto-wrapper: ././xgcc returned 1 exit status
collect2: lto-wrapper returned 1 exit status

the LTO behavior is wrong for C.  The testcase would violate the C++ ODR, but
LTO should not reject the valid C program (note ODR violations do not need to
be diagnosed).


-- 
           Summary: [LTO] complains about two tentative definitions
           Product: gcc
           Version: lto
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list