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

--- Comment #4 from Peeter Joot <peeterjoot at protonmail dot com> ---
verified fixed on trunk:

ubuntu:/home/peeterjoot/tmp> cat > 125577.cob
       IDENTIFICATION DIVISION.
       PROGRAM-ID. SUBBUG.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 A COMP-2 VALUE 9.
       01 B COMP-2 VALUE 1.
       01 R COMP-2.
       PROCEDURE DIVISION.
           COMPUTE R = A - B
           DISPLAY 'COMPUTE  A - B      = ' R '   expected 8'
           SUBTRACT B FROM A GIVING R
           DISPLAY 'SUBTRACT B FROM A   = ' R '   expected 8'
           COMPUTE R = A + (B * -1)
           DISPLAY 'COMPUTE  A + (B*-1) = ' R '   expected 8'
           GOBACK.
ubuntu:/home/peeterjoot/tmp> gcobol 125577.cob
ubuntu:/home/peeterjoot/tmp> ./a.out
COMPUTE  A - B      = 8   expected 8
SUBTRACT B FROM A   = 8   expected 8
COMPUTE  A + (B*-1) = 8   expected 8
ubuntu:/home/peeterjoot/tmp> gcobol --version
gcobol (GCC) 17.0.0 20260604 (experimental)
Copyright (C) 2026 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Reply via email to