* [PATCH] Adjust conversion handling in operation_could_trap_helper_p, gimplify CONVERT_EXPR as NOP_EXPR
@ 2014-11-03 15:49 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2014-11-03 15:49 UTC (permalink / raw)
To: gcc-patches
$subject, as suggested by Joseph and Jakub
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
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.
Index: gcc/tree-eh.c
===================================================================
--- gcc/tree-eh.c (revision 217046)
+++ gcc/tree-eh.c (working copy)
@@ -2436,11 +2436,6 @@ operation_could_trap_helper_p (enum tree
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:
Index: gcc/gimplify.c
===================================================================
--- gcc/gimplify.c (revision 217046)
+++ gcc/gimplify.c (working copy)
@@ -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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-11-03 15:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-03 15:49 [PATCH] Adjust conversion handling in operation_could_trap_helper_p, gimplify CONVERT_EXPR as NOP_EXPR Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).