diff options
author | Richard Biener <rguenther@suse.de> | 2021-05-05 10:15:27 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-05-06 10:08:16 +0200 |
commit | b5254d6b75fe6be669396cd1261f1cba829cc451 (patch) | |
tree | 06c551fc0f78bc3c3a7c573ffdb5ae7dd8261f28 /gcc/tree-inline.c | |
parent | 2fd7689cb29c725f732acbd8a0a71eef35518859 (diff) | |
download | gcc-b5254d6b75fe6be669396cd1261f1cba829cc451.zip gcc-b5254d6b75fe6be669396cd1261f1cba829cc451.tar.gz gcc-b5254d6b75fe6be669396cd1261f1cba829cc451.tar.bz2 |
ipa/100373 - fix emutls lowering compare-debug issue
emutls figured that tls uses in debug-insns need lowering but
that obviously has effects on code-generation as can be seen
in the following IL diff with the new testcase:
<bb 2> [local count: 1073741824]:
- a = 0;
+ # DEBUG BEGIN_STMT
_4 = __builtin___emutls_get_address (&__emutls_v.b);
+ # DEBUG D#1 => *_4
+ # DEBUG d => (long int) D#1
+ # DEBUG BEGIN_STMT
+ a = 0;
+ # DEBUG BEGIN_STMT
*_4 = 0;
return;
where it figured the debug use of b in the original
<bb 2> [local count: 1073741824]:
# DEBUG BEGIN_STMT
# DEBUG D#1 => b
# DEBUG d => (long int) D#1
# DEBUG BEGIN_STMT
a = 0;
needs lowering (it maybe does when we want to produce perfect
debug but that's just bad luck).
The following patch fixes this by avoiding to create a new
emutls address when visiting debug stmts and instead resets them.
Another option might be to simply not lower debug stmt uses
but I have no way to verify actual debug info for this.
2021-05-05 Richard Biener <rguenther@suse.de>
PR ipa/100373
* tree-emutls.c (gen_emutls_addr): Pass in whether we're
dealing with a debug use and only query existing addresses
if so.
(lower_emutls_1): Avoid splitting out addresses for debug
stmts, reset the debug stmt when we fail to find existing
lowered addresses.
(lower_emutls_phi_arg): Set wi.stmt.
* gcc.dg/pr100373.c: New testcase.
Diffstat (limited to 'gcc/tree-inline.c')
0 files changed, 0 insertions, 0 deletions