Files
gcc-reflection/gcc/tree-ssa-pre.cc
Richard Biener 7a8c00dea5 tree-optimization/123298 - fix backedge detection for VN alias walk
When trying to skip a virtual PHI during an alias walk we have to
direct a possible VN translation hook to not use valueization when
walking a backedge.  But this backedge detection was overly
optimistic, not honoring irreducible regions.  The following hookizes
the backedge detection so VN can properly flag edges that are back
with respect to its particular CFG traversal.

	PR tree-optimization/123298
	* tree-ssa-alias.h (get_continuation_for_phi): Take a gphi *,
	add is_backedge hook argument.
	(walk_non_aliased_vuses): Add is_backedge hook argument.
	* tree-ssa-alias.cc (maybe_skip_until): Adjust.
	(get_continuation_for_phi): Use new hook to classify an
	edge into the PHI as backedge.
	(walk_non_aliased_vuses): Adjust.
	* gimple-lower-bitint.cc (bitint_dom_walker::before_dom_children):
	Likewise.
	* ipa-prop.cc (determine_known_aggregate_parts): Likewise.
	* tree-ssa-scopedtables.cc (avail_exprs_stack::lookup_avail_expr):
	Likewise.
	* tree-ssa-pre.cc (translate_vuse_through_block): Likewise.
	* tree-ssa-sccvn.cc (vn_bb_to_rpo): Make BB to RPO order
	mapping accessible from new hook.
	(do_rpo_vn_1): Likewise.
	(vn_is_backedge): New hook to classify edge.
	(vn_reference_lookup_pieces): Adjust.
	(vn_reference_lookup): Likewise.

	* gcc.dg/torture/pr123298.c: New testcase.
2026-01-08 12:42:54 +01:00

137 KiB