IBM Support

LI75584: INCORRECT RESULT FOR THE STATIC ARRAY OF VECTOR

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The following test case results in an incorrect output at
    runtime when compiled as follows:
    
    Compile Line:
    ppuxlc -qaltivec -o test test.c
    
    
    TestCase:
    #include <stdio.h>
    
    #include <altivec.h>
    
    main()
    {
     static vector float v[2] = { { 0.1f, 0.2f, 0.3f, 0.4f },
                                  { 0.9f, 0.8f, 0.7f, 0.6f } };
    
     vector float r;
    
     union { vector float v; float f[4]; } u;
    
     r = (vector float) vec_splat_u32(0);
     r = vec_add(r, v[0]);
     r = vec_add(r, v[1]);
    
     u.v = r;
    
     printf ("%f %f %f %f\n", u.f[0], u.f[1], u.f[2], u.f[3]);
    }
    
    
    ACTUAL OUTPUT:
    $./test
    "0.400000 0.100000 0.200000 0.300000"
    
    
    EXPECTED OUTPUT:
    $./test
    "1.000000 1.000000 1.000000 1.000000"
    

Local fix

  • The result is correct when the array is declared as "auto".
    

Problem summary

  • USER AFFECTED:
    Users that have the static vector array declared in the
    function scope
    and initialized with the vector compound literal are affected
    by this issue.
    
    PROBLEM DESCRIPTION:
    The compiler generated incorrect code to initialize the static
    vector array
    declared in the function scope and initialized with the vector
    compound literal.
    

Problem conclusion

  • The compiler has been fixed to generate correct code to
    initialize the array.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI75584

  • Reported component name

    XL C/C++ SLES10

  • Reported component ID

    5724U8300

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-07-28

  • Closed date

    2010-07-28

  • Last modified date

    2010-07-28

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

    LI74997

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

Fix information

  • Fixed component name

    XL C/C++ SLES10

  • Fixed component ID

    5724U8300

Applicable component levels

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
17 October 2021