IBM Support

IV86897: -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 compile with -O3 and higher maybe affected by this
    issue.
    
    PROBLEM DESCRIPTION:
    The compiler generates incorrect code gen leading to incorrect
    outputs.
    

Problem conclusion

  • The compiler has been fixed to resolve the incorrect code gen
    leading to the incorrect outputs.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV86897

  • 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 / Xsystem

  • Submitted date

    2016-07-14

  • Closed date

    2016-10-19

  • Last modified date

    2016-10-19

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

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

    IV87930

Fix information

  • Fixed component name

    XL C FOR AIX

  • Fixed component ID

    5725C7100

Applicable component levels

  • RC10 PSY

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSCFQM8","label":"Compiler"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.1","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
19 October 2016