This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add wide_int_storage::operator=
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, richard dot sandiford at arm dot com
- Date: Wed, 1 Mar 2017 13:18:29 +0100 (CET)
- Subject: Re: [PATCH] Add wide_int_storage::operator=
- Authentication-results: sourceware.org; auth=none
- References: <alpine.LSU.2.20.1703011306070.30051@zhemvz.fhfr.qr> <20170301121453.GC1849@tucnak>
On Wed, 1 Mar 2017, Jakub Jelinek wrote:
> On Wed, Mar 01, 2017 at 01:08:58PM +0100, Richard Biener wrote:
> >
> > In debugging a -Wuninitialized issue from ipa-cp.c which does
> >
> > vr.min = vr.max = wi::zero (INT_TYPE_SIZE);
>
> Note maybe it would be faster to:
> vr.min = wi::zero (INT_TYPE_SIZE);
> vr.max = wi::zero (INT_TYPE_SIZE);
>
> That doesn't mean your wide-int.h change isn't useful.
Note that rewriting like above doesn't fix the warning. The issue
is from
generic_wide_int<storage>& generic_wide_int<T>::operator=(const T&) [with
T = wi::hwi_with_prec; storage = wide_int_storage] (struct
generic_wide_int * const this, const struct hwi_with_prec & x)
{
struct wide_int_storage D.47458;
struct generic_wide_int & D.52104;
wide_int_storage::wide_int_storage<wi::hwi_with_prec> (&D.47458, x);
try
{
this->D.16244 = D.47458;
where wide_int_storage::wide_int_storage<wi::hwi_with_prec> (&D.47458, x)
doesn't initialize all of wide_int_storage (but only up to len).
Richard.