OSDN Git Service

2005-10-16 Erik Edelmann <erik.edelmann@iki.fi>
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-forwprop.c
index 17da0f1..d5db4a8 100644 (file)
@@ -15,14 +15,13 @@ GNU General Public License 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.  */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "errors.h"
 #include "ggc.h"
 #include "tree.h"
 #include "rtl.h"
@@ -560,7 +559,8 @@ forward_propagate_addr_expr (tree stmt)
   if (bb_for_stmt (use_stmt)->loop_depth > stmt_loop_depth)
     return false;
 
-  /* Strip away any outer COMPONENT_REF/ARRAY_REF nodes from the LHS.  */
+  /* Strip away any outer COMPONENT_REF/ARRAY_REF nodes from the LHS. 
+     ADDR_EXPR will not appear on the LHS.  */
   lhs = TREE_OPERAND (use_stmt, 0);
   while (TREE_CODE (lhs) == COMPONENT_REF || TREE_CODE (lhs) == ARRAY_REF)
     lhs = TREE_OPERAND (lhs, 0);
@@ -591,9 +591,12 @@ forward_propagate_addr_expr (tree stmt)
       return true;
     }
 
-  /* Strip away any outer COMPONENT_REF/ARRAY_REF nodes from the RHS.  */
+  /* Strip away any outer COMPONENT_REF, ARRAY_REF or ADDR_EXPR
+     nodes from the RHS.  */
   rhs = TREE_OPERAND (use_stmt, 1);
-  while (TREE_CODE (rhs) == COMPONENT_REF || TREE_CODE (rhs) == ARRAY_REF)
+  while (TREE_CODE (rhs) == COMPONENT_REF
+        || TREE_CODE (rhs) == ARRAY_REF
+        || TREE_CODE (rhs) == ADDR_EXPR)
     rhs = TREE_OPERAND (rhs, 0);
 
   /* Now see if the RHS node is an INDIRECT_REF using NAME.  If so,