diff options
author | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-04 16:23:31 +0000 |
---|---|---|
committer | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-04 16:23:31 +0000 |
commit | 5e22b9e09488c5090fe85da4769769e7c7f15623 (patch) | |
tree | ef85c1f9a81e50a21250d23bbebb2cfb228be0f9 | |
parent | 21e9153c1c3928377562aa7c68fc4f5a12da35b9 (diff) | |
download | ppe42-gcc-5e22b9e09488c5090fe85da4769769e7c7f15623.tar.gz ppe42-gcc-5e22b9e09488c5090fe85da4769769e7c7f15623.zip |
* tree-ssa-address.c (create_mem_ref): Do not put an expression
containing a cast to the base of TARGET_MEM_REF.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122528 138bc75d-0d04-0410-961f-82ee72b054a4
-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 05ef84b449b..6b5605ec64a 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 ef3bfb7cbfb..44a08b9a8b0 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; |