This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR 61084: Use widest_int in sparc_fold_builtin


Eric Botcazou <ebotcazou@adacore.com> writes:
>> Well, I understood the distinction between wide_int and widest_int.
>> I just didn't understand what pdist did. :-)
>> 
>> The difference is documented (a bit verbosely) in wide-int.h.
>
> Yes, but not really why it's not correct to use wide_int for the computation 
> made in pdist

It was wrong to use wide_int because the calculation does arithmetic on
mixed QImode and DImode values.

     1) wide_int (the default).  This flavor does the math in the
     precision of its input arguments.  It is assumed (and checked)
     that the precisions of the operands and results are consistent.

The precisions weren't consistent in this case and we failed the
assertion checks.

> (and whether the use of widest_int could be avoided altogether 
> by using a common type throughout the computation).

That would work too, but widest_int seemed simpler.

Thanks,
Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]