PM94878: MISSING SRDA INSTRUCTION WITH HGPR AND OPT

A fix is available

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • When compiling the test case below with HGPR and optimization,
    the SRDA instruction is missing which causes an incorrect output
    at runtime. If you remove either HGPR or optimize options, the
    SRDA instruction is present.
    
    ===== COMPILE COMMAND:
    xlc test.c
    -Wc,"LIST(test.lst),NOTERM,XR,HGPR,ARCH(5),optimize"
    
    
    ===== TESTCASE:
    $ cat test.c
    #include <stdio.h>
    #include <stdlib.h>
    
    static void longtest (long long lwert)
    {
        int test;
        test = lwert & 0x00000000ffffffffLL;
        if (test != 0)
        {
           printf ("lwert right = %x\n", test);
        }
        else
        {
           test = lwert >> 32;
           printf ("lwert left = %x\n", test);
        }
    }
    
    int main (void)
    {
        long long lwert;
        int l1;
        int l2;
        int *p;
        char zeile [85];
        fgets (zeile, 80, stdin);
        l1 = atoi (zeile);
        fgets (zeile, 80, stdin);
        l2 = atoi (zeile);
        lwert = l1;
        lwert <<= 32;
        lwert += l2;
        p = (int *) (&lwert);
        printf ("long long first part = %x\n", *p);
        printf ("long long second part = %x\n", *(p + 1));
        longtest (lwert);
    }
    $
    
    ===== ACTUAL OUTPUT:
    $ xlc test.c
    -Wc,"LIST(test.lst),NOTERM,XR,HGPR,ARCH(5),optimize"
    $ grep SRDA test.lst
    $
    $ ./a.out
    32768
    0
    long long first part = 8000
    long long second part = 0
    lwert left = 0
    $
    
    
    
    ===== EXPECTED OUTPUT:
    
    $xlc test.c -Wc,"LIST(test.lst),NOTERM,XR,HGPR,ARCH(5),optimize"
    $ grep SRDA test.lst
     0001C4  8E40  0020        000014 |       +         SRDA
    r4,32
    $ ./a.out
    32768
    0
    long long first part = 8000
    long long second part = 0
    lwert left = 8000
    $
    

Local fix

  • N/A
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED: Users who are using 64-bit types in 31-bit   *
    *                 mode, e.g. long long, with HGPR option +     *
    *                 OPT                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION: Value numbering produces 0, which is    *
    *                      the value of the high half of the       *
    *                      register, when mode is 31 and we use    *
    *                      64-bits of the register, when HGPR      *
    *                      option is specified.                    *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    

Problem conclusion

  • Apply provided service.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM94878

  • Reported component name

    C/C++ FOR MVS

  • Reported component ID

    56551210A

  • Reported release

    770

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-08-09

  • Closed date

    2013-10-03

  • Last modified date

    2013-12-04

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

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

    PM98343 UK98192 PI06231 PI07452

Modules/Macros

  •    CCNECICS CCNECWI  CCNEDSCT CCNEDWRT CCNED1C0
    CCNEFILT CCNEHIFC CCNEMDEP CCNEOPTP CCNEP    CCNEPP   CCNETBY
    CCNMSGE  CCNMSGT
    

Fix information

  • Fixed component name

    C/C++ FOR MVS

  • Fixed component ID

    56551210A

Applicable component levels

  • R770 PSY UK98192

       UP13/10/13 P F310

Fix is available

  • Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.



Rate this page:

(0 users)Average rating

Document information


More support for:

z/OS family

Software version:

7.7

Operating system(s):

z/OS

Reference #:

PM94878

Modified date:

2013-12-04

Translate my page

Machine Translation

Content navigation