From 39278c14cc716a115fcf1bc0859af436094fdd3c Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Tue, 20 Sep 2005 07:53:11 +0000 Subject: [PATCH] tree-ssa-address.c (create_mem_ref): Put the symbol reference into the base register if possible. 2005-09-20 Andreas Krebbel * tree-ssa-address.c (create_mem_ref): Put the symbol reference into the base register if possible. From-SVN: r104446 --- gcc/ChangeLog | 5 +++++ gcc/tree-ssa-address.c | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 802e7a631df..6a32805489b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-09-20 Andreas Krebbel + + * tree-ssa-address.c (create_mem_ref): Put the symbol reference into the + base register if possible. + 2005-09-20 Zdenek Dvorak PR tree-optimization/18463 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;