From a2780ddb46556eac870f843df4dca394a48844bb Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Tue, 19 May 2015 14:51:47 +0000 Subject: [PATCH] optabs: Fix vec_perm -> V16QI middle end lowering. The current implementation re-uses the location of the selection pattern to generate a new one. This fails if the pattern resides in a read-only location. gcc/ * optabs.c (expand_vec_perm): Don't re-use SEL as target operand. From-SVN: r223369 --- gcc/ChangeLog | 4 ++++ gcc/optabs.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8ae08e6dc70..e261bc0f2fc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2015-05-19 Andreas Krebbel + + * optabs.c (expand_vec_perm): Don't re-use SEL as target operand. + 2015-05-19 Andreas Krebbel * config/s390/s390.c (s390_secondary_reload): Fix check for diff --git a/gcc/optabs.c b/gcc/optabs.c index d883b000f04..5fa9eecb55f 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -6777,11 +6777,11 @@ expand_vec_perm (machine_mode mode, rtx v0, rtx v1, rtx sel, rtx target) machine_mode selmode = GET_MODE (sel); if (u == 2) sel = expand_simple_binop (selmode, PLUS, sel, sel, - sel, 0, OPTAB_DIRECT); + NULL, 0, OPTAB_DIRECT); else sel = expand_simple_binop (selmode, ASHIFT, sel, GEN_INT (exact_log2 (u)), - sel, 0, OPTAB_DIRECT); + NULL, 0, OPTAB_DIRECT); gcc_assert (sel != NULL); /* Broadcast the low byte each element into each of its bytes. */ -- 2.30.2