Skip to content

Building coreutils with LTO causes LLVM error #28066

Closed
@hexsel

Description

@hexsel

Building coreutils with LTO:

make ENABLE_LTO=y ENABLE_STRIP=y

causes the following error:

...
rustc -O -L /Users/gustavo.hexsel/Dev/coreutils/build/ -C lto --extern uufalse=/Users/gustavo.hexsel/Dev/coreutils/build/libfalse.rlib --extern uutrue=/Users/gustavo.hexsel/Dev/coreutils/build/libtrue.rlib --extern uutest=/Users/gustavo.hexsel/Dev/coreutils/build/libtest.rlib -o /Users/gustavo.hexsel/Dev/coreutils/build/fmt /Users/gustavo.hexsel/Dev/coreutils/build/gen/fmt.rs
Instruction does not dominate all uses!
  %oldret2 = insertvalue %str_slice %oldret, i64 %newret1, 1
  %.sink.i.i = phi %str_slice [ %oldret2, %"_ZN6string52String.ops..Index$LT$ops..RangeFrom$LT$usize$GT$$GT$5index20he25fda6b1269058b8bgE.exit.i.i" ], [ %oldret6, %"_ZN6string52String.ops..Index$LT$ops..RangeFrom$LT$usize$GT$$GT$5index20he25fda6b1269058b8bgE.exit61.i.i" ]
Instruction does not dominate all uses!
  %oldret6 = insertvalue %str_slice %oldret4, i64 %newret5, 1
  %.sink.i.i = phi %str_slice [ %oldret2, %"_ZN6string52String.ops..Index$LT$ops..RangeFrom$LT$usize$GT$$GT$5index20he25fda6b1269058b8bgE.exit.i.i" ], [ %oldret6, %"_ZN6string52String.ops..Index$LT$ops..RangeFrom$LT$usize$GT$$GT$5index20he25fda6b1269058b8bgE.exit61.i.i" ]
Instruction does not dominate all uses!
  %143 = invoke fastcc { i8*, i64 } @_ZN3str3str9trim_left20h2c4602b77c2e6481olfE(i8* noalias nonnull readonly %.pre-phi.i.i.58.i.i, i64 %142)
          to label %join7.i.i unwind label %unwind_ast_3291_.loopexit.split-lp.i
  %newret3 = extractvalue { i8*, i64 } %143, 0
Instruction does not dominate all uses!
  %143 = invoke fastcc { i8*, i64 } @_ZN3str3str9trim_left20h2c4602b77c2e6481olfE(i8* noalias nonnull readonly %.pre-phi.i.i.58.i.i, i64 %142)
          to label %join7.i.i unwind label %unwind_ast_3291_.loopexit.split-lp.i
  %newret5 = extractvalue { i8*, i64 } %143, 1
Instruction does not dominate all uses!
  %130 = invoke fastcc { i8*, i64 } @_ZN3str3str9trim_left20h2c4602b77c2e6481olfE(i8* noalias nonnull readonly %.pre-phi.i.i.i.i, i64 %129)
          to label %join7.i.i unwind label %unwind_ast_3291_.loopexit.split-lp.i
  %newret = extractvalue { i8*, i64 } %130, 0
Instruction does not dominate all uses!
  %130 = invoke fastcc { i8*, i64 } @_ZN3str3str9trim_left20h2c4602b77c2e6481olfE(i8* noalias nonnull readonly %.pre-phi.i.i.i.i, i64 %129)
          to label %join7.i.i unwind label %unwind_ast_3291_.loopexit.split-lp.i
  %newret1 = extractvalue { i8*, i64 } %130, 1
LLVM ERROR: Broken function found, compilation aborted!
make: *** [/Users/gustavo.hexsel/Dev/coreutils/build/fmt] Error 1

This error does not occur if you remove ENABLE_LTO=y.

This is on OSX, Rust version is rustc 1.4.0-nightly (63ba780fd 2015-08-23) (coreutils only builds on nightly).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-linkageArea: linking into static, shared libraries and binaries

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions