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] fold-const.c (fold_relational_const): Remove dead code.


Hi,

Attached is a patch to remove dead code in fold_relational_const().

At the beginning of fold_relational_const(), we canonicalize the
condition to either EQ_EXPR or LT_EXPR so that we won't have to worry
about other condition codes.  Thus "code == NE_EXPR" never triggers.

The dead code comes from

  http://gcc.gnu.org/ml/gcc-patches/2003-11/msg00394.html

Bootstrapped on i686-pc-linux-gnu.  Committed as obvious.

Kazu Hirata

2004-03-19  Kazu Hirata  <kazu@cs.umass.edu>

	* fold-const.c (fold_relational_const): Remove dead code.

Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.213.2.80
diff -u -r1.213.2.80 fold-const.c
--- fold-const.c	8 Mar 2004 18:05:40 -0000	1.213.2.80
+++ fold-const.c	19 Mar 2004 23:50:52 -0000
@@ -9012,9 +9012,6 @@
   else if (code == EQ_EXPR && !TREE_SIDE_EFFECTS (op0)
            && integer_zerop (op1) && tree_expr_nonzero_p (op0))
     tem = build_int_2 (0, 0);
-  else if (code == NE_EXPR && !TREE_SIDE_EFFECTS (op0)
-           && integer_zerop (op1) && tree_expr_nonzero_p (op0))
-    tem = build_int_2 (1, 0);
 
   /* Two real constants can be compared explicitly.  */
   else if (TREE_CODE (op0) == REAL_CST && TREE_CODE (op1) == REAL_CST)


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