This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/39571] Compiler crash with "GNU MP: Cannot reallocate memory"
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Mar 2009 03:02:41 -0000
- Subject: [Bug fortran/39571] Compiler crash with "GNU MP: Cannot reallocate memory"
- References: <bug-39571-15541@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from kargl at gcc dot gnu dot org 2009-03-28 03:02 -------
(In reply to comment #3)
> I chased this to airth.c line 1054:
>
> mpz_pow_ui (result->value.integer, op1->value.integer, power);
>
> The variable power is 268435472.
>
On FreeBSD I get
REMOVE:kargl[6] gfc4x -o z a.f90
a.f90:2.12:
print *, 2**huge(0)
1
Error: Arithmetic overflow at (1)
REMOVE:kargl[7] gfc43 -o z a.f90
a.f90:2.12:
print *, 2**huge(0)
1
Error: Arithmetic overflow at (1)
REMOVE:kargl[8]
REMOVE:kargl[8] gfc4x --version
GNU Fortran (GCC) 4.4.0 20090308 (experimental) [trunk revision 140508]
REMOVE:kargl[9] gfc43 --version
GNU Fortran (GCC) 4.3.3 20081120 (prerelease)
REMOVE:kargl[11] pkg_info | grep gmp
libgmp-4.2.4 A free library for arbitrary precision arithmetic
REMOVE:kargl[12] pkg_info | grep mpfr
mpfr-2.4.1 A library for multiple-precision floating-point computation
Do your gmp/mpfr libraries pass their testsuites? Do you have more
than one version of one of these libraries installed.
The error message indicates that gmp is broken or perhaps NetBSD's
malloc implementation.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39571