]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-address.c (create_mem_ref): Put the symbol reference into the base register...
authorAndreas Krebbel <krebbel1@de.ibm.com>
Tue, 20 Sep 2005 07:53:11 +0000 (07:53 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Tue, 20 Sep 2005 07:53:11 +0000 (07:53 +0000)
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.

From-SVN: r104446

gcc/ChangeLog
gcc/tree-ssa-address.c

index 802e7a631df6d87aa4f47711b9d52e332ed80953..6a32805489bb0251baf60a0d022130aae1f496b8 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2005-09-20  Zdenek Dvorak  <dvorakz@suse.cz>
 
        PR tree-optimization/18463
index 416904b05a29fdf9c0b9fa24df1cc8b6896934e3..9dbc399d2cd885cad361474dfc109b7bea896b3f 100644 (file)
@@ -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;