[patch] tree-cfg.c: Remove an "if" statement that never trigers.

Kazu Hirata kazu@cs.umass.edu
Sat Nov 6 13:33:00 GMT 2004


Hi,

Attached is a patch to remove an "if" statement that never trigers.

We *always* have two distinct outgoing edges for basic blocks ending
with COND_EXPR.  If the two destinations end up being the same as a
result of edge redirection, COND_EXPR is removed at the same time.

Tested on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2004-11-06  Kazu Hirata  <kazu@cs.umass.edu>

	* tree-cfg.c (find_taken_edge_cond_expr): Remove an "if"
	statement that never triggers.

Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.100
diff -u -d -p -r2.100 tree-cfg.c
--- tree-cfg.c	4 Nov 2004 22:07:37 -0000	2.100
+++ tree-cfg.c	5 Nov 2004 22:54:38 -0000
@@ -1987,11 +1987,6 @@ find_taken_edge_cond_expr (basic_block b
 
   extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
 
-  /* If both edges of the branch lead to the same basic block, it doesn't
-     matter which edge is taken.  */
-  if (true_edge->dest == false_edge->dest)
-    return true_edge;
-
   /* Otherwise, try to determine which branch of the if() will be taken.
      If VAL is a constant but it can't be reduced to a 0 or a 1, then
      we don't really know which edge will be taken at runtime.  This



More information about the Gcc-patches mailing list