public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/109206] New: [13 Regression] gcc/fortran/class.cc:2768:14: runtime error: load of value 4139789424, which is not a valid value for type 'bt' since r13-6747-gd7caf313525a46
Date: Mon, 20 Mar 2023 08:34:15 +0000	[thread overview]
Message-ID: <bug-109206-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 109206
           Summary: [13 Regression] gcc/fortran/class.cc:2768:14: runtime
                    error: load of value 4139789424, which is not a valid
                    value for type 'bt' since r13-6747-gd7caf313525a46
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: pault at gcc dot gnu.org
  Target Milestone: ---

The following test-case fails with UBSAN enabled:

$ cat finalize_38a.f90
module testmode
  type simple
    integer ind
  end type 
  type, extends(simple) :: complicated
    real rind
  contains
    final destructor4
  end type 
contains
  subroutine destructor4(self)
    type(complicated)  self
  end  
  function constructor2(rind)
     optional  rind
    type(complicated), allocatable :: src(:)
    integer sz
    if (present (rind)) then
      src  = [(complicated (ind0, rind0), i = 1, sz)]   
    end if
  end  
  end

$ /dev/shm/objdir2/gcc/xgcc -B/dev/shm/objdir2/gcc/ finalize_38a.f90 -c
-std=f2008
finalize_38a.f90:19:56:

   19 |       src  = [(complicated (ind0, rind0), i = 1, sz)]
      |                                                        1
Warning: The structure constructor at (1) has been finalized. This feature was
removed by f08/0011. Use -std=f2018 or -std=gnu to eliminate the finalization.
/home/marxin/Programming/gcc/gcc/fortran/class.cc:2768:14: runtime error: load
of value 4139789424, which is not a valid value for type 'bt'
    #0 0xab7ec1 in gfc_may_be_finalized(gfc_typespec)
/home/marxin/Programming/gcc/gcc/fortran/class.cc:2768
    #1 0xed949d in gfc_trans_array_constructor_value
/home/marxin/Programming/gcc/gcc/fortran/trans-array.cc:2309
    #2 0xede7b7 in trans_array_constructor
/home/marxin/Programming/gcc/gcc/fortran/trans-array.cc:2936
    #3 0xee0956 in gfc_add_loop_ss_code
/home/marxin/Programming/gcc/gcc/fortran/trans-array.cc:3229
    #4 0xef7ce6 in gfc_conv_loop_setup(gfc_loopinfo*, locus*)
/home/marxin/Programming/gcc/gcc/fortran/trans-array.cc:5526
    #5 0x10270a6 in gfc_trans_assignment_1
/home/marxin/Programming/gcc/gcc/fortran/trans-expr.cc:11789
    #6 0x102a9e2 in gfc_trans_assignment(gfc_expr*, gfc_expr*, bool, bool,
bool, bool) /home/marxin/Programming/gcc/gcc/fortran/trans-expr.cc:12251
    #7 0x102ab73 in gfc_trans_assign(gfc_code*)
/home/marxin/Programming/gcc/gcc/fortran/trans-expr.cc:12264
    #8 0xec3f1b in trans_code
/home/marxin/Programming/gcc/gcc/fortran/trans.cc:2229
    #9 0xec497c in gfc_trans_code(gfc_code*)
/home/marxin/Programming/gcc/gcc/fortran/trans.cc:2582
    #10 0x110ae45 in gfc_trans_if_1
/home/marxin/Programming/gcc/gcc/fortran/trans-stmt.cc:1487
    #11 0x110b1bf in gfc_trans_if(gfc_code*)
/home/marxin/Programming/gcc/gcc/fortran/trans-stmt.cc:1519
    #12 0xec42e3 in trans_code
/home/marxin/Programming/gcc/gcc/fortran/trans.cc:2317
    #13 0xec497c in gfc_trans_code(gfc_code*)
/home/marxin/Programming/gcc/gcc/fortran/trans.cc:2582
    #14 0xfa0df6 in gfc_generate_function_code(gfc_namespace*)
/home/marxin/Programming/gcc/gcc/fortran/trans-decl.cc:7714
    #15 0xec55d8 in gfc_generate_module_code(gfc_namespace*)
/home/marxin/Programming/gcc/gcc/fortran/trans.cc:2649
    #16 0xcff92f in translate_all_program_units
/home/marxin/Programming/gcc/gcc/fortran/parse.cc:6707
    #17 0xd00f09 in gfc_parse_file()
/home/marxin/Programming/gcc/gcc/fortran/parse.cc:7026
    #18 0xe822bb in gfc_be_parse_file
/home/marxin/Programming/gcc/gcc/fortran/f95-lang.cc:229
    #19 0x278e9f1 in compile_file
/home/marxin/Programming/gcc/gcc/toplev.cc:444
    #20 0x2796c4b in do_compile /home/marxin/Programming/gcc/gcc/toplev.cc:2125
    #21 0x27974c1 in toplev::main(int, char**)
/home/marxin/Programming/gcc/gcc/toplev.cc:2277
    #22 0x69f084d in main /home/marxin/Programming/gcc/gcc/main.cc:39
    #23 0x7ffff722caef in __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
    #24 0x7ffff722cbb8 in __libc_start_main_impl ../csu/libc-start.c:360
    #25 0xa3c164 in _start ../sysdeps/x86_64/start.S:115

             reply	other threads:[~2023-03-20  8:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20  8:34 marxin at gcc dot gnu.org [this message]
2023-03-20  8:35 ` [Bug fortran/109206] " marxin at gcc dot gnu.org
2023-03-20  9:29 ` rguenth at gcc dot gnu.org
2023-03-20 16:29 ` pault at gcc dot gnu.org
2023-03-21  6:28 ` cvs-commit at gcc dot gnu.org
2023-03-21  7:14 ` pault at gcc dot gnu.org
2023-03-21 10:09 ` marxin at gcc dot gnu.org

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-109206-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).