This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR c++/69399: Add HAVE_WORKING_CXX_BUILTIN_CONSTANT_P
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 26 Jan 2016 17:13:50 +0100
- Subject: Re: [PATCH] PR c++/69399: Add HAVE_WORKING_CXX_BUILTIN_CONSTANT_P
- Authentication-results: sourceware.org; auth=none
- References: <20160122185533 dot GA3430 at intel dot com> <CAFiYyc3d+rRFi4hOdaDip-c_ohPYOy7keYAWRaE7V-XALnfKwQ at mail dot gmail dot com> <CAMe9rOpAPQendCYodbCC2SjtC3xSGcPz6pfN3LjXNAnq2R2iPQ at mail dot gmail dot com> <CAFiYyc1tGWtw7f5LHKP79v1pKPp8rmJNKRBv52qw_x4Gga=8mg at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Jan 26, 2016 at 04:54:43PM +0100, Richard Biener wrote:
> > Somehow PR 65656 miscompiled:
> >
> > if (STATIC_CONSTANT_P (xi.precision > HOST_BITS_PER_WIDE_INT)
> > ? xi.len == 1 && xi.val[0] >= 0
> > : xi.precision <= HOST_BITS_PER_WIDE_INT)
> >
> > which turned the expression into true and hit
> >
> > val[0] = xi.to_uhwi () >> shift;
> > result.set_len (1);
>
> I think we need a better analysis as we use __builtin_constant_p
> elsewhere as well.
Yeah, it would be nice to understand the somehow and what exactly is gong
on.
So, what is xi.precision, is it variable or constant, what value does it
have, has __builtin_constant_p returned 1 when it was supposed to return 0?
But then there would be still the precision check.
What is xi.len and xi.val[0]?
Jakub