http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58003

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Chris Gilbreth from comment #0)
> (Is this valid Fortran?)

First, it is definitely a bug - internal compiler errors are always a bug.

Regarding the validity: The number z'0F00F00080000001' = 1081127795507068929 is
too large for a (signed) 32-bit integer. Hence, the compiler complains. The
Fortran standard does not provide a real answer to what value is should have
and the code is, hence, invalid

However, with -fno-range-check the compiler is requested to ignore the overflow
and, for a given platform, the is an expected value, given how overflows are
handled.

* * *

The code fails at the assert:

convert_mpz_to_unsigned (mpz_t x, int bitsize)
...
  if (mpz_sgn (x) < 0)
...
  else
    {
      /* Confirm that no bits above the signed range are set.  */
      gcc_assert (mpz_scan1 (x, bitsize-1) == ULONG_MAX);
    }

Namely, the possibility that the input value is - on purpose - overflowing is
not handled.

Reply via email to