[Patch, fortran] PR28496 - Error during array initialization (and Ping fixes for PR20886, PR28425, PR28600, PR26601 and PR28630)

THOMAS Paul Richard 169137 Paul.Richard.THOMAS@cea.fr
Thu Aug 10 10:10:00 GMT 2006


:ADDPATCH fortran:

This patch fixes an error that I made in the implementation of array initializers.

This would segfault:

  integer, dimension(3), parameter :: a=(/1,2,3/)
  integer, dimension(3), parameter :: b=(/a(:)/) 
end

because a missing start value for an index triplet was not being handled correctly.
Note that the end value and stride were correctly handled, as replacing a(:) with
a(1:) demonstrates.

I was going to commit this as obvious but I am beginning to build up a backlog of
other patches (PR20886, PR28600, PR28425, PR26601 and PR28630).  Since I am a bit
short of time, I would appreciate somebody casting an eye over some of the others
so that I can commit several at a time. (Yes, "daytime work" is intervening and
has to be dealt with!)

Regtested on Cygwin_NT/PIV: OK for trunk and 4.1?

Paul

2006-08-10  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/28496
	* expr.c (find_array_section): Correct errors in
	the handling of a missing start value for the
	index triplet in an array reference.

2006-08-10  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/28496
	* gfortran.dg/array_initializer_2.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr28496.diff
Type: application/octet-stream
Size: 2849 bytes
Desc: pr28496.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060810/ee7f2ff2/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Change.Logs
Type: application/octet-stream
Size: 325 bytes
Desc: Change.Logs
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060810/ee7f2ff2/attachment-0001.obj>


More information about the Fortran mailing list