[Bug target/14899] New: wrong code due to change in compatibility rules for vector types

bonzini at gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Apr 9 07:36:00 GMT 2004


> #include <altivec.h>
> int main()
> {
>        __vector signed short  res;
>        __vector signed short t8;
>        __vector signed short t9;
>        res = vec_subs(t8, t9);
> }

is incorrectly using vsubuh instead of vsubsh.

This is because __builtin_types_compatible_p (__vector bool short, __vector 
signed short) is returning 1. 

This test case says that it said 1:

int f()
{
return __builtin_types_compatible_p (__vector bool short,
                                     __vector signed short);
}

That's my fault (my vector patch's fault).  It is easy to fix by modifying 
comptypes (I had it in my tree for a while before submitting the patch, but 
caused other regressions on i686, IIRC), but overall it seems quite fragile... 

Paolo

-- 
           Summary: wrong code due to change in compatibility rules for
                    vector types
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bonzini at gnu dot org
                CC: apinski at apple dot com,bonzini at gnu dot
                    org,fjahanian at apple dot com,gcc-bugs at gcc dot gnu
                    dot org,zlaski at apple dot com
GCC target triplet: powerpc-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14899



More information about the Gcc-bugs mailing list