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

            Bug ID: 22342
           Summary: Assertion `StringIndexMap.count(s) && "String is not
                    in table!"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 13739
  --> http://llvm.org/bugs/attachment.cgi?id=13739&action=edit
Obtained by clang -O0 -S -save-temps

Hi, 

Clang fails to compile the attached code, which includes a function whose
section and name is the same, and specified as an alias. 

<<<<<[section.c]
void sub1(void) __attribute__(( section("sub1"), alias("sub2") ));
void sub2(void) { return; }
>>>>>

% clang ./section.c -O0 -c
clang: /home/kama/llvm/include/llvm/MC/StringTableBuilder.h:53: size_t
llvm::StringTableBuilder::getOffset(llvm::StringRef): Assertion
`StringIndexMap.count(s) && "String is not in table!"' failed.
...

Clang is able to emit an assembler file, but fails to emit an object while gcc
succeeds.
Adding to this, there is a difference in assembler files of gcc and clang.
The section of function b code is in .section a by clang and .text by gcc.

I don'n know which section is correct, but at least the assertion must be
fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to