]> git.ipfire.org Git - thirdparty/gcc.git/commit
[gimplefe] fix SSA operand creation
authorRichard Biener <rguenther@suse.de>
Wed, 17 Sep 2025 08:22:26 +0000 (10:22 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 17 Sep 2025 13:36:44 +0000 (15:36 +0200)
commitf8cf09130b75ea8e310debbc0a165f5906ee56d6
tree20bb57a95e4f5db97c05adbda564475ecdc001a3
parent282c1e682e04507a087392260c77e78a71ec2600
[gimplefe] fix SSA operand creation

When transitioning gcc.dg/torture/pr84830.c to a GIMPLE testcase to
feed the IL into PRE that caused the original issue (and verify it's
still there with the fix reverted), I noticed we put up SSA operands
before having fully parsed the function and thus with not all
variables having the final TREE_ADDRESSABLE state.  The following
fixes this, delaying update_stmt calls to when we create PHI nodes.
It also makes the pr84830.c not rely on the particular fake exit
edge source location by making the loop have an exit.

gcc/c/
* gimple-parser.cc (c_parser_parse_gimple_body): Initialize
SSA operands for each stmt.
(c_parser_gimple_compound_statement): Append stmts without
updating SSA operands.

gcc/testsuite/
* gcc.dg/torture/pr84830.c: Turn into GIMPLE unit test for PRE.
gcc/c/gimple-parser.cc
gcc/testsuite/gcc.dg/torture/pr84830.c