From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 246063851C18; Thu, 18 Jun 2020 13:54:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 246063851C18 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592488453; bh=u68IRJD5FngMq1FO0cKUf96H9Oa5TfekA2ZYdN208o0=; h=From:To:Subject:Date:From; b=ON+84Sf9SKJtYHL6juJ92wX9ruv1S0k9/LpQ4R7CJzA8y13lmqBfn8Ec/Y4iCZHWh Y6r5ea/BhjN22zZmOaTfMmuF2Tt8J7jyf6nQ4DLGSWHgWbrhyH5wXZTQdvQ0wb5aiw qgNqecymGhIvkOymmFIdkagsK43gUcbsU7rVQ1m4= From: "antoine.lemoine@bordeaux-inp.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/95743] New: [9/10 Regression] bogus recursive call to nonrecursive procedure with -fcheck=recursion Date: Thu, 18 Jun 2020 13:54:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 9.3.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: antoine.lemoine@bordeaux-inp.fr X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 13:54:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95743 Bug ID: 95743 Summary: [9/10 Regression] bogus recursive call to nonrecursive procedure with -fcheck=3Drecursion Product: gcc Version: 9.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: antoine.lemoine@bordeaux-inp.fr Target Milestone: --- I was able to reproduce the closed bug #80361 with gfortran 9.3.0 and 10.1.0 using the following code: program test_recursive_call=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 implicit none type t_tree_node type(t_tree_node), dimension(:), allocatable :: child end type type t_tree type(t_tree_node), allocatable :: root end type type(t_tree), allocatable :: tree allocate(tree) allocate(tree%root) allocate(tree%root%child(1)) ! If the line below is removed, the code works fine.=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 allocate(tree%root%child(1)%child(1)) deallocate(tree) end program Command line to compile the code: gfortran -g -fcheck=3Drecursion -o tree tree.f90 I obtain the following runtime error: At line 1 of file tree.f90 Fortran runtime error: Recursive call to nonrecursive procedure '__deallocate_test_recursive_call_T_tree_node' Error termination. Backtrace: #0 0x5623824511fb in __deallocate_test_recursive_call_T_tree_node at /home/****/fortran/test_gcc_ice2/tree.f90:1 #1 0x562382451302 in __deallocate_test_recursive_call_T_tree_node at /home/****/fortran/test_gcc_ice2/tree.f90:1 #2 0x562382451b95 in test_recursive_call at /home/****/fortran/test_gcc_ice2/tree.f90:18 #3 0x562382452230 in main at /home/****/fortran/test_gcc_ice2/tree.f90:19 It works fine without -fcheck=3Drecursion.=