Skip to content

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

Closed
@parasyte

Description

@parasyte

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions