diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-02-16 16:16:48 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-02-16 16:16:48 +0100 |
commit | 2a2b8f64889632aed99c358fbfddb10ab8774242 (patch) | |
tree | 81ba9a735fe10da57d5391dad67dbe86cf870450 /gcc/tree-vect-patterns.c | |
parent | 5aa7d94c2e02552095cd56bd36ca19db4cb58c9a (diff) | |
download | gcc-2a2b8f64889632aed99c358fbfddb10ab8774242.zip gcc-2a2b8f64889632aed99c358fbfddb10ab8774242.tar.gz gcc-2a2b8f64889632aed99c358fbfddb10ab8774242.tar.bz2 |
re PR tree-optimization/69820 (Test miscompiled with -O3 option)
PR tree-optimization/69820
* tree-vect-patterns.c (type_conversion_p): Return false if
*orig_type is unsigned single precision or boolean.
(vect_recog_dot_prod_pattern, vect_recog_widen_mult_pattern):
Formatting fix.
* gcc.dg/vect/pr69820.c: New test.
Co-Authored-By: Richard Biener <rguenther@suse.de>
From-SVN: r233457
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r-- | gcc/tree-vect-patterns.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 712b34c..95ce38d 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -171,6 +171,13 @@ type_conversion_p (tree name, gimple *use_stmt, bool check_sign, if (!*def_stmt) return false; + if (dt == vect_internal_def) + { + stmt_vec_info def_vinfo = vinfo_for_stmt (*def_stmt); + if (STMT_VINFO_IN_PATTERN_P (def_vinfo)) + return false; + } + if (!is_gimple_assign (*def_stmt)) return false; @@ -334,8 +341,8 @@ vect_recog_dot_prod_pattern (vec<gimple *> *stmts, tree *type_in, stmt = last_stmt; if (type_conversion_p (oprnd0, stmt, true, &half_type, &def_stmt, - &promotion) - && promotion) + &promotion) + && promotion) { stmt = def_stmt; oprnd0 = gimple_assign_rhs1 (stmt); @@ -395,13 +402,13 @@ vect_recog_dot_prod_pattern (vec<gimple *> *stmts, tree *type_in, || !types_compatible_p (TREE_TYPE (oprnd1), prod_type)) return NULL; if (!type_conversion_p (oprnd0, stmt, true, &half_type0, &def_stmt, - &promotion) - || !promotion) + &promotion) + || !promotion) return NULL; oprnd00 = gimple_assign_rhs1 (def_stmt); if (!type_conversion_p (oprnd1, stmt, true, &half_type1, &def_stmt, - &promotion) - || !promotion) + &promotion) + || !promotion) return NULL; oprnd01 = gimple_assign_rhs1 (def_stmt); if (!types_compatible_p (half_type0, half_type1)) @@ -891,10 +898,10 @@ vect_recog_widen_mult_pattern (vec<gimple *> *stmts, oprnd = &oprnd1; } - tree old_oprnd = gimple_assign_rhs1 (def_stmt); - tree new_oprnd = make_ssa_name (half_type0); - new_stmt = gimple_build_assign (new_oprnd, NOP_EXPR, old_oprnd); - *oprnd = new_oprnd; + tree old_oprnd = gimple_assign_rhs1 (def_stmt); + tree new_oprnd = make_ssa_name (half_type0); + new_stmt = gimple_build_assign (new_oprnd, NOP_EXPR, old_oprnd); + *oprnd = new_oprnd; } /* Handle unsigned case. Look for |