aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-07-28 08:47:38 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-07-28 08:47:38 +0000
commit2637bd27e86c30bce73f6753e922b1b2f03ad47d (patch)
tree50c7abb69f3b2210ca85d4268d2632528cf587c0 /gcc/expr.c
parent02b278a886da80a9432453993f5310cd760ca956 (diff)
downloadgcc-2637bd27e86c30bce73f6753e922b1b2f03ad47d.zip
gcc-2637bd27e86c30bce73f6753e922b1b2f03ad47d.tar.gz
gcc-2637bd27e86c30bce73f6753e922b1b2f03ad47d.tar.bz2
re PR middle-end/52478 (-ftrapv calls the wrong functions in libgcc)
2014-07-28 Richard Biener <rguenther@suse.de> PR middle-end/52478 * optabs.c (gen_int_libfunc): For -ftrapv libfuncs make sure to register SImode ones, not only >= word_mode ones. * expr.c (expand_expr_real_2): When expanding -ftrapv binops do not use OPTAB_LIB_WIDEN. * gcc.dg/torture/ftrapv-1.c: New testcase. From-SVN: r213117
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index d8328ee..de0da34 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -9212,7 +9212,9 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
if (modifier == EXPAND_STACK_PARM)
target = 0;
temp = expand_binop (mode, this_optab, op0, op1, target,
- unsignedp, OPTAB_LIB_WIDEN);
+ unsignedp,
+ trapv_binoptab_p (this_optab)
+ ? OPTAB_LIB : OPTAB_LIB_WIDEN);
gcc_assert (temp);
/* Bitwise operations do not need bitfield reduction as we expect their
operands being properly truncated. */