[Bug tree-optimization/57230] [4.7/4.8/4.9 Regression] tree-ssa-strlen incorrectly optimizes a strlen to 0
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri May 10 16:19:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57230
--- Comment #10 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #9)
> That case is for the
> if (idx > 0)
> {
> si = get_strinfo (idx);
> ...
> }
> block in there, and si != NULL && si->length != NULL_TREE && TREE_CODE
> (si->length) == INTEGER_CST is what you are looking for (together with
> gimple_assign_rhs1 (stmt) being non-zero INTEGER_CST. You'd just verify that
> si->length is bigger than 0 and if so, set si->dont_invalidate = true;
Thanks a lot. Unfortunately, that doesn't seem to work, for
# .MEM_5 = VDEF <.MEM_2>
p[1] = 79;
and
# .MEM_6 = VDEF <.MEM_5>
p[6] = 82;
the idx (obtained via get_addr_stridx) is 0, so we don't enter that if (idx >
0) { ... } block.
The idx is 1 for
# .MEM_10 = VDEF <.MEM_9>
p ={v} {CLOBBER};
but that isn't very helpful.
More information about the Gcc-bugs
mailing list