summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-address.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-04 14:29:13 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-04 14:29:13 +0000
commit61c059fcd4ddcc849aae31efce0f1a4866c0d04b (patch)
tree807ab884f6921d74cf6697b2fbd57ce212645768 /gcc/tree-ssa-address.c
parent8289bfc6ebd28a7c9ba0ded84bf9103b590a9597 (diff)
downloadgcc-61c059fcd4ddcc849aae31efce0f1a4866c0d04b.tar.gz
2011-06-04 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 174636 using svnmerge git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@174639 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-address.c')
-rw-r--r--gcc/tree-ssa-address.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index 2e6eabc8ccb..e3934e15506 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -1,5 +1,5 @@
/* Memory address lowering and addressing mode selection.
- Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -129,7 +129,7 @@ gen_addr_rtx (enum machine_mode address_mode,
*addr = act_elem;
}
- if (base)
+ if (base && base != const0_rtx)
{
if (*addr)
*addr = simplify_gen_binary (PLUS, address_mode, base, *addr);
@@ -365,7 +365,7 @@ create_mem_ref_raw (tree type, tree alias_ptr_type, struct mem_address *addr,
??? As IVOPTs does not follow restrictions to where the base
pointer may point to create a MEM_REF only if we know that
base is valid. */
- if (TREE_CODE (base) == ADDR_EXPR
+ if ((TREE_CODE (base) == ADDR_EXPR || TREE_CODE (base) == INTEGER_CST)
&& (!index2 || integer_zerop (index2))
&& (!addr->index || integer_zerop (addr->index)))
return fold_build2 (MEM_REF, type, base, addr->offset);