Skip to content
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

LLVM warning "fragment covers entire variable" when compiling sdl2 crate in release profile with debuginfo #49565

Closed
parasyte opened this issue Apr 1, 2018 · 2 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@parasyte
Copy link

parasyte commented Apr 1, 2018

Note: This issue was downstreamed to the compiler on request of the sdl2 crate author: Rust-SDL2/rust-sdl2#761

Using rustc 1.26.0-nightly (517f24025 2018-03-31):

#Cargo.toml
[package]
name = "sdl2test"
version = "0.0.1"

[profile.release]
debug = true

[dependencies]
sdl2 = "0.31.0"
$ cargo +nightly build --release
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading libc v0.2.40
   Compiling num-traits v0.2.2
   Compiling cfg-if v0.1.2
   Compiling libc v0.2.40
   Compiling lazy_static v0.2.11
   Compiling bitflags v0.7.0
   Compiling sdl2-sys v0.31.0
   Compiling rand v0.4.2
   Compiling num-integer v0.1.36
   Compiling num-iter v0.1.35
   Compiling num v0.1.42
   Compiling rand v0.3.22
   Compiling sdl2 v0.31.0
fragment covers entire variable
!72 = !DIGlobalVariableExpression(var: !73, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
!73 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !74, file: !75, line: 76, type: !76, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
fragment covers entire variable
!29 = !DIGlobalVariableExpression(var: !30, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
!30 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !31, file: !32, line: 76, type: !33, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
fragment covers entire variable
fragment covers entire variable
!52 = !DIGlobalVariableExpression(var: !53, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
!53 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !54, file: !56, line: 76, type: !57, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
!17 = !DIGlobalVariableExpression(var: !18, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
fragment covers entire variable
!18 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !19, file!: 17! = 21!DIGlobalVariableExpression(, varline: : !7618, , typeexpr: : !!DIExpression(22DW_OP_LLVM_fragment, , isLocal0: , true64, )isDefinition):
true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
!18 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !19, file: !21, line: 76, type: !22, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
fragment covers entire variable
!17 = !DIGlobalVariableExpression(var: !18, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
!18 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !19, file: !21, line: 76, type: !22, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
fragment covers entire variable
!75 = !DIGlobalVariableExpression(var: !76, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
!76 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !77, file: !78, line: 76, type: !79, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
fragment covers entire variable
!22 = !DIGlobalVariableExpression(var: !23, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
!23 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !24, file: !26, line: 76, type: !27, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
fragment covers entire variable
!17 = !DIGlobalVariableExpression(var: !18, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
!18 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !19, file: !21, line: 76, type: !22, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
fragment covers entire variable
!17 = !DIGlobalVariableExpression(var: !18, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
!18 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !19, file: !21, line: 76, type: !22, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
fragment covers entire variable
!14 = !DIGlobalVariableExpression(var: !15, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
!15 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !16, file: !18, line: 76, type: !19, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
fragment covers entire variable
!14 = !DIGlobalVariableExpression(var: !15, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
!15 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !16, file: !18, line: 76, type: !19, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
fragment covers entire variable
!14 = !DIGlobalVariableExpression(var: !15, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
!15 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !16, file: !18, line: 76, type: !19, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
fragment covers entire variable
!52 = !DIGlobalVariableExpression(var: !53, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
!53 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !54, file: !56, line: 76, type: !57, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
fragment covers entire variable
!14 = !DIGlobalVariableExpression(var: !15, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
!15 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !16, file: !18, line: 76, type: !19, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
fragment covers entire variable
!17 = !DIGlobalVariableExpression(var: !18, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 64))
!18 = distinct !DIGlobalVariable(name: "custom_log_fn", linkageName: "_ZN4sdl23log13custom_log_fn17h01b04876a3686b8eE", scope: !19, file: !21, line: 76, type: !22, isLocal: true, isDefinition: true, align: 8)
warning: ignoring invalid debug info in sdl210-4abc37cbe56027e5463d26b0243ff28a.rs
   Compiling sdltest v0.1.0 (file:///Users/parasyte/Desktop/sdltest)
    Finished release [optimized + debuginfo] target(s) in 11.87 secs

The warnings point at custom_log_fn in the crate.

This is not a minimal test case, because it requires installing libsdl2 (using brew, apt, yum, etc) and there is a lot going on in the sdl2 crate.

@pietroalbini pietroalbini added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 12, 2018
@nnethercote
Copy link
Contributor

This is similar to #48910.

@dotdash
Copy link
Contributor

dotdash commented Jun 19, 2018

This seems to be fixed in the current nightly.

@jonas-schievink jonas-schievink added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants