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] Fix PR 26017 - allocate (a(1:-1))


:ADDPATCH fortran:

Hello world,

here's a fix for PR 26017.  The reason why it isn't enough
to check for negative size is that we don't want to actually
allocate anything for allocate(a(1:-1,1:-1)).  Regression-tested
on i686-pc-linux-gnu.

OK for trunk and, after a week or so, for 4.1?

	Thomas

2006-04-14  Thomas Koenig  <Thomas.Koenig@online.de>

	PR fortran/26017
	* trans-array.c(gfc_array_init_size):  Introduce or_expr
	which is true if the size along any dimension
	is negative.  Create a temporary variable with base
	name size.  If or_expr is true, set the temporary to 0,
	to the normal size otherwise.

2006-04-14  Thomas Koenig  <Thomas.Koenig@online.de>

	* gfortran.dg/allocate_zerosize_1.f90:  New test.

Attachment: alloc-zero-patch
Description: Text document

Attachment: allocate_zerosize_1.f90
Description: Text document


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