[tree-ssa] Remove more unnecessary NOP_EXPRs

law@redhat.com law@redhat.com
Mon Aug 11 21:28:00 GMT 2003


This fixes tree-ssa/20030807-3.c.

The fundamental problem was that we folded a statement and the result
was wrapped in a pointless NOP_EXPR.  That pointless NOP_EXPR prohibited
the dominator optimizer from recognizing a obvious redundancy.

	* tree-ssa-ccp.c (fold_stmt): Strip unnecessary NOP_EXPRs from
	the folded result.

Index: tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-ccp.c,v
retrieving revision 1.1.2.83
diff -c -3 -p -r1.1.2.83 tree-ssa-ccp.c
*** tree-ssa-ccp.c	8 Aug 2003 00:27:10 -0000	1.1.2.83
--- tree-ssa-ccp.c	11 Aug 2003 21:22:03 -0000
*************** fold_stmt (tree *stmt_p)
*** 1301,1306 ****
--- 1301,1310 ----
        if (result == NULL_TREE)
  	result = fold (rhs);
  
+       /* Strip away useless type conversions.  */
+       if (result != rhs)
+ 	STRIP_MAIN_TYPE_NOPS (result);
+ 
        set_rhs (stmt_p, result);
      }
  }





More information about the Gcc-patches mailing list