aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-09-04 14:10:11 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-09-04 14:10:11 +0000
commit11a82e2597c54016345beb99e5339e37851c7d59 (patch)
tree80cc35078ff2a50b99bcac103fa940b55569c370 /gcc/tree-vect-stmts.c
parentbc7fe95200214ce70419fde6f965dc88bbd645a6 (diff)
downloadgcc-11a82e2597c54016345beb99e5339e37851c7d59.zip
gcc-11a82e2597c54016345beb99e5339e37851c7d59.tar.gz
gcc-11a82e2597c54016345beb99e5339e37851c7d59.tar.bz2
re PR c++/82084 (ICE: constructing wstring with -O3)
2017-09-04 Richard Biener <rguenther@suse.de> PR tree-optimization/82084 * fold-const.h (can_native_encode_string_p): Declare. * fold-const.c (can_native_encode_string_p): Factor out from ... (native_encode_string): ... here. * tree-vect-stmts.c (vectorizable_store): Call it to avoid vectorizing stores from constants we later cannot handle. * g++.dg/torture/pr82084.C: New testcase. From-SVN: r251661
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index c9a0aaf..ce43893 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -5733,6 +5733,12 @@ vectorizable_store (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
op = gimple_assign_rhs1 (stmt);
+ /* In the case this is a store from a STRING_CST make sure
+ native_encode_expr can handle it. */
+ if (TREE_CODE (op) == STRING_CST
+ && ! can_native_encode_string_p (op))
+ return false;
+
if (!vect_is_simple_use (op, vinfo, &def_stmt, &dt, &rhs_vectype))
{
if (dump_enabled_p ())