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] PR28496 - Error during array initialization (and Ping fixes for PR20886, PR28425, PR28600, PR26601 and PR28630)


: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.

Attachment: pr28496.diff
Description: pr28496.diff

Attachment: Change.Logs
Description: Change.Logs


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