public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/35491]  New: wrong ABI for some struct passing with vector code
Date: Fri, 07 Mar 2008 01:19:00 -0000	[thread overview]
Message-ID: <bug-35491-6528@http.gcc.gnu.org/bugzilla/> (raw)

Take the following code:
#define vector __vector
struct data {
     float f;  //0 - 3
     int i;    // 4 - 7
     double d; // 8 - 15
     vector float v;  // 16 - 31
   };// __attribute__ ((d64_abi));  //size is 32

   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));
   }

--- CUT ---
We get:
_foo:
        mflr r0
        std r0,16(r1)
        stdu r1,-128(r1)
        mfspr r0,256
        stw r0,124(r1)
        oris r0,r0,0x2000
        mtspr 256,r0
        li r0,16
        lfs f1,0(r3)
        lvx v2,r3,r0
        mr r10,r4  <--- note r10
        lfd f2,8(r3)
        lwz r5,4(r3)
        li r3,10
        bl L_bar$stub
        addi r1,r1,128
        lwz r12,-4(r1)
        mtspr 256,r12
        ld r0,16(r1)
        mtlr r0
        blr

--- CUT ---
With Apple's compiler we get:
_foo:
        mfspr r0,256
        stw r0,-12(r1)
        oris r0,r0,0x2000
        mtspr 256,r0
        mflr r0
        mr r9,r4  <--- NOTE r9
        std r0,16(r1)
        stdu r1,-128(r1)
        li r0,16
        nop
        lfs f1,0(r3)
        lfd f2,8(r3)
        lwz r5,4(r3)
        lvx v2,r3,r0
        li r3,10
        bl L_bar$stub
        addi r1,r1,128
        lwz r12,-12(r1)
        mtspr 256,r12
        ld r0,16(r1)
        mtlr r0
        blr


-- 
           Summary: wrong ABI for some struct passing with vector code
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code, ABI
          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=35491


             reply	other threads:[~2008-03-07  1:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-07  1:19 pinskia at gcc dot gnu dot org [this message]
2008-03-11  0:57 ` [Bug target/35491] " pinskia at gcc dot gnu dot org
2008-03-11  0:57 ` pinskia at gcc dot gnu dot org
2010-07-24  8:41 ` iains at gcc dot gnu dot org
2010-07-27 13:24 ` iains at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-35491-6528@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).