This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH, fortran] PR20441 -finit-local-zero
- From: "Asher Langton" <langton2 at llnl dot gov>
- To: "Tobias Burnus" <burnus at net-b dot de>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Wed, 29 Aug 2007 18:10:37 -0700
- Subject: Re: [PATCH, fortran] PR20441 -finit-local-zero
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=XaOsiTJbVm218/W6KP+LqVeQhS5bFi5DCykeqmCPgdtQSlx+cQ0wTOPb640+AL1P7pHD0btQcO5/1VMoooZ7J6lExxfyyFonH3cJEfWSoTLFj2FhiSOQio0oxlpP55IiMduoZqk7Q1DSuVLyG8sFEfv0glD1tBFEHGe73KRFTws=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=L3J2gtuntLkeeLTe37O2PSjTskiwGWHjvMxLd72mqWTgLoK1UGN4yQ59JmMRYiUp9UhadZM8R6o2I4Le7NIiQO7+7TSsmPXYI6eiYzrrmzqBHlhD6+23M86DGcvwWXtRwqIOMtxW1j5H+Z6Lm70EeZefKmU+pvtOt+6dAUW2b0Y=
- References: <1953a4560708171312u705f5bf4ie9d8ce645d2f02b6@mail.gmail.com> <46C9C1C0.6070107@net-b.de> <1953a4560708281705ua0d5720ge733b326ec5502f3@mail.gmail.com> <46D53A61.5020304@net-b.de>
On 8/29/07, Tobias Burnus <burnus@net-b.de> wrote:
> I think you patch does not touch static variables (SAVE) thus they may
> not get default initialized.
Actually, it should initialize static variables, as well:
% cat foo.f90
program bar
print *,"1:"
call foo
print *,"2:"
call foo
end program bar
subroutine foo
integer :: i1 = 101
integer i2
integer i3
save i2
print *,"Entry:", i1, i2, i3
i1 = -1
i2 = -2
i3 = -3
print *,"Exit:",i1,i2,i3
end subroutine foo
% gfc -finit-integer=1000 foo.f90
% ./a.out
1:
Entry: 101 1000 1000
Exit: -1 -2 -3
2:
Entry: -1 -2 1000
Exit: -1 -2 -3
-Asher