This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: Fix libjava bootstrap
- From: "Daniel Berlin" <dberlin at dberlin dot org>
- To: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 30 Jun 2007 20:23:03 -0400
- Subject: [PATCH]: Fix libjava bootstrap
We end up with a cast of an EXC_PTR (which i didn't know was legal).
The old value numberer just did something broken but consistent with
these.
The new one didn't know what to do so it failed :)
Fixed thusly by not trying to value number them.
Bootstrapped and regtested on i686-darwin
Committed to mainline
2007-06-30 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-pre.c (is_exception_related): New function
(can_value_number_operation): Use it.
Index: tree-ssa-pre.c
===================================================================
--- tree-ssa-pre.c (revision 126149)
+++ tree-ssa-pre.c (working copy)
@@ -2122,13 +2122,23 @@ can_value_number_call (tree stmt)
return false;
}
+/* Return true if OP is an exception handler related operation, such as
+ FILTER_EXPRor EXC_PTR_EXPR. */
+
+static bool
+is_exception_related (tree op)
+{
+ return TREE_CODE (op) == FILTER_EXPR || TREE_CODE (op) == EXC_PTR_EXPR;
+}
+
/* Return true if OP is a tree which we can perform value numbering
on. */
static bool
can_value_number_operation (tree op)
{
- return UNARY_CLASS_P (op)
+ return (UNARY_CLASS_P (op)
+ && !is_exception_related (TREE_OPERAND (op, 0)))
|| BINARY_CLASS_P (op)
|| COMPARISON_CLASS_P (op)
|| REFERENCE_CLASS_P (op)