public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/115401] New: valgrind error in gfc_class_len_get
@ 2024-06-09  7:00 dcb314 at hotmail dot com
  2024-06-09 20:04 ` [Bug fortran/115401] " anlauf at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: dcb314 at hotmail dot com @ 2024-06-09  7:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115401
           Summary: valgrind error in gfc_class_len_get
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 58387
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58387&action=edit
f90 source code

From the flang testsuite, file ./Lower/derived-type-finalization.f90
does this with recent flang built with valgrind:

test $ /home/dcb40b/gcc/results.20240608.valgrind/bin/gfortran -c -w
./Lower/derived-type-finalization.f90
==122289== Invalid read of size 8
==122289==    at 0x85EFD7: gfc_class_len_get(tree_node*) (trans-expr.cc:273)
==122289==    by 0x87761D: trans_class_vptr_len_assignment(stmtblock_t*,
gfc_expr*, gfc_expr*, gfc_se*, tree_node**, tree_node**, tree_node**)
(trans-expr.cc:10170)
==122289==    by 0x87A8B2: trans_class_assignment (trans-expr.cc:12006)
==122289==    by 0x87A8B2: gfc_trans_assignment_1(gfc_expr*, gfc_expr*, bool,
bool, bool, bool) (trans-expr.cc:12501)

flang testsuite is at

https://github.com/llvm/llvm-project/tree/main/flang/test/

Source code attached.

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

* [Bug fortran/115401] valgrind error in gfc_class_len_get
  2024-06-09  7:00 [Bug fortran/115401] New: valgrind error in gfc_class_len_get dcb314 at hotmail dot com
@ 2024-06-09 20:04 ` anlauf at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: anlauf at gcc dot gnu.org @ 2024-06-09 20:04 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-06-09
     Ever confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from anlauf at gcc dot gnu.org ---
Reduced testcase which ICEs here:

module m
  implicit none
  type :: t1
    integer :: a
  end type
contains
  function copy(a) result(ty)
    class(t1), allocatable :: ty(:)
    integer, intent(in) :: a
    allocate(t1::ty(a))
    ty%a = 1
  end function

  subroutine test()
!   class(t1), allocatable :: up(:) ! OK
    class(*), allocatable  :: up(:) ! ICE
    allocate(up(10), source=copy(10))
  end subroutine
end module

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

end of thread, other threads:[~2024-06-09 20:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-09  7:00 [Bug fortran/115401] New: valgrind error in gfc_class_len_get dcb314 at hotmail dot com
2024-06-09 20:04 ` [Bug fortran/115401] " anlauf 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).