diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2004-09-26 19:13:38 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2004-09-26 19:13:38 +0000 |
commit | 931e6c29a71dfc9923a9a106c112ddfb1bc66112 (patch) | |
tree | 21b084b994ebe3cbc6197ae46e37bbcce7b16519 /gcc/builtins.c | |
parent | 3bd2680ed5ffc1442ece7ea37ea0439b8358ac6d (diff) | |
download | gcc-931e6c29a71dfc9923a9a106c112ddfb1bc66112.zip gcc-931e6c29a71dfc9923a9a106c112ddfb1bc66112.tar.gz gcc-931e6c29a71dfc9923a9a106c112ddfb1bc66112.tar.bz2 |
builtins.c (get_memory_rtx): Set mem attributes for non-ADDR_EXPR expressions.
* builtins.c (get_memory_rtx): Set mem attributes for non-ADDR_EXPR
expressions. Always clear MEM_SIZE and alias set.
From-SVN: r88141
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index f3ee9e9..9127f45 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; |