[Patch, fortran] PR35810 - [TR 15581 / F2003] Automatic reallocation on assignment to allocatable variables
Tobias Burnus
tobias.burnus@physik.fu-berlin.de
Mon Nov 29 12:09:00 GMT 2010
>>> gfortran-4.6 -frealloc-lhs realloc_on_assign_2.f03
>> realloc_on_assign_2.f03: In function âtest5â:
>> realloc_on_assign_2.f03:101:0: internal compiler error: in
>> fold_convert_loc, at fold-const.c:1907
I really wonder why this seems to only occur with Janus' gfortran.
The compilation also works here - also using valgrind. That's in line
with the results at http://gcc.gnu.org/ml/gcc-testresults/2010-11/,
where I do not see any test suite failure.
However, I see a failure myself:
$ gfortran -frealloc-lhs realloc_on_assign_2.f03
$ ./a.out
Aborted (core dumped)
The reason that I see the segfault and others don't is again due
to the environment variable MALLOC_PERTURB_ whose value is set
via memset to malloced variables (if one uses GLIBC). If you set
it to nonzero, you will get the crash. Valgrind shows:
==23394== Conditional jump or move depends on uninitialised value(s)
==23394== at 0x401B0D: test5.1568 (realloc_on_assign_2.f03:105)
==23394== by 0x400D55: MAIN__ (realloc_on_assign_2.f03:15)
==23394== by 0x402ADC: main (realloc_on_assign_2.f03:18)
==23394==
==23394== Conditional jump or move depends on uninitialised value(s)
==23394== at 0x401B12: test5.1568 (realloc_on_assign_2.f03:105)
==23394== by 0x400D55: MAIN__ (realloc_on_assign_2.f03:15)
==23394== by 0x402ADC: main (realloc_on_assign_2.f03:18)
Tobias
More information about the Fortran
mailing list