Skip to content

Enabling lto in 1.2.0 causes LLVM ERROR near llvm.lifetime.end #28233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
codyps opened this issue Sep 4, 2015 · 11 comments
Closed

Enabling lto in 1.2.0 causes LLVM ERROR near llvm.lifetime.end #28233

codyps opened this issue Sep 4, 2015 · 11 comments
Labels
A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.

Comments

@codyps
Copy link
Contributor

codyps commented Sep 4, 2015

% rustc -V
rustc 1.2.0 (082e47636 2015-08-03)
-C opt-level=3 -g -C debug-assertions=on 

Disabling lto causes compilation to complete without issue. Enabling it causes errors as follow.

Below are a few runs of cargo build followed by cargo clean between runs.

Instruction does not dominate all uses!
  %.sroa.713813151316 = bitcast [39 x i64]* %.sroa.7138 to i8*
  call void @llvm.lifetime.end(i64 8, i8* %.sroa.713813151316), !dbg !217386
LLVM ERROR: Broken function found, compilation aborted!
Instruction does not dominate all uses!
  %27 = bitcast [2 x i64]* %26 to i8*
  call void @llvm.lifetime.end(i64 8, i8* %27), !dbg !230419
LLVM ERROR: Broken function found, compilation aborted!
Could not compile `coattail`.

(note: some cargo output was mixed in with the next one, I've left it in place without editing)

Instruction does not dominate all uses!
  <badref> = bitcast Build failed, waiting for other jobs to finish...
Call parameter type does not match function signature!
  %1012 = load i32, i32* %633, align 8, !dbg !230475
 i8*  call void @llvm.lifetime.end(i64 8, i32 %1012), !dbg !230419
LLVM ERROR: Broken function found, compilation aborted!
@codyps
Copy link
Contributor Author

codyps commented Sep 4, 2015

Just tried with nightly and got the following:

rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:713: llvm::DIE* llvm::DwarfUnit::getOrCreateTypeDIE(const llvm::MDNode*): Assertion `Ty == resolve(Ty->getRef()) && "type was not uniqued, possible ODR violation."' failed.
Build failed, waiting for other jobs to finish...
rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:713: llvm::DIE* llvm::DwarfUnit::getOrCreateTypeDIE(const llvm::MDNode*): Assertion `Ty == resolve(Ty->getRef()) && "type was not uniqued, possible ODR violation."' failed.
rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:713: llvm::DIE* llvm::DwarfUnit::getOrCreateTypeDIE(const llvm::MDNode*): Assertion `Ty == resolve(Ty->getRef()) && "type was not uniqued, possible ODR violation."' failed.
rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:713: llvm::DIE* llvm::DwarfUnit::getOrCreateTypeDIE(const llvm::MDNode*): Assertion `Ty == resolve(Ty->getRef()) && "type was not uniqued, possible ODR violation."' failed.
rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:713: llvm::DIE* llvm::DwarfUnit::getOrCreateTypeDIE(const llvm::MDNode*): Assertion `Ty == resolve(Ty->getRef()) && "type was not uniqued, possible ODR violation."' failed.
 % rustc -V
rustc 1.4.0-nightly (cd138dc44 2015-09-02)

So the error from nightly is a bit better, but we're still choking when we shouldn't

@dotdash
Copy link
Contributor

dotdash commented Sep 4, 2015

The second one is probably #26447 which has been fixed recently.

@codyps
Copy link
Contributor Author

codyps commented Sep 4, 2015

@dotdash that was closed 19 days ago (2015-08-16), but my nightly (as can be seen above) is from 2 days ago (2015-09-02).

Either there is a regression or this is a different issue (or nightlies are not as nightly as I'd expect)

@dotdash
Copy link
Contributor

dotdash commented Sep 4, 2015

Oh, that version information was not in the mail I got, and I didn't check the page if there were any edits. Nevermind that then.

@steveklabnik
Copy link
Member

Is this when compiling specific code, all code, or the compiler itself?

@steveklabnik steveklabnik added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-codegen Area: Code generation labels Sep 4, 2015
@codyps
Copy link
Contributor Author

codyps commented Sep 5, 2015

@steveklabnik

I'm seeing this on one of my projects.

I haven't tested editing other crates Cargo.toml's to enable lto to see if they have a similar failure, but I'll take a look at doing so.

I'll see if I can find some code I can point at that reproduces, but I'm not sure I can promise anything here.

@sanxiyn
Copy link
Member

sanxiyn commented Oct 8, 2015

How can I reproduce this issue?

@vi
Copy link
Contributor

vi commented Apr 26, 2016

When compiling this with cargo rustc -v -- -C lto, I get this:

   Compiling scgi_uploader v0.1.0 (file:///home/vi/code/scgi_uploader)
     Running `rustc src/main.rs --crate-name scgi_uploader --crate-type bin -g -C lto --out-dir /home/vi/code/scgi_uploader/target/debug --emit=dep-info,link -L dependency=/home/vi/code/scgi_uploader/target/debug -L dependency=/home/vi/code/scgi_uploader/target/debug/deps --extern time=/home/vi/code/scgi_uploader/target/debug/deps/libtime-9205cc1af6219594.rlib --extern scgi=/home/vi/code/scgi_uploader/target/debug/deps/libscgi-f7a16f1d604a0cb1.rlib`
rustc: /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:724: llvm::DIE* llvm::DwarfUnit::getOrCreateTypeDIE(const llvm::MDNode*): Assertion `Ty == resolve(Ty->getRef()) && "type was not uniqued, possible ODR violation."' failed.
error: Could not compile `scgi_uploader`.

Caused by:
  Process didn't exit successfully: `rustc src/main.rs --crate-name scgi_uploader --crate-type bin -g -C lto --out-dir /home/vi/code/scgi_uploader/target/debug --emit=dep-info,link -L dependency=/home/vi/code/scgi_uploader/target/debug -L dependency=/home/vi/code/scgi_uploader/target/debug/deps --extern time=/home/vi/code/scgi_uploader/target/debug/deps/libtime-9205cc1af6219594.rlib --extern scgi=/home/vi/code/scgi_uploader/target/debug/deps/libscgi-f7a16f1d604a0cb1.rlib` (signal: 6, SIGABRT: process abort signal)

With --release it works.

rustc 1.10.0-nightly (bd938166d 2016-04-25), i686->i686.

@jonas-schievink
Copy link
Contributor

Triage: @vi's example still triggers the assertion on rustc 1.11.0-nightly (34505e222 2016-06-08)

@tomprogrammer
Copy link
Contributor

tomprogrammer commented Jul 13, 2016

This also occurs when building https://github.com/serde-rs/json-benchmark with LTO enabled.

Used compiler: rustc 1.12.0-nightly (7ad125c4e 2016-07-11)

rustc: /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:724: llvm::DIE* llvm::DwarfUnit::getOrCreateTypeDIE(const llvm::MDNode*): Assertion `Ty == resolve(Ty->getRef()) && "type was not uniqued, possible ODR violation."' failed.
error: Could not compile `json-benchmark`.

@Mark-Simulacrum
Copy link
Member

The scgi example doesn't reproduce when building. json-benchmark current doesn't build (proc_macro crate isn't found). Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
Projects
None yet
Development

No branches or pull requests

8 participants