From: Andreas Krebbel Date: Tue, 19 May 2015 14:51:47 +0000 (+0000) Subject: optabs: Fix vec_perm -> V16QI middle end lowering. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a2780ddb46556eac870f843df4dca394a48844bb;p=gcc.git 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 --- 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. */