aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@redhat.com>2001-08-05 17:05:10 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2001-08-05 17:05:10 +0000
commit8125d7e9ad4f1525e0e703f7610fd47cc628f047 (patch)
treebb340b0895f4f2a6f1adb87e029956c5ce1e9a29
parentacb0638db53d981829ee85e654ea8419acf8078b (diff)
downloadgcc-8125d7e9ad4f1525e0e703f7610fd47cc628f047.zip
gcc-8125d7e9ad4f1525e0e703f7610fd47cc628f047.tar.gz
gcc-8125d7e9ad4f1525e0e703f7610fd47cc628f047.tar.bz2
Prefer a temporary register over directly storing into memory.
From-SVN: r44649
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/expr.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c130289..5679160 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -20,6 +20,9 @@
* config/ia64/ia64.md (cond_opsi2_internal and splitters): New
patterns.
+ * expr.c (expand_expr, case COND_EXPR): Prefer working with a
+ temporary register than directly using a MEM.
+
2001-08-04 Hans-Peter Nilsson <hp@bitrange.com>
* config/sh/sh.c (sh_asm_named_section): Fix typo in align
diff --git a/gcc/expr.c b/gcc/expr.c
index 80f73f8..de39969 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8211,8 +8211,8 @@ expand_expr (exp, target, tmode, modifier)
|| GET_CODE (original_target) == REG
|| TREE_ADDRESSABLE (type))
#endif
- && ! (GET_CODE (original_target) == MEM
- && MEM_VOLATILE_P (original_target)))
+ && (GET_CODE (original_target) != MEM
+ || TREE_ADDRESSABLE (type)))
temp = original_target;
else if (TREE_ADDRESSABLE (type))
abort ();