This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Make fold_range_test work only on integral types (PR middle-end/58809)
- From: Jeff Law <law at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 21 Oct 2013 10:56:52 -0600
- Subject: Re: [PATCH] Make fold_range_test work only on integral types (PR middle-end/58809)
- Authentication-results: sourceware.org; auth=none
- References: <20131021151322 dot GM10967 at redhat dot com>
On 10/21/13 09:13, Marek Polacek wrote:
For exceedingly annoying reasons BOOLEAN_TYPE is not considered an
integral type. You might consider letting fold_range_test do it's thing
on BOOLEAN_TYPEs, though I'd be surprised if that matters in practice.
In this PR (well, in the first testcase in it), the problem was that
fold_range_test got op0 and op1 of a COMPLEX_TYPE, subsequent call
of make_range then failed because it wants to create an integer constant
using build_int_cst - and that can't handle COMPLEX_TYPE. Also,
we can't just compare complex numbers, so I think it's sane to bail out
if fold_range_test isn't dealing with integer types...
I didn't want to put the check between the declarations, so the
make_range calls were moved slightly below.
Regtested/bootstrapped on x86_64-linux, ok for trunk?
2013-10-21 Marek Polacek <email@example.com>
* fold-const.c (fold_range_test): Return 0 if the type is not
an integral type.
* gcc.dg/gomp/pr58809.c: New test.
Your call -- fine as-is or you can let BOOLEAN_TYPEs through with a