This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa] Restore lost code


This restores code that was lost during the tree-ssa-dom.c reorganization.
Basically dest = src | nonzero constant creates the equivalence dest != 0.

	* tree-ssa-dom.c (record_equivalences_from_stmt): Restore lost code
	to create equivalences from BIT_IOR_EXPR.

Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dom.c,v
retrieving revision 1.1.2.70
diff -c -3 -p -r1.1.2.70 tree-ssa-dom.c
*** tree-ssa-dom.c	31 Oct 2003 18:52:07 -0000	1.1.2.70
--- tree-ssa-dom.c	31 Oct 2003 19:47:36 -0000
*************** record_equivalences_from_stmt (tree stmt
*** 1891,1896 ****
--- 1891,1913 ----
  	  cond = build (NE_EXPR, boolean_type_node, lhs, null_pointer_node);
  	  record_cond_is_true (cond, block_avail_exprs_p);
  	}
+ 
+       /* IOR of any value with a nonzero value will result in a nonzero
+ 	 value.  Even if we do not know the exact result recording that
+ 	 the result is nonzero is worth the effort.  */
+       if (TREE_CODE (rhs) == BIT_IOR_EXPR
+ 	  && integer_nonzerop (TREE_OPERAND (rhs, 1)))
+ 	{
+ 	  tree cond;
+ 
+ 	  cond = build (EQ_EXPR, boolean_type_node, lhs,
+ 			convert (TREE_TYPE (lhs), integer_zero_node));
+ 	  record_cond_is_false (cond, block_avail_exprs_p);
+ 
+ 	  cond = build (NE_EXPR, boolean_type_node, lhs,
+ 			convert (TREE_TYPE (lhs), integer_zero_node));
+ 	  record_cond_is_true (cond, block_avail_exprs_p);
+ 	}
      }
  
    /* Look at both sides for pointer dereferences.  If we find one, then





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]