summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-address.c
diff options
context:
space:
mode:
authorkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-20 07:53:11 +0000
committerkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-20 07:53:11 +0000
commit7fce04b04726bc59436a23b7318e9dcc84d18bcc (patch)
treea76a489dfb0347bf6e38e798948a761b3e4d8f23 /gcc/tree-ssa-address.c
parent7393ff3867abf5c623a95bc0a052630102ff004e (diff)
downloadgcc-7fce04b04726bc59436a23b7318e9dcc84d18bcc.tar.gz
2005-09-20 Andreas Krebbel <krebbel1@de.ibm.com>
* tree-ssa-address.c (create_mem_ref): Put the symbol reference into the base register if possible. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104446 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-address.c')
-rw-r--r--gcc/tree-ssa-address.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index 416904b05a2..9dbc399d2cd 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -525,10 +525,18 @@ create_mem_ref (block_stmt_iterator *bsi, tree type,
/* Add the symbol to base, eventually forcing it to register. */
if (parts.base)
- parts.base = force_gimple_operand_bsi (bsi,
- build2 (PLUS_EXPR, addr_type,
- parts.base, tmp),
- true, NULL_TREE);
+ {
+ if (parts.index)
+ parts.base = force_gimple_operand_bsi (bsi,
+ build2 (PLUS_EXPR, addr_type,
+ parts.base, tmp),
+ true, NULL_TREE);
+ else
+ {
+ parts.index = parts.base;
+ parts.base = tmp;
+ }
+ }
else
parts.base = tmp;
parts.symbol = NULL_TREE;