Skip to content

det translator: arithmetic-vs-scaled-item comparison differs from cobc; 'OR NOT = x' does not parse #4681

Closed

Description

@squid-protocol

Found while proving #4674 / #4656 (PR #4680). Each is a small, separate hole in the det translator, GnuCOBOL (-std=ibm) as the oracle.

  1. Wrong result: IF D0 + 1 > Q3 (D0 PIC 9(3) = 7, Q3 PIC 9V999 = 3.125): cobc takes the branch as false (D0 + 0 > Q3 and D0 + ZERO > Q3 too, and < Q3 as true); the det port says true. D0 + ZERO = 7 matches, so it is the comparison of an arithmetic expression against a different-scale item (OSVS arithmetic family, cf. det runtime: truncate arithmetic intermediates as cobc's ARITHMETIC-OSVS does (#4287) #4654).
  2. Wrong result: IF S3 NOT < 3 + B0 * - D0 (S3 PIC S9(4)V999 = -5.125, B0 PIC 9(4) COMP = 579, D0 PIC 9(3) = 7): cobc false, port true (one line, no line split involved).
  3. Parse hole: IF A = 'B' OR NOT = 'C' (abbreviated combined relation with NOT = after OR) makes the whole PROCEDURE DIVISION fail to parse, on one line; OR NOT < 100 is fine.

Part of #4270.

🤖 Generated with Claude Code

Activity

  1. added
    bug
    legacy-modernization
    on Oct 8, 2026
  2. added
    scope:sweep
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglegacy-modernizationpriority: mediumscope:sweep

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions