diff options
author | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2007-03-04 16:23:31 +0000 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2007-03-04 16:23:31 +0000 |
commit | 69bd3423f6e99d77e58a973978b8573a80705f7f (patch) | |
tree | ef85c1f9a81e50a21250d23bbebb2cfb228be0f9 /gcc | |
parent | 232044287b23ecd04a6e7e6964bf4030f673b7b6 (diff) | |
download | gcc-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')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/tree-ssa-address.c | 17 |
2 files changed, 17 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 05ef84b..6b5605e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-03-04 Zdenek Dvorak <dvorakz@suse.cz> + + * tree-ssa-address.c (create_mem_ref): Do not put an expression + containing a cast to the base of TARGET_MEM_REF. + 2007-03-04 Martin Michlmayr <tbm@cyrius.com> * tree.c (tree_contains_struct_check_failed): Remove spurious @@ -10,7 +15,7 @@ instead of precision. 2007-03-04 Roman Zippel <zippel@linux-m68k.org> - Nathan Sidwell <nathan@codesourcery.com> + Nathan Sidwell <nathan@codesourcery.com> * emit-rtl.c (find_auto_inc): New. (try_split): recreate REG_INC notes, 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; |