]> git.ipfire.org Git - thirdparty/gcc.git/commit
ipa/120006 - wrong code with IPA PTA
authorRichard Biener <rguenther@suse.de>
Wed, 30 Apr 2025 08:01:47 +0000 (10:01 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 5 May 2025 13:08:18 +0000 (15:08 +0200)
commit169ad482497ae9c672a825050b8f4b6d54cd5d24
tree7b083ec752d72bb00087d3800f99d039bf5f9c4e
parentb36014e10c95d3ada1dcdf4695626af90fba0a99
ipa/120006 - wrong code with IPA PTA

When PTA gets support for special-handling more builtins in
find_func_aliases the corresponding code in find_func_clobbers
needs updating as well since for unhandled cases it assumes
the former will populate ESCAPED accordingly.  The following
fixes a few omissions, the testcase runs into the missing strdup
handling.  I believe the more advanced handling using modref
results and fnspecs opened a larger gap, the proper fix is to
merge both functions, gating the clobber/use part on a parameter
to avoid diverging.

PR ipa/120006
* tree-ssa-structalias.cc (find_func_clobbers): Handle
strdup, strndup, realloc, index, strchr, strrchr, memchr,
strstr, strpbrk builtins like find_func_aliases does.

* gcc.dg/torture/pr120006.c: New testcase.

(cherry picked from commit a85b89e26b1f50997701eb428c2dd71668f216ff)
gcc/testsuite/gcc.dg/torture/pr120006.c [new file with mode: 0644]
gcc/tree-ssa-structalias.cc