IV47496: INCORRECT EVALUATION OF BOOL EXPRESSION

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • When compiling with -qipa=level=0, the test case seems to return
    an incorrect boolean value at runtime.
    
    ===== COMPILE COMMAND:
    $ xlC_r -qlist t.cpp
    $ cp t.lst t.ACK.lst
    $ mv a.out ack.out
    $ xlC_r -qlist -qipa=level=0:inline=noauto -qipa=relink t.cpp
    $ cp t.lst t.NAK.lst
    $ mv a.out nak.out
    $ ./ack.out
    $ ./nak.out
    
    
    ===== TESTCASE:
    #include <stdio.h>
    
    struct s {
      bool           b;
    };
    
    static s s_a[] =
    {
      { false } ,
    } ;
    
    bool helper(bool b, const s& sr) {
      return sr.b && !b || !sr.b && b;
    }
    
    int main(int argc, char *argv[]) {
            bool b;
    
            const s& sr = s_a[0];
            b = helper(false, sr);
            printf("notPred: %s\n", b ? "true" : "false");
    }
    
    
    ===== ACTUAL OUTPUT:
    $ ./compile_run
    notPred: false
    notPred: true
    $
    
    
    ===== EXPECTED OUTPUT:
    $ ./compile_run
    notPred: false
    notPred: false
    $
    

Local fix

  • N/A
    

Problem summary

  • USERS AFFECTED:
    Users that compile their program using IPA can be affected by
    this issue.
    
    PROBLEM DESCRIPTION:
    The compiler produces a binary that leads to incorrect runtime
    results due to incorrect IPA branch merging transformation.
    

Problem conclusion

  • The compiler has been fixed to mark the original internal
    labels correctly after an internal transformation.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV47496

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-08-26

  • Closed date

    2013-12-13

  • Last modified date

    2013-12-13

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

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

    LI77600

Fix information

  • Fixed component name

    XL C FOR AIX

  • Fixed component ID

    5725C7100

Applicable component levels

  • RC10 PSY U863898

       UP C



Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

XL C for AIX
Compiler

Software version:

12.1

Reference #:

IV47496

Modified date:

2013-12-13

Translate my page

Machine Translation

Content navigation