On Tue, 25 Mar 2014, Marek Polacek wrote:

This is a temporary fix for UB in IRA, where ubsan complains because
there's signed iteger overflow in the multiplication.  To shut this
error up, we can perform the multiplication in unsigned and only then
cast the result of the multiplication to int.

Naive question: why do you want to shut the error up? If modular arithmetic makes sense for costs (sounds doubtful), they should use an unsigned type to begin with. Otherwise, this is making it harder to notice a bug (doesn't sound like an improvement).

If you want to cast, doesn't something like long long (HOST_WIDEST_INT?) make more sense than unsigned?

--
Marc Glisse

Reply via email to