Skip to content
Snippets Groups Projects
Commit ea1deefe authored by Richard Biener's avatar Richard Biener Committed by Richard Biener
Browse files

tree-optimization/115494 - PRE PHI translation and ranges


When we PHI translate dependent expressions we keep SSA defs in
place of the translated expression in case the expression itself
did not change even though it's context did and thus the validity
of ranges associated with it.  That eventually leads to simplification
errors given we violate the precondition that used SSA defs fed to
vn_valueize are valid to use (including their associated ranges).
The following makes sure to replace those with new representatives
always, not only when the dependent expression translation changed it.

The fix was originally discovered by Michael Morin.

	PR tree-optimization/115494
	* tree-ssa-pre.cc (phi_translate_1): Always generate a
	representative for translated dependent expressions.

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

Co-Authored-By: default avatarMikael Morin <mikael@gcc.gnu.org>
parent 7f5adfd3
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment