public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/97009] New: Inlining with non-standard selected_int_kind leads to errors
@ 2020-09-10 11:32 pvitt at posteo dot de
  2020-09-10 11:33 ` [Bug fortran/97009] " pvitt at posteo dot de
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: pvitt at posteo dot de @ 2020-09-10 11:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97009

            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=49207&action=edit
Minimum working example to reproduce the problem.

We ran into a problem that I stripped down to a minimal working example (see
attachment). 

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 = selected_int_kind(15)

is changed to

    integer, parameter :: long_k = selected_int_kind(9)

it works with O1 and O2.

We stumbled over this when some unit tests failed after we activated LTO. Our
first guess was that LTO stumbles over the elemental function (which tem_pathOf
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 same
file. And as it disappears with O1, it seems to be related to inlining in
general.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-03-27  5:00 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 11:32 [Bug fortran/97009] New: Inlining with non-standard selected_int_kind leads to errors pvitt at posteo dot de
2020-09-10 11:33 ` [Bug fortran/97009] " pvitt at posteo dot de
2020-09-10 18:57 ` [Bug fortran/97009] [9/10/11 Regression] " anlauf at gcc dot gnu.org
2020-09-10 20:20 ` [Bug tree-optimization/97009] " anlauf at gcc dot gnu.org
2020-09-11 18:17 ` anlauf at gcc dot gnu.org
2020-10-12 12:10 ` rguenth at gcc dot gnu.org
2021-03-31 20:26 ` jamborm at gcc dot gnu.org
2021-03-31 20:28 ` jamborm at gcc dot gnu.org
2021-03-31 21:32 ` jamborm at gcc dot gnu.org
2021-04-01  8:12 ` cvs-commit at gcc dot gnu.org
2021-04-01  9:51 ` cvs-commit at gcc dot gnu.org
2021-04-01 13:38 ` [Bug tree-optimization/97009] [9 " jamborm at gcc dot gnu.org
2021-04-08 16:58 ` cvs-commit at gcc dot gnu.org
2021-04-08 16:58 ` jamborm at gcc dot gnu.org
2024-03-27  5:00 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).