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

            Bug ID: 128087
           Summary: valgrind error in vptr_field_get(tree_node*, int)
                    (trans-expr.cc:334)
           Product: gcc
           Version: 17.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 65923
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65923&action=edit
f90 source code

For the attached F90 code, compiled by a valgrind version
of recent gfortran, does this:

$ ~/gcc/results.20261020.valgrind/bin/gfortran -c -w
/home/dcb42/fujitsu/trunk/Fortran/0555/0555_0392.f90
==168874== Invalid read of size 8
==168874==    at 0x60FC00: vptr_field_get(tree_node*, int) (trans-expr.cc:334)
==168874==    by 0x61172D: gfc_vptr_size_get(tree_node*) (trans-expr.cc:395)
==168874==    by 0x62AD9E: gfc_trans_subcomponent_assign(tree_node*,
gfc_component*, gfc_expr*, bool) (trans-expr.cc:10775)

Compiler version is

$ ~/gcc/results.20261020.valgrind/bin/gfortran -v 2>&1 | grep exp
gcc version 17.0.0 20261019 (experimental) (708cc223b0f8b96c) 
foundBugs $ 

Source code in gfortran is

  field = gfc_advance_chain (TYPE_FIELDS (TREE_TYPE (vptr)),
                 fieldno);

git blame says:

34d9d74996ba gcc/fortran/trans-expr.c  (Andre Vehreschild          2015-03-24
11:28:48 +0100   334)   field = gfc_advance_chain (TYPE_FIELDS (TREE_TYPE
(vptr)),

Reply via email to