[Bug libfortran/81986] sanitizer detects negation of large number in string.c

dominiq at lps dot ens.fr gcc-bugzilla@gcc.gnu.org
Wed Mar 3 11:03:14 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81986

--- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
r11-7470 fixes the first runtime error, but I still see

../../../work/libgfortran/io/write.c:835:7: runtime error: negation of
0x80000000000000000000000000000000 cannot be represented in type '__int128';
cast to an unsigned type to negate this value to itself

This is in

  sign = calculate_sign (dtp, n < 0);
  if (n < 0)
    n = -n;
  nsign = sign == S_NONE ? 0 : 1;


More information about the Gcc-bugs mailing list