aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2011-12-10 12:43:03 -0800
committerRichard Henderson <rth@gcc.gnu.org>2011-12-10 12:43:03 -0800
commitccdfb0e2c6ad7c93ca7657a79a773f0af8f40be7 (patch)
tree64952c5ea5b975ebfc52549bce82d112fa6ee2eb /gcc/optabs.c
parenta7de2c2a71940a25408c1320498c1c1ca2472313 (diff)
downloadgcc-ccdfb0e2c6ad7c93ca7657a79a773f0af8f40be7.zip
gcc-ccdfb0e2c6ad7c93ca7657a79a773f0af8f40be7.tar.gz
gcc-ccdfb0e2c6ad7c93ca7657a79a773f0af8f40be7.tar.bz2
Force the creation of a CONST_VECTOR for expand_vec_perm.
* expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Avoid passing a CONST_INT to expand_vec_perm as the selector. * optabs.c (expand_vec_perm): Assert the selector is of a proper mode. From-SVN: r182192
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 3f50177..2c3a640 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -7038,7 +7038,8 @@ expand_vec_perm (enum machine_mode mode, rtx v0, rtx v1, rtx sel, rtx target)
}
/* If the input is a constant, expand it specially. */
- if (CONSTANT_P (sel))
+ gcc_assert (GET_MODE_CLASS (GET_MODE (sel)) == MODE_VECTOR_INT);
+ if (GET_CODE (sel) == CONST_VECTOR)
{
icode = direct_optab_handler (vec_perm_const_optab, mode);
if (icode != CODE_FOR_nothing)
@@ -7056,7 +7057,7 @@ expand_vec_perm (enum machine_mode mode, rtx v0, rtx v1, rtx sel, rtx target)
{
unsigned int j, this_e;
- this_e = INTVAL (XVECEXP (sel, 0, i));
+ this_e = INTVAL (CONST_VECTOR_ELT (sel, i));
this_e &= 2 * e - 1;
this_e *= u;