diff options
author | Uros Bizjak <uros@gcc.gnu.org> | 2007-06-06 14:12:32 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2007-06-06 14:12:32 +0200 |
commit | 9f106823dcb9c4a463c50c912695f66325fb9a46 (patch) | |
tree | de9849634b1b7fa1d9a2c6099d590044f0aa8c3a /gcc/tree-vectorizer.c | |
parent | ec11296fef7a643fef5d78edcf101b46622e64d7 (diff) | |
download | gcc-9f106823dcb9c4a463c50c912695f66325fb9a46.zip gcc-9f106823dcb9c4a463c50c912695f66325fb9a46.tar.gz gcc-9f106823dcb9c4a463c50c912695f66325fb9a46.tar.bz2 |
re PR tree-optimization/32216 (ICE: verify_stmts failed (invalid reference prefix) with -ftree-vectorize)
PR tree-optimization/32216
* tree-vectorizer.c (supportable_widening_operation): Determine
signedness of FIX_TRUNC_EXPR from output operand.
(supportable_narrowing_operation): Ditto.
* tree-vect-generic.c (expand_vector_operations_1): Determine
signedness of VEC_UNPACK_FLOAT_HI_EXPR and VEC_UNPACK_FLOAT_LO_EXPR
from input operand.
testsuite/ChangeLog:
PR tree-optimization/32216
* gcc.dg/vect/pr32216.c: New test.
From-SVN: r125482
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r-- | gcc/tree-vectorizer.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index be2d6b3..8dba4d0 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -1851,10 +1851,17 @@ supportable_widening_operation (enum tree_code code, tree stmt, tree vectype, gcc_unreachable (); } - *code1 = c1; - *code2 = c2; - optab1 = optab_for_tree_code (c1, vectype); - optab2 = optab_for_tree_code (c2, vectype); + if (code == FIX_TRUNC_EXPR) + { + /* The signedness is determined from output operand. */ + optab1 = optab_for_tree_code (c1, type); + optab2 = optab_for_tree_code (c2, type); + } + else + { + optab1 = optab_for_tree_code (c1, vectype); + optab2 = optab_for_tree_code (c2, vectype); + } if (!optab1 || !optab2) return false; @@ -1867,6 +1874,8 @@ supportable_widening_operation (enum tree_code code, tree stmt, tree vectype, || insn_data[icode2].operand[0].mode != TYPE_MODE (wide_vectype)) return false; + *code1 = c1; + *code2 = c2; return true; } @@ -1918,8 +1927,11 @@ supportable_narrowing_operation (enum tree_code code, gcc_unreachable (); } - *code1 = c1; - optab1 = optab_for_tree_code (c1, vectype); + if (code == FIX_TRUNC_EXPR) + /* The signedness is determined from output operand. */ + optab1 = optab_for_tree_code (c1, type); + else + optab1 = optab_for_tree_code (c1, vectype); if (!optab1) return false; @@ -1929,6 +1941,7 @@ supportable_narrowing_operation (enum tree_code code, || insn_data[icode1].operand[0].mode != TYPE_MODE (narrow_vectype)) return false; + *code1 = c1; return true; } |