IBM Support

PH68831: METAL C LP64 CAUSES EXTRA LEVEL INDIRECTION FOR PARM LIST

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • With the following testcase, we are able to represent an extra
    level of redirection in the generated Metal C assembler
    instructions with the mixed AMODE calls and DEBUG:
    
    
    ===== TESTCASE:
    
    >cat test.c
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    
    #include "./test.h"
    
    TRAREA tr_area ;
    
    int main(){
         strcpy(tr_area.prefix,"TAMAU");
         tamrasmt(&tr_area);
         return 0;
    
    }
    >cat test.h
    #pragma linkage(tamrasmt, OS)
    
    struct trarea_t {
    char *__ptr32 text ;
    volatile void *__ptr32 workarea ;
    unsigned short function_code ;
    char ddname[8] ;
    char prefix[9] ;
    char fill[7] ;
    } ;
    
    typedef struct trarea_t TRAREA ;
    
    void tamrasmt( TRAREA * ) __attribute__((amode31)) ;
    >
    ==== COMPILE LINE:
    
    > xlc -S -Wc,"metal, langlvl(extended),
    DEBUG(FORMAT(DWARF),LEVEL(9),NOHOOK,SYMBOL), sscom, NOSE, ilp32,
    
    LIST, SOURCE"
    
    
    *  tamrasmt(&tr_area);
          000012
          LLGTR 14,14
         000012
          NIHF  14,X'00000000'
         000012
          ST    14,216(,13)             #wtemp_17
         000012    -- extra indirection here
          LA    14,216(,13)             #wtemp_17
         000012    -- extra indirection here
          LLGT  15,=V(TAMRASMT)
         000012
          SAM31
         000012
          LA    1,152(,13)              #MX_TEMP1
         000012
          ST    14,152(,13)             #MX_TEMP1
         000012
          MVC   8(4,13),#NAB_1+4
         000012
          BASR  14,15
         000012
          SAM64
         000012
    
    DEBUG option generates extra level of indirection #wtemp17
    section.
    

Local fix

  • Remove DEBUG/TEST option or use NODEBUG/NOTEST.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED: Users of IBM XLC/C++ V2.5 for z/OS           *
    *                 and up with the METAL option and source      *
    *                 code that                                    *
    *                 makes a mixed amode call to a function       *
    *                 marked as                                    *
    *                 #pragma linkage OS with a pointer argument   *
    *                 that requires                                *
    *                 the compiler to convert to a different sized *
    *                 pointer. The compilation also has            *
    *                 DEBUG/TEST options enabled.                  *
    ****************************************************************
    * PROBLEM DESCRIPTION: The program may generate code           *
    *                      that passes a wrong argument to the     *
    *                      callee function.                        *
    ****************************************************************
    * RECOMMENDATION: Install the PTF                              *
    ****************************************************************
    N/A
    

Problem conclusion

  • Install the PTF
    

Temporary fix

Comments

APAR Information

  • APAR number

    PH68831

  • Reported component name

    C/C++ FOR MVS

  • Reported component ID

    56551210A

  • Reported release

    7C0

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2025-11-04

  • Closed date

    2026-03-27

  • Last modified date

    2026-05-02

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

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

Modules/Macros

  • CCNECICS CCNECWI  CCNED240 CCNEDSCT CCNEDWRT CCNEFILT CCNEHIFC
    CCNEIPA3 CCNEIPAO CCNEMDEP CCNEOPTP CCNEP    CCNEPP   CCNETBY
    CCNMSGE  CCNMSGT  CCNQIPA
    

Fix information

  • Fixed component name

    C/C++ FOR MVS

  • Fixed component ID

    56551210A

Applicable component levels

  • R7C0 PSY UO07332

       UP26/04/23 P F604

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.

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSTLTF","label":"z\/OS XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7C0","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
02 May 2026