[LLVMbugs] [Bug 4447] New: llvm-gcc asserts on gcc extension

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Jun 25 10:10:33 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=4447

           Summary: llvm-gcc asserts on gcc extension
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llvm-gcc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: dalej at apple.com
                CC: llvmbugs at cs.uiuc.edu


extern inline int foo(int x) { return x&1; }
int bar (int x, int y) { return foo(x+y); }
int foo (int x) { return x&1; }

llvm-gcc -O0 z.c
Assertion failed: (FnEntry->isDeclaration() && "Multiple fns with same name and
neither are external!"), function StartFunctionBody

gcc "extern inline" == C99 "inline", of course.  My reading of C99 is that we
don't have to accept this, but it is not explicitly stated, and I seem to
recall a flame war on the gcc lists when the matter arose; it is possible the
gcc maintainers came to a different conclusion.   In any event, gcc does accept
this, and llvm-gcc accepts it at any opt level above -O0; clang rejects it. 
Regardless of legality, asserting is bad.
(This showed up in 4 test failures in the gcc testsuite, not in real code.)


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list