diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2001-11-03 15:33:45 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2001-11-03 10:33:45 -0500 |
commit | 343fb4120866d610c7e233f19dfcf2b3322774ca (patch) | |
tree | a54d651a7abdfb3792acc32dcad3d2b1c8a9b462 /gcc/builtins.c | |
parent | 13ba36b478bfdfe2881bdc4a83c2caf2fd26fbd2 (diff) | |
download | gcc-343fb4120866d610c7e233f19dfcf2b3322774ca.zip gcc-343fb4120866d610c7e233f19dfcf2b3322774ca.tar.gz gcc-343fb4120866d610c7e233f19dfcf2b3322774ca.tar.bz2 |
builtins.c (get_memory_rtx): Properly set MEM alias set and attributes.
* builtins.c (get_memory_rtx): Properly set MEM alias set and
attributes.
From-SVN: r46732
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index d1eeda9..ca7eb66 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -731,7 +731,6 @@ get_memory_rtx (exp) #endif mem = gen_rtx_MEM (BLKmode, memory_address (BLKmode, addr)); - set_mem_attributes (mem, exp, 0); /* Get an expression we can use to find the attributes to assign to MEM. If it is an ADDR_EXPR, use the operand. Otherwise, dereference it if @@ -742,14 +741,17 @@ get_memory_rtx (exp) exp = TREE_OPERAND (exp, 0); if (TREE_CODE (exp) == ADDR_EXPR) - exp = TREE_OPERAND (exp, 0); + { + exp = TREE_OPERAND (exp, 0); + set_mem_attributes (mem, exp, 0); + } else if (POINTER_TYPE_P (TREE_TYPE (exp))) - exp = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (exp)), exp); - else - return mem; + { + exp = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (exp)), exp); + /* memcpy, memset and other builtin stringops can alias with anything. */ + set_mem_alias_set (mem, 0); + } - /* memcpy, memset and other builtin stringops can alias with anything. */ - set_mem_alias_set (mem, 0); return mem; } |