[gcc(refs/users/aoliva/heads/testme)] vartrack: fix skipping of unsuitable locs
Alexandre Oliva
aoliva@gcc.gnu.org
Wed Dec 17 06:40:21 GMT 2025
https://gcc.gnu.org/g:2721a5834bb0b7d59e2fb9864448f148f87f5fff
commit 2721a5834bb0b7d59e2fb9864448f148f87f5fff
Author: Alexandre Oliva <oliva@adacore.com>
Date: Wed Dec 17 02:44:31 2025 -0300
vartrack: fix skipping of unsuitable locs
When the last loc in a chain happens to be an unsuitable_loc(), we
record VAR_LOC_FROM as if the empty location had been derived from
that unsuitable loc, instead of leaving it empty, which ends up
preventing the VAR loc from being recomputed when other related locs
are usefully expanded.
Adjust the code that skips an unsuitable_loc() to take the same
preparation steps we take for exiting the loop as when an expansion
attempt yields NULL_RTX.
for gcc/ChangeLog
* var-tracking.cc (vt_expand_var_loc_chain): Prepare to exit
the loop after unsuitable_loc.
Diff:
---
gcc/var-tracking.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/var-tracking.cc b/gcc/var-tracking.cc
index 8732c3ba62aa..7c255b1a8833 100644
--- a/gcc/var-tracking.cc
+++ b/gcc/var-tracking.cc
@@ -8397,7 +8397,7 @@ vt_expand_var_loc_chain (variable *var, bitmap regs, void *data,
next = loc;
cloc = cloc->next;
if (unsuitable_loc (loc_from))
- continue;
+ goto try_next_loc;
}
else
{
@@ -8437,6 +8437,7 @@ vt_expand_var_loc_chain (variable *var, bitmap regs, void *data,
result = NULL;
}
+ try_next_loc:
/* Set it up in case we leave the loop. */
depth.complexity = depth.entryvals = 0;
loc_from = NULL;
More information about the Gcc-cvs
mailing list