summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-26 19:13:38 +0000
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-26 19:13:38 +0000
commita1a25d19ee3a474f26828f018129d687f298158c (patch)
tree21b084b994ebe3cbc6197ae46e37bbcce7b16519
parent1ee857038e917c418c4e4bf101d6f7abe6eb2263 (diff)
downloadppe42-gcc-a1a25d19ee3a474f26828f018129d687f298158c.tar.gz
ppe42-gcc-a1a25d19ee3a474f26828f018129d687f298158c.zip
* builtins.c (get_memory_rtx): Set mem attributes for non-ADDR_EXPR
expressions. Always clear MEM_SIZE and alias set. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88141 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/builtins.c17
2 files changed, 16 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 75ba5a7163f..718e13116ff 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-26 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * builtins.c (get_memory_rtx): Set mem attributes for non-ADDR_EXPR
+ expressions. Always clear MEM_SIZE and alias set.
+
2004-09-26 Roger Sayle <roger@eyesopen.com>
Giovanni Bajo <giovannibajo@gcc.gnu.org>
diff --git a/gcc/builtins.c b/gcc/builtins.c
index f3ee9e9b348..9127f45b6aa 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -990,15 +990,20 @@ get_memory_rtx (tree exp)
exp = TREE_OPERAND (exp, 0);
if (TREE_CODE (exp) == ADDR_EXPR)
- {
- exp = TREE_OPERAND (exp, 0);
- set_mem_attributes (mem, exp, 0);
- }
+ exp = TREE_OPERAND (exp, 0);
else if (POINTER_TYPE_P (TREE_TYPE (exp)))
+ exp = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (exp)), exp);
+ else
+ exp = NULL;
+
+ /* Honor attributes derived from exp, except for the alias set
+ (as builtin stringops may alias with anything) and the size
+ (as stringops may access multiple array elements). */
+ if (exp)
{
- exp = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (exp)), exp);
- /* memcpy, memset and other builtin stringops can alias with anything. */
+ set_mem_attributes (mem, exp, 0);
set_mem_alias_set (mem, 0);
+ set_mem_size (mem, NULL_RTX);
}
return mem;
OpenPOWER on IntegriCloud