-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[fuzzDI] -O1 + -g
cause the generated code to change.
#36654
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
Comments
Diffing a disassembly might be more instructive. You can use |
Only significant difference in codegen: %bb.0: ## %entry
|
This might be the same root cause of the PostRA one, but I haven't confirmed. |
Hi Davide, Is it a requirement to emit the same code for "-g" and no "-g"? |
Yas. |
It's a bug if debug informations change the code generated as debug informations have no semantic value associated. |
The principle here is that if "-g" changes the generated code, it can This is more of a problem for LLVM than some other compilers, because |
Thank you for the reply. GCC has a similar policy (https://gcc.gnu.org/ml/gcc/2018-05/msg00011.html). It would be interesting to test this requirement. |
We have an ongoing effort in llvm (and, at least for me, swift), to find and squash the bugs which cause the differences. |
Hi, Whether this bug is resolved? Because I can't able to reproduce this issue with llvm 8.0.0 svn. I have compared the assembly code between "-O1" and "-O1 + g", I didn't saw any diff. whether source is correct? I think the compiled source is try.c but mentioned Thanks |
I could also not reproduce this issue with clang 10.0.0. |
Resolving as FIXED, as two people have failed to reproduce with a more |
mentioned in issue #37076 |
Extended Description
I'll update the bug title once this is triaged/analyzed.
/Users/dcci/work/llvm/build/bin/clang -Wno-everything try.c -O1 -o try-nodebug
$ cat red.c
b, a, c;
d() { return b; }
f(g) {
int e = d();
c && (a = e + g);
}
main() {}
Difference between text sections (with and without -g)
$ diff text-nodebug text-debug
3,4c3,4
< 100000f70 488d0591 00000083 3800741e 554889e5 H.......8.t.UH..
< 100000f80 535089fb e8d7ffff ff01d848 8d0d6e00 SP.........H..n.
The text was updated successfully, but these errors were encountered: