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

            Bug ID: 127901
           Summary: valgrind error in
                    gfc_trans_concurrent_locality_spec:trans-stmt.cc:5303
           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 65847
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65847&action=edit
f90 source code

For the attached F90 code, from the llvm flang test suite, does
the following with a recent gfortran trunk, compiled with valgrind:

$ ~/gcc/results.20261009.valgrind/bin/gfortran -c -w
/home/dcb42/llvm/trunk/flang/test/Lower/do_concurrent_delayed_locality.f90
==15036== Conditional jump or move depends on uninitialised value(s)
==15036==    at 0x604B9E: gfc_get_symbol_decl(gfc_symbol*) (trans-decl.cc:1728)
==15036==    by 0x67D69E: gfc_trans_concurrent_locality_spec(bool,
stmtblock_t*, std::vector<symbol_and_tree_t, std::allocator<symbol_and_tree_t>
>*, gfc_expr_list**) (trans-stmt.cc:5303)
==15036==    by 0x67E144: gfc_trans_forall_1(gfc_code*, forall_info*)
(trans-stmt.cc:5595)
==15036==    by 0x5D2977: trans_code(gfc_code*, tree_node*) (trans.cc:2491)

The gfortran source code is

     /* Slightly ugly hack for adding the decl via add_decl_as_local. */
      gfc_symbol dummy_block_sym;
      dummy_block_sym.attr.flavor = FL_LABEL;
      gfc_symbol *saved_proc_name = sym->ns->proc_name;
      sym->ns->proc_name = &dummy_block_sym;

      gfc_get_symbol_decl (sym);

The bug has existed since before date 20260926.

Reply via email to