Fix for temporary allocation in spread

Thomas Koenig Thomas.Koenig@online.de
Wed Apr 13 20:30:00 GMT 2005


[CC:ing Walt Brainerd on this, because what is actually is
fixed is his bug report.]

This fixes at least part of PR 18495 (comment #7, when spread
appears in an I/O statement).  I don't have a complete test case
for the original bug report, so I can't say wether the bug is
completely fixed or not.

Regression-tested on mainline.

OK for mainline?

2005-04-13  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/18495
	* intrinsics/spread_generic.c (spread):  Remove const from
	return array descriptor.
	New variables: rrank (rank of return array),  rs (for
	calculating the size of the return array), srank (rank
	of the source array).
	Generate runtime error if the dim= argument is larger than
	the rank of the source array.
	Generate runtime error if the needed rank of the return
	array is larger than 7.
	If ret->data is null, populate the return array descriptor
	and initialize the variables for the actual operation.
	Change second, independent use of variable dim to srank.

2005-04-13  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/18495
	* gfortran.fortran-torture/execute/intrinsic_spread.f90:
	Test callee-allocated version of return array with a write
	statement.



More information about the Gcc-patches mailing list