PATCH: Bad signed int to long long conversion

Torbjorn Granlund tg at
Thu Feb 9 13:56:07 CET 2012

Marc Glisse <marc.glisse at> writes:

  On Thu, 1 Dec 2011, Torbjorn Granlund wrote:
  > I don't mind that somebody patches up all occurences of signed negation
  > where the smallest negative value could hypothetically appear.
  I don't know about "all occurences", but if there aren't any
  objections I plan to commit the patch attached.
  (I checked and gcc produces the same code for -1-(long)l as for
  (long)~l, even at -O0)

This patch seems to be pending still.  I haven't looked at it carefully.
Does it solve real problems out there?  Then perhaps we ought to include
this for 5.0.4?


More information about the gmp-bugs mailing list