From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4385 invoked by alias); 4 May 2015 15:21:37 -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 4337 invoked by uid 48); 4 May 2015 15:21:32 -0000 From: "fxcoudert at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47359] Recursive functions of intrinsic names generates invalid assembler Date: Mon, 04 May 2015 15:21: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: unknown X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: fxcoudert at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: cf_reconfirmed_on cc 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: 2015-05/txt/msg00262.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47359 Francois-Xavier Coudert changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2011-05-23 09:58:19 |2015-5-4 CC| |fxcoudert at gcc dot gnu.org --- Comment #3 from Francois-Xavier Coudert --- Still fails. Somewhat reduced/reworked testcase: program test external max print *, max(42, 1) end recursive function max(a, b) result(k) integer a, b, k if (b > 0) then k = max(a, b-1) else k = 0 end if end function where you can see that generated code for function "max" does not call itself, as it should. The output of that program is "42", while it should be "0". Providing an explicit interface for "max" is also not working: program test interface recursive function max(a, b) result(k) integer a, b, k end function end interface print *, max(42, 1) end recursive function max(a, b) result(k) integer a, b, k if (b > 0) then k = max(a, b-1) else k = 0 end if end function