aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.h
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-03-05 13:08:55 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-03-05 13:08:55 +0000
commitb55f62ccae9766c687dea6afc60f701a4490b0f1 (patch)
tree42d3abf28617c05fdaa5e752dbc6b7ef735744cf /gcc/optabs.h
parent8dad8b259071a3b49d8ad0f08b7b0dba30b974c0 (diff)
downloadgcc-b55f62ccae9766c687dea6afc60f701a4490b0f1.zip
gcc-b55f62ccae9766c687dea6afc60f701a4490b0f1.tar.gz
gcc-b55f62ccae9766c687dea6afc60f701a4490b0f1.tar.bz2
re PR middle-end/52353 (-ftrapv -fnon-call-exceptions does not work)
2012-03-05 Richard Guenther <rguenther@suse.de> PR middle-end/52353 * optabs.h (trapv_unoptab_p): New function. (trapv_binoptab_p): Likewise. * optabs.c (expand_binop): Use emit_libcall_block_1 with a proper equiv_may_trap argument. (expand_unop): Likewise. (emit_libcall_block_1): Take extra argument whether the instruction may trap. Renamed from ... (emit_libcall_block): ... this. New wrapper. From-SVN: r184932
Diffstat (limited to 'gcc/optabs.h')
-rw-r--r--gcc/optabs.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/optabs.h b/gcc/optabs.h
index 6ad6dae..70a7395 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -1103,6 +1103,25 @@ set_direct_optab_handler (direct_optab op, enum machine_mode mode,
op->handlers[(int) mode].insn_code = (int) code - (int) CODE_FOR_nothing;
}
+/* Return true if UNOPTAB is for a trapping-on-overflow operation. */
+
+static inline bool
+trapv_unoptab_p (optab unoptab)
+{
+ return (unoptab == negv_optab
+ || unoptab == absv_optab);
+}
+
+/* Return true if BINOPTAB is for a trapping-on-overflow operation. */
+
+static inline bool
+trapv_binoptab_p (optab binoptab)
+{
+ return (binoptab == addv_optab
+ || binoptab == subv_optab
+ || binoptab == smulv_optab);
+}
+
extern rtx optab_libfunc (optab optab, enum machine_mode mode);
extern rtx convert_optab_libfunc (convert_optab optab, enum machine_mode mode1,
enum machine_mode mode2);