From f75f5eddccb74e1476d50f233a8ada9477da9e4d Mon Sep 17 00:00:00 2001 From: dberlin Date: Sun, 1 Jul 2007 02:20:06 +0000 Subject: [PATCH] 2007-06-30 Daniel Berlin * tree-ssa-pre.c (is_exception_related): New function (can_value_number_operation): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126162 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/tree-ssa-pre.c | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c8f71ee..7e576be 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -25,6 +25,11 @@ * pa.c (hppa_can_use_return_insn_p): Delete function. Include "df.h". 2007-06-30 Daniel Berlin + + * tree-ssa-pre.c (is_exception_related): New function + (can_value_number_operation): Use it. + +2007-06-30 Daniel Berlin Fix PR tree-optimization/32540 Fix PR tree-optimization/31651 diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 966d881..b971de4 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -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) -- 2.7.4