From 741233cf4dd17bab955b10854eb61fd9e6b419ce Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 3 Nov 2014 15:49:43 +0000 Subject: [PATCH] tree-eh.c (operation_could_trap_helper_p): Handle conversions like ordinary operations. 2014-11-03 Richard Biener * tree-eh.c (operation_could_trap_helper_p): Handle conversions like ordinary operations. * gimplify.c (gimplify_conversion): Gimplify CONVERT_EXPR as NOP_EXPR. From-SVN: r217048 --- gcc/ChangeLog | 7 +++++++ gcc/gimplify.c | 4 ++++ gcc/tree-eh.c | 5 ----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e709e113c1c..64a5a824619 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-11-03 Richard Biener + + * tree-eh.c (operation_could_trap_helper_p): Handle conversions + like ordinary operations. + * gimplify.c (gimplify_conversion): Gimplify CONVERT_EXPR + as NOP_EXPR. + 2014-11-03 Joseph Myers * configure.ac (TARGET_GLIBC_MAJOR, TARGET_GLIBC_MINOR): Define diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 38be0ce9f54..2dc505a35eb 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -1739,6 +1739,10 @@ gimplify_conversion (tree *expr_p) *expr_p = fold_build1_loc (loc, VIEW_CONVERT_EXPR, TREE_TYPE (*expr_p), TREE_OPERAND (*expr_p, 0)); + /* Canonicalize CONVERT_EXPR to NOP_EXPR. */ + if (TREE_CODE (*expr_p) == CONVERT_EXPR) + TREE_SET_CODE (*expr_p, NOP_EXPR); + return GS_OK; } diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index ebd9a3aec15..36ebc866c1b 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -2436,11 +2436,6 @@ operation_could_trap_helper_p (enum tree_code op, case UNEQ_EXPR: return honor_snans; - case CONVERT_EXPR: - case FIX_TRUNC_EXPR: - /* Conversion of floating point might trap. */ - return honor_nans; - case NEGATE_EXPR: case ABS_EXPR: case CONJ_EXPR: -- 2.30.2