]> 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>
Wed, 30 Apr 2025 12:15:38 +0000 (14:15 +0200)
commita85b89e26b1f50997701eb428c2dd71668f216ff
tree4f37b51ecbd8042618014f0fe967f53983ba205a
parent1a13684dfc7286139064f7d7341462c9995cbd1c
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.
gcc/testsuite/gcc.dg/torture/pr120006.c [new file with mode: 0644]
gcc/tree-ssa-structalias.cc