tree-eh.c (operation_could_trap_helper_p): Handle conversions like ordinary operations.
authorRichard Biener <rguenther@suse.de>
Mon, 3 Nov 2014 15:49:43 +0000 (15:49 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 3 Nov 2014 15:49:43 +0000 (15:49 +0000)
2014-11-03  Richard Biener  <rguenther@suse.de>

* 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
gcc/gimplify.c
gcc/tree-eh.c

index e709e113c1cb83f4a5308690274059ed37ebadef..64a5a824619e3c4ba0314b4b8ec34da3e5bf8192 100644 (file)
@@ -1,3 +1,10 @@
+2014-11-03  Richard Biener  <rguenther@suse.de>
+
+       * 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  <joseph@codesourcery.com>
 
        * configure.ac (TARGET_GLIBC_MAJOR, TARGET_GLIBC_MINOR): Define
index 38be0ce9f540398dba07b159e990b9848d501ad5..2dc505a35eb12c976dd85b891206be0a0613ef3e 100644 (file)
@@ -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;
 }
 
index ebd9a3aec155546da79f573a19ff2d005ca4d323..36ebc866c1b1c1f5e699d480a424403bb04c2a2f 100644 (file)
@@ -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: