Skip to content

[Boost regression] Miscompile with private constant array #9788

@DougGregor

Description

@DougGregor
Bugzilla Link 9416
Resolution FIXED
Resolved on Jan 15, 2013 01:00
Version trunk
OS All
Attachments Example C++ source, Preprocessed output, LLVM IR generated by Clang - fails, LLVM IR generated with clang, replacing "private" with "internal" linkage for the array in question - passes
CC @lattner,@echristo

Extended Description

With the given example file (t.cpp), the std::copy instantiation appears to be miscompiled when built with Clang for x86-64. The LLVM IR looks reasonable, in the resulting assembly the std::copy caller pushes the [first, last) arguments into [%rdi, %rsi) but the callee seems to pick them up as [%rsi, %di). At least, the subtraction looks backwards (?). The net effect is that the loop inside std::copy is never executed.

(More attachments and comments coming)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:codegenIR generation bugs: mangling, exceptions, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions