aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop-manip.c
diff options
context:
space:
mode:
authorRichard Biener <rguenth@gcc.gnu.org>2018-11-05 14:55:53 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-11-05 14:55:53 +0000
commit733441e2e1d207a1ab0a4a255dea03ee7c6c8774 (patch)
tree62bd882842e65e9ca1e9b1bfc1b94458f8753104 /gcc/tree-vect-loop-manip.c
parent546f678c5cc27adf9ca02cbcc578b2ddaffc0d81 (diff)
downloadgcc-733441e2e1d207a1ab0a4a255dea03ee7c6c8774.zip
gcc-733441e2e1d207a1ab0a4a255dea03ee7c6c8774.tar.gz
gcc-733441e2e1d207a1ab0a4a255dea03ee7c6c8774.tar.bz2
re PR tree-optimization/87873 (ICE: verify_gimple failed (error: incompatible types in PHI argument 0))
2018-11-05 Richard Biener <rguenther@suse.de> PR tree-optimization/87873 * tree-ssa-loop-manip.h (split_loop_exit_edge): Add copy_constants_p argument. * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise. * tree-vect-loop.c (vect_transform_loop): When splitting the loop exit also create forwarder PHIs for constants. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): Handle constant to_arg, add extra checking we match up the correct PHIs. * gcc.dg/pr87873.c: New testcase. From-SVN: r265812
Diffstat (limited to 'gcc/tree-vect-loop-manip.c')
-rw-r--r--gcc/tree-vect-loop-manip.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index 1d1d114..f1b023b 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -977,10 +977,15 @@ slpeel_duplicate_current_defs_from_edges (edge from, edge to)
}
if (TREE_CODE (from_arg) != SSA_NAME)
gcc_assert (operand_equal_p (from_arg, to_arg, 0));
- else
+ else if (TREE_CODE (to_arg) == SSA_NAME)
{
if (get_current_def (to_arg) == NULL_TREE)
- set_current_def (to_arg, get_current_def (from_arg));
+ {
+ gcc_assert (types_compatible_p (TREE_TYPE (to_arg),
+ TREE_TYPE (get_current_def
+ (from_arg))));
+ set_current_def (to_arg, get_current_def (from_arg));
+ }
}
gsi_next (&gsi_from);
gsi_next (&gsi_to);