Closed
Description
When compiling rustc with "--enable-debug --enable-optimize" the stage0 compiler fails to build libsyntax with
!dbg attachment points at wrong subprogram for function
!157085 = !DISubprogram(name: "fnfn", linkageName: "fnfn", scope: !157069, file: !157069, line: 38, type: !42899, isLocal: true, isDefinition: true, scopeLine: 38, flags: DIFlagPrototyped, isOptimized: true, function: i64 (%closure.1242*, %"ast::Expr"*)* @_ZN3ext6expand11expand_expr13closure.69625E, templateParams: !1036, variables: !157086)
i64 (%closure.1242*, %"ast::Expr"*)* @_ZN3ext6expand11expand_expr13closure.69625E
tail call void @llvm.dbg.value(metadata %"ext::expand::IdentRenamer"* %rename_fld.i.857, i64 0, metadata !157464, metadata !190803), !dbg !771025
!771025 = !DILocation(line: 113, scope: !157458, inlinedAt: !771026)
!771027 = distinct !DILexicalBlock(scope: !771028, file: !157069, line: 129, column: 56)
!160753 = !DISubprogram(name: "fnfn", linkageName: "fnfn", scope: !157069, file: !157069, line: 129, type: !160754, isLocal: true, isDefinition: true, scopeLine: 129, flags: DIFlagPrototyped, isOptimized: true, templateParams: !1036, variables: !160756)
LLVM ERROR: Broken function found, compilation aborted!
This started with #28857, but it looks to me like that just happened to trigger a preexisting bug.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
pnkfelix commentedon Oct 11, 2015
I am able to reproduce this on my native linux system. I have not yet tried in a VM yet. Its a pretty bad show-stopper for Linux work (at least if one wants to use
--enable-debug
in a usable manner).dotdash commentedon Oct 11, 2015
JFYI, I started looking into this.
pnkfelix commentedon Oct 12, 2015
(this problem does not reproduce on Mac OS X, which may be fortunate or unfortunate, depending on one's POV...)Update: Now I have reproduced it on OS X. I am not sure where my earlier attempt to reproduce went wrong. Anyway, this heightens my desire to get this fixed considerably...
cc @nrc
--enable-debug --enable-optimize
bot that at least bootstraps (no tests) #27010pnkfelix commentedon Oct 13, 2015
@dotdash have you made much progress, e.g. have you made a reduced test case, or have insight into what's wrong?
I am wondering in part because I am willing to spend time looking at this, but I do not want to waste or duplicate effort.
dotdash commentedon Oct 13, 2015
Not much progress yet. For some reason, the
inlinedAt
chain for thedbg.value
calls is missing. AFAICT so far, our debug info looks fine (Imight be missing something though), so I'm looking at the LLVM code to see
how inlining handles debug info and how the conversion from
dbg.declare
to
dbg.value
works.2015-10-13 12:01 GMT+02:00 Felix S Klock II notifications@github.com:
sanxiyn commentedon Oct 13, 2015
Something weird is going on.
-verify-each
causes the error to disappear.ghost commentedon Oct 14, 2015
Reproduced on a hardened gentoo linux (here's all you need to know about the system: http://dpaste.com/1DQ0EFB.txt ) as follows:
rust commit tested: 294ef5b
In trying to follow sanxiyn's comment above, changing the above RUSTFLAGS to:
RUSTFLAGS="--verbose -C llvm-args=-verify-each"
fails after a while(I'm probably doing it wrong):
No idea where to stick that
-verify-each
at the moment, so thatmake
would work with it. Any ideas?EDIT1: It actually went past it with
-verify-scev
I'm guessing due to llvm version that rust compilation uses, instead of my installed version(3.7.0) which does have the-verify-each
But the original reported issue still happens (with -verify-scev): !dbg attachment points at wrong subprogram for function
EDIT2: I'm still getting the error that maybe I meant to use
-verify-scev
when trying with my own llvm and my own (local)rust, after a make clean and removal of directoryrust/x86_64-unknown-linux-gnu/
then a configure then makeDoes rustc maybe have a whitelisted llvm-args that's allowing to passthru ? Or how does it fail to use my llvm(3.7.0) which clearly does have that
opt
ion ?EDIT3: One more thing, I accidentally had
--disable-local-rust
with--enable-local-rust
of which only the former took place but when I removed it:but maybe I got the
--local-rust-root="/usr"
wrong, I've no idea which is right since it fails the same with/usr/local
. I'll stick with supplied rustc then.EDIT4: ok, the reason
-verify-each
fails is because it's passed tollc
instead of toopt
(commands) and for some reason llc doesn't have it but opt does.EDIT5: tested with git llvm (3.8.0) and the error still happens:
latest rust commit tested 1ad1b7d
Maybe I'll get back to rust some other time.
nikomatsakis commentedon Oct 15, 2015
triage: P-medium
29 remaining items