From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31442 invoked by alias); 19 Dec 2013 11:31:41 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 31421 invoked by uid 48); 19 Dec 2013 11:31:38 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/59104] Wrong result with SIZE specification expression Date: Thu, 19 Dec 2013 11:31:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-12/txt/msg01758.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59104 Dominique d'Humieres changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2013-12-19 Ever confirmed|0 |1 --- Comment #1 from Dominique d'Humieres --- Confirmed at r206105. Using result(res) as in module m1 implicit none integer, parameter :: dp = kind([double precision::]) contains recursive function f(x) result(res) integer, intent(in) :: x real(dp) res(x/2) integer y(size(res)+1) if (x==1) return write(*,*) 'size(f) = ',size(res) write(*,*) 'size(y) = ',size(y) res = f(x/2) end function f end module m1 program bug3 use m1 implicit none real y y = sum(f(8)) print *, y end program bug3 make the code working: size(f) = 4 size(y) = 5 size(f) = 2 size(y) = 3 size(f) = 1 size(y) = 2 0.00000000