IBM Support

PH28786: COMPILER INCORRECTLY REMOVES CODE AT OPT(1|2) WHERE IF OR EVALUATE STMTS COMPARE SINGLE DATA ITEM TO CONSTANT VALUES

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • PROBLEM DESCRIPTION: The compiler may incorrectly remove the
    comparison and the code path that would execute when the
    condition is matched, instead forcing execution to continue on
    the code path when the data item matches none of the constant
    values.  USERS AFFECTED: Users of Enterprise COBOL 6.x compiling
    with OPT(1|2) where the programs contain IF or EVALUATE
    statements that compare a single data item to several constant
    values where the constants and data item are at most four bytes
    long, the data item has a known value at the point of
    comparison, and that value matches one of the constants being
    compared. This may also occur if the comparison is within a
    paragraph that is PERFORMed, the paragraph is inlined, and
    shortly before the PERFORM statement, the data item is assigned
    a value matching one of the constants being compared.
    KNOWN IMPACT:
    The compiler incorrectly removes code, leading to indeterminate
    incorrect behaviour
    

Local fix

  • BYPASS/CIRCUMVENTION:
    WORKAROUND/CIRCUMVENTION: Compile with OPT(0), or possibly with
    NOINLINE.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED: Users of Enterprise COBOL 6.2 compiling      *
    *                 with OPT(1|2) where the programs contain IF  *
    *                 or EVALUATE statements that compare a        *
    *                 single data item to several constant values  *
    *                 where the constants and data item are at     *
    *                 most four bytes long, the data item has a    *
    *                 known value at the point of comparison, and  *
    *                 that value matches one of the constants      *
    *                 being compared. This may also occur if the   *
    *                 comparison is within a paragraph that is     *
    *                 PERFORMed, the paragraph is inlined, and     *
    *                 shortly before the PERFORM statement, the    *
    *                 data item is assigned a value matching one   *
    *                 of the constants being compared.             *
    ****************************************************************
    * PROBLEM DESCRIPTION: The compiler may incorrectly remove the *
    *                      comparison and the code path that       *
    *                      would execute when the condition is     *
    *                      matched, instead forcing execution to   *
    *                      continue on the code path when the      *
    *                      data item matches none of the constant  *
    *                      values.                                 *
    ****************************************************************
    * RECOMMENDATION: Apply the provided PTF.                      *
    ****************************************************************
    When comparing the known value of the data item to the known
    constant values, the compiler was comparing up to 32 bits of
    data as a 64-bit compare. If the leftmost bit of the data item
    is 1, the 32-bit value was expanded to 64 bits by setting the
    leftmost 32 bits to 1 (that is, x'FFFFFFFF'), while when the
    constants were expanded to 64 bits, the leftmost 32 bits were
    all set to 0 (x'00000000'). The compiler then compared these
    two values, and as the leftmost 32 bits in each didn't match,
    the compiler incorrectly concluded that the data item didn't
    match any of the values to which it was being compared.
    

Problem conclusion

  • The compiler was fixed to compare 32-bit constants as 32 bits,
    instead of expanding to 64 bits.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PH28786

  • Reported component name

    ENT COBOL FOR Z

  • Reported component ID

    5655EC600

  • Reported release

    620

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2020-08-26

  • Closed date

    2020-10-07

  • Last modified date

    2020-11-02

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    PH29543 PH30276

Modules/Macros

  • IGY8RWTU IGYCASMB IGYCCBE  IGYCCCRT IGYCCICS IGYCCSRV IGYCDGEN
    IGYCDIAG IGYCDMAP IGYCEN$0 IGYCEN$1 IGYCEN$2 IGYCEN$3 IGYCEN$4
    IGYCEN$5 IGYCEN$8 IGYCEN$D IGYCEN$R IGYCFGEN IGYCFREE IGYCINIT
    IGYCJA$0 IGYCJA$1 IGYCJA$2 IGYCJA$3 IGYCJA$4 IGYCJA$5 IGYCJA$8
    IGYCJA$D IGYCJA$R IGYCLIBH IGYCLIBO IGYCLIBR IGYCLSTR IGYCLVL0
    IGYCLVL1 IGYCLVL2 IGYCLVL3 IGYCLVL8 IGYCMALL IGYCOSCN IGYCPGEN
    IGYCRCTL IGYCRDPR IGYCRDSC IGYCREAL IGYCRWT  IGYCSCAN IGYCSIMD
    IGYCUE$0 IGYCUE$1 IGYCUE$2 IGYCUE$3 IGYCUE$4 IGYCUE$5 IGYCUE$8
    IGYCUE$D IGYCUE$R IGYCXREF IGYDRV   IGYEQCWI IGYMSGE  IGYMSGK
    IGYMSGT  IGYMSGXT IGYQCBE  IGYZQDRV IGYZQENU IGYZQJPN
    

Fix information

  • Fixed component name

    ENT COBOL FOR Z

  • Fixed component ID

    5655EC600

Applicable component levels

  • R620 PSY UI71972

       UP20/10/10 P F010

  • R621 PSY UI71973

       UP20/10/10 P F010

  • R622 PSY UI71974

       UP20/10/10 P F010

Fix is available

  • Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SS6SG3","label":"Enterprise COBOL for z\/OS"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"620","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
12 December 2023