aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@redhat.com>2002-05-06 00:09:21 -0700
committerDavid S. Miller <davem@gcc.gnu.org>2002-05-06 00:09:21 -0700
commit0ac941a0729f8c0b6685265adf8ef7365ef80dbe (patch)
tree4f4a72b628186718d6c1cc455aa63bce5349ac76
parent95ff5d3fad7df3df18c91b3c834d983c52b62423 (diff)
downloadgcc-0ac941a0729f8c0b6685265adf8ef7365ef80dbe.zip
gcc-0ac941a0729f8c0b6685265adf8ef7365ef80dbe.tar.gz
gcc-0ac941a0729f8c0b6685265adf8ef7365ef80dbe.tar.bz2
sparc.c (emit_soft_tfmode_libcall): Do not allow result to overlap input operands in memory.
2002-05-06 David S. Miller <davem@redhat.com> * config/sparc/sparc.c (emit_soft_tfmode_libcall): Do not allow result to overlap input operands in memory. From-SVN: r53204
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sparc/sparc.c22
2 files changed, 25 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 91effc8..543d1c6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2002-05-06 David S. Miller <davem@redhat.com>
+
+ * config/sparc/sparc.c (emit_soft_tfmode_libcall): Do not
+ allow result to overlap input operands in memory.
+
2002-05-06 Neil Booth <neil@daikokuya.demon.co.uk>
doc:
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index b28bcf5..cd7c983 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -2476,7 +2476,7 @@ emit_soft_tfmode_libcall (func_name, nargs, operands)
rtx *operands;
{
rtx ret_slot = NULL, arg[3], func_sym;
- int i;
+ int i, j;
/* We only expect to be called for conversions, unary, and binary ops. */
if (nargs < 2 || nargs > 3)
@@ -2491,7 +2491,25 @@ emit_soft_tfmode_libcall (func_name, nargs, operands)
if (GET_MODE (this_arg) == TFmode)
{
if (GET_CODE (this_arg) == MEM)
- this_arg = XEXP (this_arg, 0);
+ {
+ this_arg = XEXP (this_arg, 0);
+
+ /* Make sure the output is not in the same place
+ as one of our inputs. */
+ if (i == 0)
+ {
+ for (j = 1; j < nargs; j++)
+ if (rtx_equal_p (operands[0], operands[j]))
+ break;
+
+ if (j != nargs)
+ {
+ ret_slot = assign_stack_temp (TFmode,
+ GET_MODE_SIZE (TFmode), 0);
+ this_arg = XEXP (ret_slot, 0);
+ }
+ }
+ }
else if (CONSTANT_P (this_arg))
{
this_slot = force_const_mem (TFmode, this_arg);