IBM Support

IV87930: -QHOT=LEVEL=1 AND -Q64 CAUSING INCORRECT OUTPUT

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • The provided test case when compiled with -q64 and
    -qhot=level=1, displays incorrect output at runtime.
    
    ===== COMPILE COMMAND:
    xlC_r -q64 -O2 -qdebug=noopt -qhot=level=1 test.cpp
    
    ===== TESTCASE:
    $ cat test.cpp
    #include <assert.h>
    #include <alloca.h>
    #include <signal.h>
    #include <sys/mman.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <sys/ucontext.h>
    #include <setjmp.h>
    #include <string.h>
    #include <unistd.h>
    #include <errno.h>
    
    #include <pthread.h>
    
    
    
    int main (int argc, const char** argv) {
      const size_t size = 200;
      const char* start_marker = "#start#";
      const char* end_marker = "#the end#";
      char* data = (char *)malloc(sizeof(char) * size);
    
      for (size_t i = strlen(start_marker); i < size; i++) {
        //int off = i - ((i/10)*10);
        //data[i] = '0' + off;
        data[i] = '0' + (i % 10);
      }
      for (int i = 0; i < size -1; ++i) {
        printf("%c", data[i]);
      }
      printf("\n");
    }
    $
    
    
    ===== ACTUAL OUTPUT:
    $ ./a.out
    7890123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]?_`abcdefghijkl
    mnopqrstuvwxyz{|}
    
    $
    
    ===== EXPECTED OUTPUT:
    $ ./a.out
    7890123456789012345678901234567890123456789012345678901234567890
    1234567890123456789012345678901234567890123456789012345678901234
    5678901234567890123456789012345678901234567890123456789012345678
    $
    

Local fix

  • N/A
    

Problem summary

  • USERS AFFECTED:
    Users who use O3 are potentially affected by this issue.
    
    PROBLEM DESCRIPTION:
    The compiler generates incorrect code generation.
    

Problem conclusion

  • The compiler has been fixed to resolve this issue.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV87930

  • Reported component name

    XL C FOR AIX

  • Reported component ID

    5725C7100

  • Reported release

    D10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-08-15

  • Closed date

    2016-08-15

  • Last modified date

    2016-08-15

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

    IV86897

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

Fix information

  • Fixed component name

    XL C FOR AIX

  • Fixed component ID

    5725C7100

Applicable component levels

  • RD10 PSY

       



Document information

More support for: XL C for AIX
Compiler

Software version: 13.1

Reference #: IV87930

Modified date: 15 August 2016