public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [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
@ 2023-03-20  8:34 marxin at gcc dot gnu.org
  2023-03-20  8:35 ` [Bug fortran/109206] " marxin at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-03-20  8:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

* [Bug fortran/109206] [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
  2023-03-20  8:34 [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 marxin at gcc dot gnu.org
@ 2023-03-20  8:35 ` marxin at gcc dot gnu.org
  2023-03-20  9:29 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-03-20  8:35 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-03-20
   Target Milestone|---                         |13.0
             Status|UNCONFIRMED                 |NEW

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

* [Bug fortran/109206] [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
  2023-03-20  8:34 [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 marxin at gcc dot gnu.org
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-20  9:29 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4

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

* [Bug fortran/109206] [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
  2023-03-20  8:34 [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 marxin at gcc dot gnu.org
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu.org @ 2023-03-20 16:29 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |pault at gcc dot gnu.org

--- Comment #1 from Paul Thomas <pault at gcc dot gnu.org> ---
Created attachment 54714
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54714&action=edit
Fix for this PR

Hi Martin,

Thanks for the rapid reporting!

This was plain carelessness on my part. I will commit as obvious a bit later
on.

Regards

Paul

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

* [Bug fortran/109206] [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
  2023-03-20  8:34 [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 marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-21  6:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Paul Thomas <pault@gcc.gnu.org>:

https://gcc.gnu.org/g:259bd768640328cc98647c5cf8b0d6dcfba6d4bf

commit r13-6772-g259bd768640328cc98647c5cf8b0d6dcfba6d4bf
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Tue Mar 21 06:28:07 2023 +0000

    Fortran: Fix regression caused by PR37336 patch [PR109206]

    2023-03-21  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/109206
            * trans-array.cc (gfc_trans_array_constructor_value): Correct
            incorrect setting of typespec.

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

* [Bug fortran/109206] [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
  2023-03-20  8:34 [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 marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu.org @ 2023-03-21  7:14 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> ---
Fixed! Thanks for the report.

Paul

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

* [Bug fortran/109206] [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
  2023-03-20  8:34 [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 marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-03-21  7:14 ` pault at gcc dot gnu.org
@ 2023-03-21 10:09 ` marxin at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-03-21 10:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
> This was plain carelessness on my part.

Heh, I would call it a natural fallout of software development. Anyway, thanks
for the fix.

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

end of thread, other threads:[~2023-03-21 10:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20  8:34 [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 marxin at gcc dot gnu.org
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

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