re PR ipa/88936 (-fipa-pta breaks bash (incorrect optimisation of recursive static...
authorRichard Biener <rguenther@suse.de>
Mon, 15 Apr 2019 10:09:08 +0000 (10:09 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 15 Apr 2019 10:09:08 +0000 (10:09 +0000)
commit869032b176d57ca8c8864a7818394106ca665d06
tree091ea0a9c663a03956c774a6a3a164628d4e9f04
parent79a18702006d53bc378affcd5dd6c8df7883b58f
re PR ipa/88936 (-fipa-pta breaks bash (incorrect optimisation of recursive static function))

2019-04-15  Richard Biener  <rguenther@suse.de>

PR ipa/88936
* tree.h (auto_var_p): Declare.
* tree.c (auto_var_p): New function, split out from ...
(auto_var_in_fn_p): ... here.
* tree-ssa-structalias.c (struct variable_info): Add shadow_var_uid
member.
(new_var_info): Initialize it.
(set_uids_in_ptset): Also set the shadow variable uid if required.
(ipa_pta_execute): Postprocess points-to solutions assigning
shadow variable uids for locals that may reach their containing
function recursively.
* tree-ssa-ccp.c (fold_builtin_alloca_with_align): Do not
assert but instead check whether the points-to solution is
a singleton.

* gcc.dg/torture/pr88936-1.c: New testcase.
* gcc.dg/torture/pr88936-2.c: Likewise.
* gcc.dg/torture/pr88936-3.c: Likewise.

From-SVN: r270366
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr88936-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr88936-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr88936-3.c [new file with mode: 0644]
gcc/tree-ssa-ccp.c
gcc/tree-ssa-structalias.c
gcc/tree.c
gcc/tree.h