public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "asolokha at gmx dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/107145] New: Indefinite recursion in gfc_check_dummy_characteristics/gfc_compare_interfaces
Date: Tue, 04 Oct 2022 05:18:52 +0000	[thread overview]
Message-ID: <bug-107145-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 107145
           Summary: Indefinite recursion in
                    gfc_check_dummy_characteristics/gfc_compare_interfaces
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gfortran 13.0.0 20220925 snapshot (g:77bbf69d2981dafc2ef3e59bfbefb645d88bab9d)
ICEs when compiling the following testcase, extracted from
test/Semantics/resolve102.f90 from the flang 15.0.1 test suite:

subroutine circular
  procedure(sub) :: p

  call p(sub)

  contains
    subroutine sub(p2)
      procedure(p) :: p2
    end subroutine
end subroutine circular

% gfortran-13.0.0 -c ckmbwiwb.f90
gfortran-13.0.0: internal compiler error: Segmentation fault signal terminated
program f951
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://gcc.gnu.org/bugs/> for instructions.
zsh: exit 4     gfortran-13.0.0 -c ckmbwiwb.f90

(gdb) where 10
#0  gfc_check_dummy_characteristics (s1=0x2e52450, s2=0x2e52450,
type_must_agree=type_must_agree@entry=true,
    errmsg=errmsg@entry=0x7ffffbfff130 "", err_len=err_len@entry=200)
    at
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/interface.cc:1340
#1  0x00000000008cc6ba in gfc_check_dummy_characteristics (err_len=200,
errmsg=0x7ffffbfff130 "", type_must_agree=true,
    s2=<optimized out>, s1=<optimized out>)
    at
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/interface.cc:1334
#2  gfc_compare_interfaces (s1=<optimized out>, s2=<optimized out>,
name2=0x7ffff79a90d8 "p2", generic_flag=0,
    strict_flag=<optimized out>, errmsg=0x7ffffbfff130 "", err_len=200, p1=0x0,
p2=0x0, bad_result_characteristics=<optimized out>)
    at
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/interface.cc:1825
#3  0x00000000008cd0a7 in gfc_check_dummy_characteristics (s1=0x2e52450,
s2=0x2e52450, type_must_agree=type_must_agree@entry=true,
    errmsg=errmsg@entry=0x7ffffbfff2c0 "", err_len=err_len@entry=200)
    at
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/interface.cc:1433
#4  0x00000000008cc6ba in gfc_check_dummy_characteristics (err_len=200,
errmsg=0x7ffffbfff2c0 "", type_must_agree=true,
    s2=<optimized out>, s1=<optimized out>)
    at
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/interface.cc:1334
#5  gfc_compare_interfaces (s1=<optimized out>, s2=<optimized out>,
name2=0x7ffff79a90d8 "p2", generic_flag=0,
    strict_flag=<optimized out>, errmsg=0x7ffffbfff2c0 "", err_len=200, p1=0x0,
p2=0x0, bad_result_characteristics=<optimized out>)
    at
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/interface.cc:1825
#6  0x00000000008cd0a7 in gfc_check_dummy_characteristics (s1=0x2e52450,
s2=0x2e52450, type_must_agree=type_must_agree@entry=true,
    errmsg=errmsg@entry=0x7ffffbfff450 "", err_len=err_len@entry=200)
    at
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/interface.cc:1433
#7  0x00000000008cc6ba in gfc_check_dummy_characteristics (err_len=200,
errmsg=0x7ffffbfff450 "", type_must_agree=true,
    s2=<optimized out>, s1=<optimized out>)
    at
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/interface.cc:1334
#8  gfc_compare_interfaces (s1=<optimized out>, s2=<optimized out>,
name2=0x7ffff79a90d8 "p2", generic_flag=0,
    strict_flag=<optimized out>, errmsg=0x7ffffbfff450 "", err_len=200, p1=0x0,
p2=0x0, bad_result_characteristics=<optimized out>)
    at
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/interface.cc:1825
#9  0x00000000008cd0a7 in gfc_check_dummy_characteristics (s1=0x2e52450,
s2=0x2e52450, type_must_agree=type_must_agree@entry=true,
    errmsg=errmsg@entry=0x7ffffbfff5e0 "", err_len=err_len@entry=200)
    at
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/interface.cc:1433
(More stack frames follow...)
(gdb) where -1
#503274 0x000000000088004b in main (argc=14, argv=0x7fffffffd9b8)
    at
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/main.cc:39

                 reply	other threads:[~2022-10-04  5:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107145-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).