IBM Support

IV52638: INTERNAL COMPILER ERROR WITH -Q32 -O2

Fixes are available

XL C for AIX Fix Pack 8 (March 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 8 (March 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C/C++ for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 21 (January 2019 Update) for 12.1
XL C for AIX Fix Pack 21 (January 2019 Update) for 12.1

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • The following test case shows the internal compiler when
    compiled with xlC_r -q32 -O2
    
    #ifdef __cplusplus
    #include <builtins.h>
    #endif
    
    #include <stdint.h>
    
    #define plasma_endian_swap64_const(x)          \
            ( (((x)>>56))                          \
            | (((x)<<40) & 0x00FF000000000000LL)   \
            | (((x)<<24) & 0x0000FF0000000000LL)   \
            | (((x)<<8)  & 0x000000FF00000000LL)   \
            | (((x)>>8)  & 0x00000000FF000000LL)   \
            | (((x)>>24) & 0x0000000000FF0000LL)   \
            | (((x)>>40) & 0x000000000000FF00LL)   \
            | (((x)<<56)) )
    
    static uint64_t
    plasma_endian_swap64_func (const uint64_t x)
    {
        return __rldimi((uint64_t)__load4r(((uint32_t *)(&x))+1),
                        (uint64_t)__load4r(((uint32_t *)(&x))),
                        32u, 0xFFFFFFFF00000000uLL);
    }
    
    #define plasma_endian_swap64(x)     \
      (__builtin_constant_p(x)          \
        ? plasma_endian_swap64_const(x) \
        : plasma_endian_swap64_func(x))
    
    int main (void)
    {
        const struct {
            uint64_t d_input;
        } DATA = { 0xFFFFFFFFFFFFFFFFuLL };
    
    #ifndef _GOOD_ONE /* compiler failure */
        const uint64_t INPUT = DATA.d_input;
        uint64_t hostToLE = plasma_endian_swap64(INPUT);
    #else /* compiles successfully */
        uint64_t hostToLE = plasma_endian_swap64(DATA.d_input);
    #endif
    
    #if 0
    /* (not needed to reproduce compile failure) */
        const uint64_t EXPECTED = 0xFFFFFFFFFFFFFFFFuLL;
        return (EXPECTED != hostToLE);  /* 0 == success; 1 ==
    failure */
    #endif
    
        return 0;
    }
    

Local fix

  • Use -q64
    

Problem summary

  • PROBLEM DESCRIPTION: Internal Compiler Error with
    __builtin_constant_p with -q32 -O2
    
    USERS AFFECTED: who use __builtin_constant_p and the expression
    is complex enough
    

Problem conclusion

  • Problem  is fixed.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV52638

  • 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

  • Submitted date

    2013-11-29

  • Closed date

    2014-03-18

  • Last modified date

    2014-03-19

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

  • 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



Document information

More support for: XL C for AIX
Compiler

Software version: 12.1

Reference #: IV52638

Modified date: 19 March 2014