Eric Botcazou <ebotca...@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