[Bug cobol/126853] New: ice: segfaulting in parser_assign" (on nested size error?)

simonsobisch at gnu dot org via Gcc-bugs <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126853

            Bug ID: 126853
           Summary: ice: segfaulting in  parser_assign" (on nested size
                    error?)
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: cobol
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simonsobisch at gnu dot org
  Target Milestone: ---

cobol1: internal compiler error: Segmentation fault
0x2839498 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x282e0db internal_error(char const*, ...)
        ???:0
0xac639c parser_assign(unsigned long, cbl_num_result_t*, cbl_refer_t,
cbl_label_t*, cbl_label_t*, cbl_label_t*)
        ???:0
0xaeddb2 parser_compute(std::vector<cbl_num_result_t,
std::allocator<cbl_num_result_t> >&, std::deque<rpn_t, std::allocator<rpn_t> >
const&, cbl_label_t*, cbl_label_t*, cbl_label_t*)
        ???:0
0xb3b8ce yyparse()
        ???:0
0xbce304 cobol_parse_files(int, char const**)
        ???:0

on

       Identification Division.

       PROGRAM-ID. SIZENEST.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       77 WS-A             PIC 99 VALUE 8.
       77 WS-ZERO          PIC 99 VALUE 0.
       77 WS-R             PIC 99 VALUE 10.
       PROCEDURE DIVISION.

           COMPUTE WS-R = WS-A / WS-ZERO
               ON SIZE ERROR
                   IF WS-R = 10
                       DISPLAY "OUTER PASS"
                   END-IF
                   COMPUTE WS-R = 1 / WS-ZERO
                       ON SIZE ERROR
                           DISPLAY "INNER PASS"
                   END-COMPUTE
           END-COMPUTE

       GOBACK.



Example with more tests including display of values and comparison with
GnuCOBOL at https://godbolt.org/z/1MxjMhM7j
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.