diff mbox

[mem-ref2] Fix inline estimates

Message ID alpine.LNX.2.00.1006091747530.1429@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener June 9, 2010, 3:48 p.m. UTC
Committed.

2010-06-09  Richard Guenther  <rguenther@suse.de>

	* ipa-inline.c (likely_eliminated_by_inlining_p): Handle
	MEM_REF.
diff mbox

Patch

Index: gcc/ipa-inline.c
===================================================================
--- gcc/ipa-inline.c	(revision 160434)
+++ gcc/ipa-inline.c	(working copy)
@@ -1830,10 +1830,12 @@  likely_eliminated_by_inlining_p (gimple
 	    bool rhs_free = false;
 	    bool lhs_free = false;
 
- 	    while (handled_component_p (inner_lhs) || TREE_CODE (inner_lhs) == INDIRECT_REF)
+ 	    while (handled_component_p (inner_lhs)
+		   || TREE_CODE (inner_lhs) == MEM_REF)
 	      inner_lhs = TREE_OPERAND (inner_lhs, 0);
  	    while (handled_component_p (inner_rhs)
-	           || TREE_CODE (inner_rhs) == ADDR_EXPR || TREE_CODE (inner_rhs) == INDIRECT_REF)
+	           || TREE_CODE (inner_rhs) == ADDR_EXPR
+		   || TREE_CODE (inner_rhs) == MEM_REF)
 	      inner_rhs = TREE_OPERAND (inner_rhs, 0);
 
 
@@ -1853,7 +1855,8 @@  likely_eliminated_by_inlining_p (gimple
 	        || (TREE_CODE (inner_lhs) == SSA_NAME
 		    && TREE_CODE (SSA_NAME_VAR (inner_lhs)) == RESULT_DECL))
 	      lhs_free = true;
-	    if (lhs_free && (is_gimple_reg (rhs) || is_gimple_min_invariant (rhs)))
+	    if (lhs_free
+		&& (is_gimple_reg (rhs) || is_gimple_min_invariant (rhs)))
 	      rhs_free = true;
 	    if (lhs_free && rhs_free)
 	      return true;