IBM Support

LI76239: INCORRECT LOGICAL EXPRESSION EVALUATION

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The following small test case demonstates that the xlf compiler
    have a bug in the evaluation of logical expressions:
    
    ...
     integer*4 x/1/, y/2000/
    ...
         ((.not.((x.eq.1).and.(y.lt.1000))).and.(1.eq.x)) evaluates
    to true
         .not.((.not.((x.eq.1).and.(y.lt.1000))).and.(1.eq.x)) also
    comes out true.
    
    This issue affects XLF V12.1 and XLF V13.1.
    
    
    ===== TESTCASE:
    $cat test_case.f
          program IBM BROKEN FORTRAN
          integer*4 x/1/, y/2000/
    
    c THIS EXPRESSION SHOULD EVALUATE TO TRUE
          write (*,*)'
    ((.not.((x.eq.1).and.(y.lt.1000))).and.(1.eq.x))'
         + ,
    ((.not.((x.eq.1).and.(y.lt.1000))).and.(1.eq.x))
          if (((.not.((x.eq.1).and.(y.lt.1000))).and.(1.eq.x)))
    then
          write (*,*) '-OK-: EVALUATES TO TRUE'
          end if
    c THIS EXPRESSION SHOULD EVALUATE TO FALSE
          write
    (*,*)'.not.((.not.((x.eq.1).and.(y.lt.1000))).and.(1.eq.x))'
         + ,
    .not.((.not.((x.eq.1).and.(y.lt.1000))).and.(1.eq.x))
    c ON IBM, IT ERRONEOUSLY EVALUATES TO TRUE
          if (.not.((.not.((x.eq.1).and.(y.lt.1000))).and.(1.eq.x)))
    then
          write (*,*) '*ERROR*: EVALUATES TO TRUE'
          else
          write (*,*) '-OK-: EVALUATES TO FALSE'
          end if
    
          end
    
    ===== COMPILE COMMAND:
    xlf test_case.f
    
    $./a.out
          ((.not.((x.eq.1).and.(y.lt.1000))).and.(1.eq.x)) T
     -OK-: EVALUATES TO TRUE
     .not.((.not.((x.eq.1).and.(y.lt.1000))).and.(1.eq.x)) T
     *ERROR*: EVALUATES TO TRUE
    

Local fix

  • N/A
    

Problem summary

  • PROBLEM DESCRIPTION: Certain combinations of negated
    short-circuit expressions were evaluated incorrectly.
    
    USERS AFFECTED: Users that depend on short-circuit evaluation.
    

Problem conclusion

  • Problem is fixed in the short-circuit expression generator.
    Apply recommended PTF.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI76239

  • Reported component name

    XL FORTRAN RHEL

  • Reported component ID

    5724U8410

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-06-10

  • Closed date

    2011-06-10

  • Last modified date

    2011-06-10

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

    IZ89350

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

Fix information

  • Fixed component name

    XL FORTRAN RHEL

  • Fixed component ID

    5724U8410

Applicable component levels

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSB259","label":"XL Fortran Advanced Edition for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"C.1","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
24 February 2022