aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-12-05 09:45:46 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-12-05 09:45:46 +0000
commita3408fa3fbf20455eb3b17b5c78397f9d66065c7 (patch)
treedda93429be6382ac5c36b78294568cd9e9e898be /gcc/tree-ssa-forwprop.c
parent42870a86829f9d6dd326d318a3a028fbceb88d94 (diff)
downloadgcc-a3408fa3fbf20455eb3b17b5c78397f9d66065c7.zip
gcc-a3408fa3fbf20455eb3b17b5c78397f9d66065c7.tar.gz
gcc-a3408fa3fbf20455eb3b17b5c78397f9d66065c7.tar.bz2
re PR tree-optimization/92803 (error: type mismatch in 'vec_perm_expr' since r278764)
2019-12-05 Richard Biener <rguenther@suse.de> PR tree-optimization/92803 * tree-ssa-forwprop.c (simplify_vector_constructor): Fix invariant vector construction. * gcc.target/i386/pr92803.c: New testcase. From-SVN: r278991
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r--gcc/tree-ssa-forwprop.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 4a83124..a27a4cf 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -2286,24 +2286,28 @@ simplify_vector_constructor (gimple_stmt_iterator *gsi)
else if (orig[1] == error_mark_node
&& one_nonconstant)
{
- orig[1] = gimple_build_vector_from_val (&stmts, UNKNOWN_LOCATION,
- type, one_nonconstant);
/* ??? We can see if we can safely convert to the original
element type. */
converted_orig1 = conv_code != ERROR_MARK;
+ orig[1] = gimple_build_vector_from_val (&stmts, UNKNOWN_LOCATION,
+ converted_orig1
+ ? type : perm_type,
+ one_nonconstant);
}
else if (orig[1] == error_mark_node)
{
- tree_vector_builder vec (type, nelts, 1);
- for (unsigned i = 0; i < nelts; ++i)
- if (constants[i])
+ /* ??? See if we can convert the vector to the original type. */
+ converted_orig1 = conv_code != ERROR_MARK;
+ unsigned n = converted_orig1 ? nelts : refnelts;
+ tree_vector_builder vec (converted_orig1
+ ? type : perm_type, n, 1);
+ for (unsigned i = 0; i < n; ++i)
+ if (i < nelts && constants[i])
vec.quick_push (constants[i]);
else
/* ??? Push a don't-care value. */
vec.quick_push (one_constant);
orig[1] = vec.build ();
- /* ??? See if we can convert the vector to the original type. */
- converted_orig1 = conv_code != ERROR_MARK;
}
tree blend_op2 = NULL_TREE;
if (converted_orig1)