This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch, fortran] PR 25031


Hello world,

this fixes a problem with my previous patch for PR 25031.  For

  allocate (a(5))
  allocate (a(10),stat=i)
  print *,size(a)

we would print 10, but the actual size would still match 5.

Following the discussion on c.l.f., we could either use the
old size or the new size, but we should do it consistently.

Given the current setup, it is far easier to use the new
size, so this is what this patch implements.

Regression-tested on i686-pc-linux-gnu.

OK for trunk?  If this is OK, I will commit the original
patch for PR 25031 to 4.1 together with this.

	Thomas

2006-03-29  Thomas Koenig  <Thomas.Koenig@online.de>

	PR fortran/25031
	* runtime/memory.c (allocate_array):  If stat is present and
	the variable is already allocated, free the variable, do
	the allocation and set stat.
	(allocate_array_64):  Likewise.  Whitespace fix.

2006-03-29  Thomas Koenig  <Thomas.Koenig@online.de>

	PR fortran/25031
	* gfortran.dg/multiple_allocation_1.f90:  Check that the
	size has changed after a re-allocation with stat.

Attachment: alloc-size-patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]