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

            Bug ID: 119377
           Summary: cobol.dg/group1/declarative_1.cob fails (segfaults,
                    uninitialised vars)
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: testsuite-fail
          Severity: normal
          Priority: P3
         Component: cobol
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

This passed for me a few days ago.

```
$ gcobol cobol.dg/group1/declarative_1.cob -O0
cobol1: internal compiler error: Segmentation fault
```

```
$ gcobol cobol.dg/group1/declarative_1.cob -O0 -wrapper valgrind,-q
==1624744== Conditional jump or move depends on uninitialised value(s)
==1624744==    at 0x19FECE2: UnknownInlinedFun (wide-int.h:930)
==1624744==    by 0x19FECE2: UnknownInlinedFun (wide-int.h:2231)
==1624744==    by 0x19FECE2: UnknownInlinedFun (tree.cc:1526)
==1624744==    by 0x19FECE2: wide_int_to_tree_1(tree_node*,
generic_wide_int<wide_int_ref_storage<false, true> > const&) [clone
.lto_priv.0] (tree.cc:1766)
==1624744==    by 0x1A6DFC6: UnknownInlinedFun (tree.cc:1951)
==1624744==    by 0x1A6DFC6: build_int_cst_type(tree_node*, poly_int<1u, long>)
(tree.cc:1608)
==1624744==    by 0x24ADEDD: psa_FldBlob(cbl_field_t*) [clone .lto_priv.0]
(genapi.cc:4085)
==1624744==    by 0x2494175: UnknownInlinedFun (symbols.h:1821)
==1624744==    by 0x2494175: symbol_declaratives_add(unsigned long,
std::__cxx11::list<cbl_declarative_t, std::allocator<cbl_declarative_t> >
const&) (except.cc:293)
==1624744==    by 0x255FB86: current_t::doing_declaratives(bool) [clone
.constprop.0] [clone .isra.0] (parse_ante.h:2133)
==1624744==    by 0x2585D48: yyparse() (parse.y:4680)
==1624744==    by 0x25ED107: UnknownInlinedFun (util.cc:2160)
==1624744==    by 0x25ED107: cobol_parse_files(int, char const**)
(util.cc:2221)
==1624744==    by 0x21F0584: compile_file() [clone .lto_priv.0] (toplev.cc:453)
==1624744==    by 0x21C09DE: UnknownInlinedFun (toplev.cc:2213)
==1624744==    by 0x21C09DE: toplev::main(int, char**) (toplev.cc:2376)
==1624744==    by 0x21BFBE9: main (main.cc:39)
==1624744==
==1624744== Conditional jump or move depends on uninitialised value(s)
==1624744==    at 0x19FEE8C: wide_int_to_tree_1(tree_node*,
generic_wide_int<wide_int_ref_storage<false, true> > const&) [clone
.lto_priv.0] (tree.cc:1843)
==1624744==    by 0x1A6DFC6: UnknownInlinedFun (tree.cc:1951)
==1624744==    by 0x1A6DFC6: build_int_cst_type(tree_node*, poly_int<1u, long>)
(tree.cc:1608)
==1624744==    by 0x24ADEDD: psa_FldBlob(cbl_field_t*) [clone .lto_priv.0]
(genapi.cc:4085)
==1624744==    by 0x2494175: UnknownInlinedFun (symbols.h:1821)
==1624744==    by 0x2494175: symbol_declaratives_add(unsigned long,
std::__cxx11::list<cbl_declarative_t, std::allocator<cbl_declarative_t> >
const&) (except.cc:293)
==1624744==    by 0x255FB86: current_t::doing_declaratives(bool) [clone
.constprop.0] [clone .isra.0] (parse_ante.h:2133)
==1624744==    by 0x2585D48: yyparse() (parse.y:4680)
==1624744==    by 0x25ED107: UnknownInlinedFun (util.cc:2160)
==1624744==    by 0x25ED107: cobol_parse_files(int, char const**)
(util.cc:2221)
==1624744==    by 0x21F0584: compile_file() [clone .lto_priv.0] (toplev.cc:453)
==1624744==    by 0x21C09DE: UnknownInlinedFun (toplev.cc:2213)
==1624744==    by 0x21C09DE: toplev::main(int, char**) (toplev.cc:2376)
==1624744==    by 0x21BFBE9: main (main.cc:39)
[...]
```

```
$ gcobol -v
Driving: (3)
   [ 0] 2431 gcobol
   [ 1] 2421 -v
   [ 2] 2309 -rdynamic

Using built-in specs.
COLLECT_GCC=gcobol
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/15/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/15
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/15/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/15/python
--enable-objc-gc
--enable-languages=c,c++,d,go,objc,obj-c++,fortran,ada,cobol,m2
--enable-obsolete --enable-secureplt --disable-werror --with-system-zlib
--enable-nls --without-included-gettext --disable-libunwind-exceptions
--enable-checking=yes,extra,rtl --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo Hardened 15.0.9999 p, commit
e36bfd9d8fde238e78a3ea7aacac14d2953f25ce' --with-gcc-major-version-only
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point
--enable-targets=all --enable-offload-defaulted
--enable-offload-targets=nvptx-none --enable-libgomp --disable-libssp
--enable-libada --disable-cet --disable-systemtap --enable-valgrind-annotations
--disable-vtable-verify --disable-libvtv --with-zstd --with-isl
--disable-isl-version-check --enable-default-pie --enable-host-pie
--enable-host-bind-now --enable-default-ssp --disable-fixincludes
--with-gxx-libcxx-include-dir=/usr/include/c++/v1
--with-build-config='bootstrap-O3 bootstrap-lto'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.1 20250319 (experimental)
be671ec1f30ecd55aaff09048afb2a619018cb8a (Gentoo Hardened 15.0.9999 p, commit
e36bfd9d8fde238e78a3ea7aacac14d2953f25ce)
```

Reply via email to