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

           Summary: [lto]: does not recognize/unify identical .macro
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: al...@gcc.gnu.org


Fails with: -flto on
gcc-4.6.0-trunk@169467
GNU assembler (GNU Binutils for Debian) 2.20.1-system.20100303
GNU assembler (GNU Binutils) 2.21.51.20110131
(1da8c83863b4fe3db654d0bb35b46a38069c4c97)

---8<--- one.c ---8<---
__asm__(
#ifdef __IMA__
    ".ifndef __GUARD\n\t"
    ".set __GUARD,1\n\t"
#endif
    ".macro mmm arg1 arg2\n\t"
    ".if 1 - \\arg1\n\t"
    "nop\n\t"
    ".endif\n\t"
    ".endm\n\t"
#ifdef __IMA__
    ".endif\n\t"
#endif
       );
#ifndef __MAIN
#define __MAIN
int main(void){return 0;}
#endif
---8<--- two.c ---8<---
#define __MAIN
#include "one.c"
$ gcc-4.6.orig-HEAD one.c two.c  -o o
$ gcc-4.6.orig-HEAD one.c two.c  -o o -flto
/tmp/ccSk75A8.s: Assembler messages:
/tmp/ccSk75A8.s:28: Error: Macro `mmm' was already defined
lto-wrapper: gcc-4.6.orig-HEAD returned 1 exit status
collect2: lto-wrapper returned 1 exit status
$ gcc-4.6.orig-HEAD one.c two.c  -o o -flto -D__IMA__
$ 

The .macro in all TUs is identical, shouldn't only one be passed to the
assembler?

Reply via email to