diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-28 08:47:38 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-28 08:47:38 +0000 |
commit | 2069f8e125ae1dc7bb290dde2a04c64d213f12b9 (patch) | |
tree | 50c7abb69f3b2210ca85d4268d2632528cf587c0 /gcc/expr.c | |
parent | 427fa425045eb4955c3b061401980ae511921f2a (diff) | |
download | gcc-2069f8e125ae1dc7bb290dde2a04c64d213f12b9.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213117 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index d8328eebfbf..de0da345198 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. */ |