public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/66366] New: ICE on invalid with non-allocatable CLASS variable [OOP]
@ 2015-06-01 19:19 abensonca at gmail dot com
  2015-06-03 13:46 ` [Bug fortran/66366] " dominiq at lps dot ens.fr
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: abensonca at gmail dot com @ 2015-06-01 19:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66366
           Summary: ICE on invalid with non-allocatable CLASS variable
                    [OOP]
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: abensonca at gmail dot com
  Target Milestone: ---

The following invalid code causes an ICE with gfortran 6.0.0 223992:

module bug

  type :: t1d
   contains
     procedure :: interpolate => interp
  end type t1d

  type :: tff
     class(t1d) :: transfer
  end type tff

contains

  double precision function interp(self)
    implicit none
    class(t1d), intent(inout) :: self
    return
  end function interp

  double precision function fvb(self)
    implicit none
    class(tff), intent(inout) :: self
    fvb=self%transfer%interpolate()
    return
  end function fvb

end module bug

$ gfortran -v                                                                  
                              Using built-in specs.
COLLECT_GCC=/opt/gcc-trunk/bin/gfortran
COLLECT_LTO_WRAPPER=/opt/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/opt/gcc-trunk
--enable-languages=c,c++,fortran --disable-multilib
Thread model: posix
gcc version 6.0.0 20150517 (experimental) (GCC) 


 gfortran -c bug.F90 -o bug.o
bug.F90:9:27:

      class(t1d) :: transfer
                            1
Error: Component ‘transfer’ with CLASS at (1) must be allocatable or pointer
f951: internal compiler error: in check_typebound_baseobject, at
fortran/resolve.c:5521
0x637465 check_typebound_baseobject
        ../../gcc-trunk/gcc/fortran/resolve.c:5521
0x63791e resolve_compcall
        ../../gcc-trunk/gcc/fortran/resolve.c:5812
0x63404e resolve_typebound_function
        ../../gcc-trunk/gcc/fortran/resolve.c:5954
0x63404e gfc_resolve_expr(gfc_expr*)
        ../../gcc-trunk/gcc/fortran/resolve.c:6265
0x63a8b6 gfc_resolve_code(gfc_code*, gfc_namespace*)
        ../../gcc-trunk/gcc/fortran/resolve.c:10095
0x63d2d2 resolve_codes
        ../../gcc-trunk/gcc/fortran/resolve.c:15055
0x63d1d7 resolve_codes
        ../../gcc-trunk/gcc/fortran/resolve.c:15040
0x63d3b2 gfc_resolve(gfc_namespace*)
        ../../gcc-trunk/gcc/fortran/resolve.c:15083
0x628cb6 gfc_parse_file()
        ../../gcc-trunk/gcc/fortran/parse.c:5477
0x669445 gfc_be_parse_file
        ../../gcc-trunk/gcc/fortran/f95-lang.c:228
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


The code is invalid as the CLASS variable in "tff" is neither allocatable nor a
pointer. The call to the "interpolate" function of the "t1d" class seems to be
necessary to trigger the ICE.
>From gcc-bugs-return-487747-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jun 01 19:40:35 2015
Return-Path: <gcc-bugs-return-487747-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 101826 invoked by alias); 1 Jun 2015 19:40:34 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 101781 invoked by uid 48); 1 Jun 2015 19:40:31 -0000
From: "dimhen at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/66354] [UBSAN] stl_algobase.h:708:7: runtime error: null pointer passed as argument
Date: Mon, 01 Jun 2015 19:40:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dimhen at gmail dot com
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: redi at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-66354-4-3SYY6SIBF6@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66354-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66354-4@http.gcc.gnu.org/bugzilla/>
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-06/txt/msg00079.txt.bz2
Content-length: 431

https://gcc.gnu.org/bugzilla/show_bug.cgi?idf354

--- Comment #4 from Dmitry G. Dyachenko <dimhen at gmail dot com> ---
(In reply to Jonathan Wakely from comment #1)
> (In reply to Dmitry G. Dyachenko from comment #0)
> > Sorry, I have no compact testcase.
>
> Could you at least use -fno-sanitize-recover=undefined and look at the stack
> trace where it happens?

Alas, there are no stack with -fno-sanitize-recover=undefined


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

end of thread, other threads:[~2021-05-14 10:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-01 19:19 [Bug fortran/66366] New: ICE on invalid with non-allocatable CLASS variable [OOP] abensonca at gmail dot com
2015-06-03 13:46 ` [Bug fortran/66366] " dominiq at lps dot ens.fr
2015-06-22 22:54 ` abensonca at gmail dot com
2015-06-22 22:58 ` abensonca at gmail dot com
2021-01-08 20:37 ` [Bug fortran/66366] [OOP] ICE on invalid with non-allocatable CLASS variable anlauf at gcc dot gnu.org
2021-01-08 20:43 ` anlauf at gcc dot gnu.org
2021-05-14 10:02 ` jakub 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).