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

[DebugInfo@O2] SimplifyCFG sink splitting drops a variable location #41226

Open
jmorse opened this issue May 15, 2019 · 0 comments
Open

[DebugInfo@O2] SimplifyCFG sink splitting drops a variable location #41226

jmorse opened this issue May 15, 2019 · 0 comments
Labels
bugzilla Issues migrated from bugzilla wrong-debug

Comments

@jmorse
Copy link
Member

jmorse commented May 15, 2019

Bugzilla Link 41881
Version trunk
OS Linux
Blocks #38116
CC @gregbedwell,@jdm,@OCHyams,@pogo59,@Melamoto

Extended Description

With llvm/clang r359863, running "clang -emit-llvm -O2 -g -S" on the code below, the dbg.value representing the assignment of "local = q" is dropped by SimplifyCFG. From the names of the basic blocks, it would appear to be the SinkCommonCodeFromPredecessors function that does the dropping.

--------8<--------
volatile int g, *x;

int baz(int p, int q) {
int local;

local = p;
switch (g) {
case 1:
x[1] = local;
g += p;
break;
case 2:
x[1] += p;
break;
case 3:
local = q;
g++;
break;
}

return 4 + q;
}
-------->8--------

In this particular test case the impact of dropping the "local=q" assignment is that the "local=p" assignment dominates all blocks, and an incorrect location for "local" is produce in the "case 3" and exit block. (Didn't test this as far as a debugger because I believe the error is fairly clear).

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla wrong-debug
Projects
None yet
Development

No branches or pull requests

1 participant