This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix ICE with __builtin_*_overflow_p on bitfields (PR rtl-optimization/71673)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>, Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 27 Jun 2016 20:18:29 +0200
- Subject: [PATCH] Fix ICE with __builtin_*_overflow_p on bitfields (PR rtl-optimization/71673)
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
On targets which don't support sub-word operations trying OPTAB_DIRECT
AND on e.g. QImode or HImode leads to NULL being returned, so we ICE on
builtin-arith-overflow-p-19.c e.g. on arm, aarch64 or sparc*.
Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, tested
with cross-compiler on the testcase, ok for trunk?
2016-06-27 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/71673
* internal-fn.c (expand_arith_overflow_result_store): Use
OPTAB_LIB_WIDEN instead of OPTAB_DIRECT as last argument to
expand_simple_binop.
--- gcc/internal-fn.c.jj 2016-06-24 13:01:58.000000000 +0200
+++ gcc/internal-fn.c 2016-06-27 13:38:25.753237581 +0200
@@ -454,7 +454,7 @@ expand_arith_overflow_result_store (tree
= immed_wide_int_const (wi::shifted_mask (0, prec, false, tgtprec),
tgtmode);
lres = expand_simple_binop (tgtmode, AND, res, mask, NULL_RTX,
- true, OPTAB_DIRECT);
+ true, OPTAB_LIB_WIDEN);
}
else
{
Jakub