IBM Support

LI77347: XLC FAILS TO IDENTIFY INVALID RESTRICT KEYWORD USE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The following testcase attempts to use the "restrict" cv
    qualifier for a pointer to function but the usage is incorrect
    (line 2 and line 4). xlC compiler fails to identify the invalid
    usage on line 4 and also produces Internal Compiler Error if
    the test case is compiled at -O2.
    
    ===== TESTCASE:
    $cat xlc12_defect_invalidrestrict.c
    typedef void (* function_ptr_t)(void);
    inline void invoke_function(function_ptr_t __restrict__
    function) {
    }
    inline void invoke_function2(void (* __restrict__
    function)(void)) {
    }
    void some_function(void) {
    
    signed main(void) {
       invoke_function(&some_function);
       invoke_function2(&some_function);
       return 0;
    }
    
    ===== ACTUAL OUTPUT:
    $xlC -+ xlc12_defect_invalidrestrict.c
    "xlc12_defect_invalidrestrict.c", line 2.13: 1540-2606 (W)
    "restrict" can only qualify a pointer or reference type.  The
    "restrict" keyword is ignored.
    $
    $xlC -+ xlc12_defect_invalidrestrict.c -O
    "xlc12_defect_invalidrestrict.c", line 2.13: 1540-2606 (W)
    "restrict" can only qualify a pointer or reference type.  The
    "restrict" keyword is ignored.
        1500-004: (U) INTERNAL COMPILER ERROR while compiling ----.
     Compilation ended.  Contact your Service Representative and
    provide the following information: Internal abort. For more
    information visit:
    http://www.ibm.com/support/docview.wss?uid=swg21110810
    
    ===== EXPECTED OUTPUT:
    Issue warning messages for both line 2 and 4, and do not
    produce Internal Compiler Error with -O.
    

Local fix

  • Correct the test case syntax.
    

Problem summary

  • PROBLEM DESCRIPTION: The compiler allowed an invalid use of
    restrict on a pointer to function
    
    USERS AFFECTED: users of the restrict keyword on a pointer to
    function
    

Problem conclusion

  • The problem has been resolved
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77347

  • Reported component name

    XL C/C++ FOR LI

  • Reported component ID

    5725C7300

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-04-27

  • Closed date

    2013-04-27

  • Last modified date

    2013-04-27

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

    IV35414

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

Fix information

  • Fixed component name

    XL C/C++ FOR LI

  • Fixed component ID

    5725C7300

Applicable component levels

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

Document Information

Modified date:
14 October 2021