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

            Bug ID: 125171
           Summary: segmentation fault in program with 'EXIT PERFORM
                    CYCLE' statement
           Product: gcc
           Version: 15.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: cobol
          Assignee: unassigned at gcc dot gnu.org
          Reporter: peeterjoot at protonmail dot com
  Target Milestone: ---

Created attachment 64358
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64358&action=edit
The COBOL source associated with the compiler segv.

/usr/bin/gcobol -dialect ibm exit-variants.cob -c -v -save-temps -freport-bug
Driving: (7)
   [ 0] 2254 /usr/bin/gcobol
   [ 1]  981 -dialect ibm
   [ 2] 2255 exit-variants.cob
   [ 3]  970 -c
   [ 4] 2244 -v
   [ 5] 2138 -save-temps
   [ 6] 1709 -freport-bug

Using built-in specs.
COLLECT_GCC=/usr/bin/gcobol
Target: aarch64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,m2,cobol,lto
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://bugzilla.redhat.com/ --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-gcc-major-version-only --enable-libstdcxx-backtrace
--with-libstdcxx-zoneinfo=/usr/share/zoneinfo --with-linker-hash-style=gnu
--enable-plugin --enable-initfini-array
--with-isl=/builddir/build/BUILD/gcc-15.2.1-build/gcc-15.2.1-20260123/obj-aarch64-redhat-linux/isl-install
--enable-gnu-indirect-function --build=aarch64-redhat-linux
--with-build-config=bootstrap-lto --enable-link-serialization=1
--disable-libssp --disable-libquadmath
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.2.1 20260123 (Red Hat 15.2.1-7) (GCC) 
COLLECT_GCC_OPTIONS='-dialect' 'ibm' '-c' '-v' '-save-temps' '-freport-bug'
'-mlittle-endian' '-mabi=lp64'
 /usr/libexec/gcc/aarch64-redhat-linux/15/cobol1 exit-variants.cob -quiet
-dialect ibm -dumpbase exit-variants.cob -dumpbase-ext .cob -mlittle-endian
-mabi=lp64 -version -freport-bug -dialect ibm -o exit-variants.s
GCC COBOL (GCC) version 15.2.1 20260123 (Red Hat 15.2.1-7)
(aarch64-redhat-linux)
        compiled by GNU C version 15.2.1 20260123 (Red Hat 15.2.1-7), GMP
version 6.3.0, MPFR version 4.2.2, MPC version 1.3.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
during GIMPLE pass: cfg
In function ‘foo’:
cobol1: internal compiler error: Segmentation fault
Please submit a full bug report, with preprocessed source.
See <https://bugzilla.redhat.com/> for instructions.

commenting-out the EXIT PERFORM, and uncommenting-in the DISPLAY verifies that
it is the DISPLAY specifically that triggers the gcobol SEGV.

This SEGV was observed using the fedora 43 default version of gcobol

installed from rpms:

libgcobol-15.2.1-7.fc43.aarch64
gcc-gcobol-15.2.1-7.fc43.aarch64

but also building latest non-trunk gcobol (16.1.0, configured with 'configure
--prefix=$HOME/gcc-16.1.0 --enable-languages=c,c++,fortran,cobol
--disable-multilib')

-save-temps didn't appear to generate anything interesting.  See only:

```bash
> cat exit-variants.s
        .arch armv8-a
        .file   "exit-variants.cob"
```

system:
- aarch64 fedora 43 (running in VirtualBox VM on mac)
- Linux fedora 6.19.13-200.fc43.aarch64 #1 SMP PREEMPT_DYNAMIC Sat Apr 18
20:58:42 UTC 2026 aarch64 GNU/Linux
  • [Bug cobol/125171] New: segm... peeterjoot at protonmail dot com via Gcc-bugs

Reply via email to