[Bug fortran/51073] _gfortran_caf_register incorrectly assumes malloc(0) returns non-NULL

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Nov 10 10:14:00 GMT 2011


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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-10 10:01:36 UTC ---
I think the size == 0 issue can only happen for static ("save") coarrays such
as 
  integer, save :: caf(1:0)[*]
  print *, size(caf)
  end
For allocatable coarrays, one always allocates at least a single byte.

Thus, it should be done in the front end for performance reasons (size is known
at the compile time and it is a rather special case).

Regarding the RTEMS failures: I somehow doubt that they are related to this
issue. I think there should be no size-zero test case for coarrays.



More information about the Gcc-bugs mailing list