IBM Support

IZ81166: NONLINEAR EQUATION SOLVER INCORRECT OUTPUT

Fixes are available

September 2010 PTF for XL C for AIX, V11.1
September 2010 PTF for XL C/C++ for AIX, V11.1
January 2011 PTF for XL C/C++ for AIX, V11.1
May 2011 PTF for XL C for AIX, V11.1
May 2011 PTF for XL C/C++ for AIX, V11.1
August 2011 PTF for XL C/C++ for AIX, V11.1
November 2011 PTF for XL C/C++ for AIX, V11.1
January 2012 PTF for XL C for AIX, V11.1
January 2012 PTF for XL C/C++ for AIX, V11.1
April 2012 PTF for XL C for AIX, V11.1
April 2012 PTF for XL C/C++ for AIX, V11.1
July 2012 PTF for XL C/C++ for AIX, V11.1
October 2012 PTF for XL C for AIX, V11.1
October 2012 PTF for XL C/C++ for AIX, V11.1
February 2013 PTF for XL C for AIX, V11.1
February 2013 PTF for XL C/C++ for AIX, V11.1
XL C/C++ for AIX Fix Pack 14 (May 2013 PTF) for 11.1
XL C for AIX Fix Pack 14 (May 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 15 (August 2013 PTF) for 11.1
XL C for AIX Fix Pack 15 (August 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 16 (November 2013 PTF) for 11.1
XL C for AIX Fix Pack 17 (February 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 17 (February 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 18 (May 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 19 (August 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 20 (November 2014 PTF) for 11.1
XL C for AIX Fix Pack 21 (April 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 21 (April 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 22 (September 2015 PTF) for 11.1
XL C for AIX Fix Pack 23 (March 2016 PTF) for 11.1
XL C/C++ for AIX Fix Pack 23 (March 2016 PTF) for 11.1
XL C for AIX Fix Pack 24 (September 2016 PTF) for 11.1
XL C/C++ for AIX Fix Pack 24 (September 2016 PTF) for 11.1
January 2011 PTF for XL C for AIX, V11.1
August 2011 PTF for XL C for AIX, V11.1
November 2011 PTF for XL C for AIX, V11.1
July 2012 PTF for XL C for AIX, V11.1
XL C for AIX Fix Pack 16 (November 2013 PTF) for 11.1
XL C for AIX Fix Pack 18 (May 2014 PTF) for 11.1
XL C for AIX Fix Pack 19 (August 2014 PTF) for 11.1
XL C for AIX Fix Pack 20 (November 2014 PTF) for 11.1
XL C for AIX Fix Pack 22 (September 2015 PTF) for 11.1

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Incorrect output is generated when using optimization -O3 or
    in conjunction with -q64.
    
    -------------------------------------------------------------
    Test case(test.c):
    
     #include <stdio.h>
     #include <math.h>
    
     int never = 0;
    
     int myfoo(double *x)
     {
       int rc, i, ok, j;
    
       rc = 0;
       x[0] = 0;
       x[1] = 0.5;
    
       if (never)
         rc |= 2;
    
       printf("  %d %g\n", rc, x[1]);
       x[1] = floor(x[1]);
       printf("  %d %g\n", rc, x[1]);
    
       if ((x[0] == x[1]) && (x[1] < 1.0))
          rc |= 1;
    
       if (rc == 0)
           ;
       else if (never)
       {
         ok= 1;
         for (i=0; i<10;i++)
           for (j=0; j<10; j++)
             if (x[i])
               ok=0;
       }
    
       if (rc)
        printf("GOOD!  %d %g %g\n", rc, x[0], x[1]);
       else
        printf("BAD!   %d %g %g\n", rc, x[0], x[1]);
       return (rc);
     }
    
     int main()
     {
       double x[10] = {0};
       return myfoo(x);
     }
    -------------------------------------------------------------
    
    -------------------------------------------------------------
    Reproduce Instructions:
    
    Compiling with XL C/C++ V11.1
    
    # xlC -q64 -O3 test.c -o bad
    # ./bad
       0 0.5
       0 0
     BAD!   0 0 0
    
    
    
    Compiling with XL C/C++ V10.1
    
    # xlC -q64 -O3 test.c -o good
    # ./bad
       0 0.5
       0 0
     GOOD!   1 0 0
    -------------------------------------------------------------
    

Local fix

  • N/A
    

Problem summary

  • USERS AFFECTED:
    Users that compile at -O3 or higher maybe affected by this
    issue.
    
    PROBLEM DESCRIPTION:
    The compiler was performing an incorrect if conversion that
    resulted in an incorrect output.
    

Problem conclusion

  • The compiler has been fixed to properly perform the if
    conversion.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IZ81166

  • Reported component name

    XL C FOR AIX

  • Reported component ID

    5724X1200

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-07-28

  • Closed date

    2010-09-10

  • Last modified date

    2010-09-24

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

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

    LI75785

Fix information

  • Fixed component name

    XL C FOR AIX

  • Fixed component ID

    5724X1200

Applicable component levels

[{"Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGH2K","label":"XL C for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1"}]

Document Information

Modified date:
06 October 2021