aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-address.c
diff options
context:
space:
mode:
authorZdenek Dvorak <rakdver@gcc.gnu.org>2007-03-04 16:23:31 +0000
committerZdenek Dvorak <rakdver@gcc.gnu.org>2007-03-04 16:23:31 +0000
commit69bd3423f6e99d77e58a973978b8573a80705f7f (patch)
treeef85c1f9a81e50a21250d23bbebb2cfb228be0f9 /gcc/tree-ssa-address.c
parent232044287b23ecd04a6e7e6964bf4030f673b7b6 (diff)
downloadgcc-69bd3423f6e99d77e58a973978b8573a80705f7f.zip
gcc-69bd3423f6e99d77e58a973978b8573a80705f7f.tar.gz
gcc-69bd3423f6e99d77e58a973978b8573a80705f7f.tar.bz2
tree-ssa-address.c (create_mem_ref): Do not put an expression containing a cast to the base of TARGET_MEM_REF.
* tree-ssa-address.c (create_mem_ref): Do not put an expression containing a cast to the base of TARGET_MEM_REF. From-SVN: r122528
Diffstat (limited to 'gcc/tree-ssa-address.c')
-rw-r--r--gcc/tree-ssa-address.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index ef3bfb7..44a08b9 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -569,7 +569,7 @@ tree
create_mem_ref (block_stmt_iterator *bsi, tree type, aff_tree *addr)
{
tree mem_ref, tmp;
- tree addr_type = build_pointer_type (type), atype;
+ tree atype;
struct mem_address parts;
addr_to_parts (addr, &parts);
@@ -597,18 +597,23 @@ create_mem_ref (block_stmt_iterator *bsi, tree type, aff_tree *addr)
if (parts.symbol)
{
- tmp = fold_convert (addr_type,
- build_addr (parts.symbol, current_function_decl));
+ tmp = build_addr (parts.symbol, current_function_decl);
+ gcc_assert (is_gimple_val (tmp));
/* Add the symbol to base, eventually forcing it to register. */
if (parts.base)
{
+ gcc_assert (TREE_TYPE (parts.base) == sizetype);
+
if (parts.index)
- parts.base = force_gimple_operand_bsi (bsi,
- fold_build2 (PLUS_EXPR, addr_type,
- fold_convert (addr_type, parts.base),
+ {
+ atype = TREE_TYPE (tmp);
+ parts.base = force_gimple_operand_bsi (bsi,
+ fold_build2 (PLUS_EXPR, atype,
+ fold_convert (atype, parts.base),
tmp),
true, NULL_TREE);
+ }
else
{
parts.index = parts.base;