OSDN Git Service

2006-01-18 Richard Henderson <rth@redhat.com>
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-address.c
index 67bbc4a..9dbc399 100644 (file)
@@ -15,8 +15,8 @@ for more details.
    
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  */
 
 /* Utility functions for manipulation with TARGET_MEM_REFs -- tree expressions
    that directly map to addressing modes of the target.  */
@@ -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;