This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Unreachable code in expr.c and cp/call.c
- To: gcc at gcc dot gnu dot org
- Subject: Unreachable code in expr.c and cp/call.c
- From: Diego Novillo <dnovillo at redhat dot com>
- Date: Thu, 2 Aug 2001 23:52:02 -0400
- Organization: Red Hat Canada
While debugging the tree flowgraph builder, it found the
following unreachable code. In the case of expr.c, it's a quite
large chunk of code. Is it safe to kill this?
Diego.
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.339
diff -d -p -d -c -p -r1.339 expr.c
*** expr.c 2001/07/17 21:44:57 1.339
--- expr.c 2001/08/03 03:42:46
*************** do_jump (exp, if_false_label, if_true_la
*** 9860,9911 ****
}
break;
- {
- enum rtx_code rcode1;
- enum tree_code tcode2;
-
- case UNLT_EXPR:
- rcode1 = UNLT;
- tcode2 = LT_EXPR;
- goto unordered_bcc;
- case UNLE_EXPR:
- rcode1 = UNLE;
- tcode2 = LE_EXPR;
- goto unordered_bcc;
- case UNGT_EXPR:
- rcode1 = UNGT;
- tcode2 = GT_EXPR;
- goto unordered_bcc;
- case UNGE_EXPR:
- rcode1 = UNGE;
- tcode2 = GE_EXPR;
- goto unordered_bcc;
- case UNEQ_EXPR:
- rcode1 = UNEQ;
- tcode2 = EQ_EXPR;
- goto unordered_bcc;
-
- unordered_bcc:
- mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
- if (can_compare_p (rcode1, mode, ccp_jump))
- do_compare_and_jump (exp, rcode1, rcode1, if_false_label,
- if_true_label);
- else
- {
- tree op0 = save_expr (TREE_OPERAND (exp, 0));
- tree op1 = save_expr (TREE_OPERAND (exp, 1));
- tree cmp0, cmp1;
-
- /* If the target doesn't support combined unordered
- compares, decompose into UNORDERED + comparison. */
- cmp0 = fold (build (UNORDERED_EXPR, TREE_TYPE (exp), op0, op1));
- cmp1 = fold (build (tcode2, TREE_TYPE (exp), op0, op1));
- exp = build (TRUTH_ORIF_EXPR, TREE_TYPE (exp), cmp0, cmp1);
- do_jump (exp, if_false_label, if_true_label);
- }
- }
- break;
-
/* Special case:
__builtin_expect (<test>, 0) and
__builtin_expect (<test>, 1)
--- 9860,9865 ----
Index: cp/call.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/call.c,v
retrieving revision 1.274
diff -d -p -d -c -p -r1.274 call.c
*** call.c 2001/07/10 10:38:09 1.274
--- call.c 2001/08/03 03:42:47
*************** add_builtin_candidate (candidates, code,
*** 1946,1954 ****
types are TYPE2. */
break;
- /* These arguments do not make for a legal overloaded operator. */
- return candidates;
-
default:
my_friendly_abort (367);
}
--- 1946,1951 ----