From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 089903857035; Thu, 10 Sep 2020 11:32:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 089903857035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1599737523; bh=gtDUz+wsMg6e791LxZNkWxfEKnn5kI2NdDLV/ozrq7I=; h=From:To:Subject:Date:From; b=b4Sp7HkfWByqPFyhtPPjKyceYFpxkb6w8N8wPmDSfPXCjjK32720mKxA2oxnDzfh0 mAhhlJvZeS3Y5+oT/+7kXSQySTZBi0678j0AoWpghejYxyDI8ZCFgTrbfyyhSeA3UV nbMgxFkPGKcMU89ooX5YObFHvU4vNXCf7TLtW9XQ= From: "pvitt at posteo dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/97009] New: Inlining with non-standard selected_int_kind leads to errors Date: Thu, 10 Sep 2020 11:32:02 +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: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pvitt at posteo dot de 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 attachments.created 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, 10 Sep 2020 11:32:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97009 Bug ID: 97009 Summary: Inlining with non-standard selected_int_kind leads to errors Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: pvitt at posteo dot de Target Milestone: --- Created attachment 49207 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D49207&action=3Dedit Minimum working example to reproduce the problem. We ran into a problem that I stripped down to a minimal working example (see attachment).=20 When the MWE is compiled with `gfortran -O1 2269_mwe.f90`, it produces the expected output Level 3 treeID 0 Level 2 treeID 1 Level 1 treeID 9 When it is compiled with O2, it fails: Level 3 treeID 140732851705864 Level 2 treeID 140732851705352 Level 1 treeID 4545064992 When the line integer, parameter :: long_k =3D selected_int_kind(15) is changed to integer, parameter :: long_k =3D selected_int_kind(9) it works with O1 and O2. We stumbled over this when some unit tests failed after we activated LTO. O= ur first guess was that LTO stumbles over the elemental function (which tem_pa= thOf was before I stripped it down). However, while creating the MWE, we ended up reproducing the behavior also without LTO, but the called function in the s= ame file. And as it disappears with O1, it seems to be related to inlining in general.=