Take the following piece of code:
#define vector __vector
struct data {
     vector float v;
   };

   extern int bar (int a, struct data b, void *c);

   int foo (struct data *inp_r3, void *inp_r4)
   {
     return bar(10, *inp_r3, ((void *) inp_r4));
   }

Right now we sibcall with -O2 and the lvx instruction gets removed:
_foo:
        mfspr r0,256
        stw r0,-4(r1)
        oris r0,r0,0x2000
        mtspr 256,r0
        li r3,10
        lwz r12,-4(r1)
        mtspr 256,r12
        b L_bar$stub


-- 
           Summary: Wrong code with altivec register passing and sibcalling
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc64-darwin


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

Reply via email to