aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl@gcc.gnu.org>2007-04-16 06:49:14 -0700
committerH.J. Lu <hjl@gcc.gnu.org>2007-04-16 06:49:14 -0700
commit7bb4a6be35f5c0da036869a1c416d7aeeada96cf (patch)
treec61c6d9c04c18c120e021f4959d31d39551ca614
parent9c3068be677f1d7c596453034fb68656b21091e7 (diff)
downloadgcc-7bb4a6be35f5c0da036869a1c416d7aeeada96cf.zip
gcc-7bb4a6be35f5c0da036869a1c416d7aeeada96cf.tar.gz
gcc-7bb4a6be35f5c0da036869a1c416d7aeeada96cf.tar.bz2
re PR target/31582 (ix86_expand_vec_set_builtin modifies source)
2007-04-16 H.J. Lu <hongjiu.lu@intel.com> PR target/31582 * config/i386/i386.c (ix86_expand_vec_set_builtin): Make a copy of source, pass it to ix86_expand_vector_set and return it as target. From-SVN: r123866
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/i386/i386.c10
2 files changed, 15 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d256001..401d2a5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
+2007-04-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/31582
+ * config/i386/i386.c (ix86_expand_vec_set_builtin): Make a
+ copy of source, pass it to ix86_expand_vector_set and return
+ it as target.
+
2007-04-16 David Ung <davidu@mips.com>
- Joseph Myers <joseph@codesourcery.com>
+ Joseph Myers <joseph@codesourcery.com>
* config/mips/mips.h (PROCESSOR_74KC, PROCESSOR_74KF,
PROCESSOR_74KX, TUNE_74K, GENERATE_MADD_MSUB): Define.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 9f4ed75..ecc2e6b 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -17902,7 +17902,7 @@ ix86_expand_vec_set_builtin (tree exp)
enum machine_mode tmode, mode1;
tree arg0, arg1, arg2;
int elt;
- rtx op0, op1;
+ rtx op0, op1, target;
arg0 = CALL_EXPR_ARG (exp, 0);
arg1 = CALL_EXPR_ARG (exp, 1);
@@ -17922,9 +17922,13 @@ ix86_expand_vec_set_builtin (tree exp)
op0 = force_reg (tmode, op0);
op1 = force_reg (mode1, op1);
- ix86_expand_vector_set (true, op0, op1, elt);
+ /* OP0 is the source of these builtin functions and shouldn't be
+ modifified. Create a copy, use it and return it as target. */
+ target = gen_reg_rtx (tmode);
+ emit_move_insn (target, op0);
+ ix86_expand_vector_set (true, target, op1, elt);
- return op0;
+ return target;
}
/* Expand an expression EXP that calls a built-in function,