public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "janis187 at us dot ibm dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/14960] New: -maltivec affects vector return with -mabi=no-altivec
Date: Wed, 14 Apr 2004 23:35:00 -0000	[thread overview]
Message-ID: <20040414231341.14960.janis187@us.ibm.com> (raw)

The -maltivec instruction should enable the use of the AltiVec
instruction set without affecting how function values are returned.
The documentation in invoke.texi says for -maltivec, "you may also
need to set -mabi=altivec to adjust the current ABI with Altivec
ABI enhancements", but that doesn't appear to be required; two modules
that are both compiled with either -mabi=altivec or -mabi=no-altivec
should be intercallable, even if they pass vector arguments or have
vector return values.  Vector function return values are passed
differently, though, depending on whether -maltivec is specified
instead of which ABI is specified.
                                                                                
This test case fails when either of the two files is compiled with
-maltivec and the other is compiled without it, and both are compiled
with -mabi=no-altivec.  This is for either -m32 or -m64 for
powerpc64-linux, with current GCC 3.4 branch.  I'll try other branches
soon and report what I find.
                                                                                
--- bug.c --------------------------------------------------------------
/* Call a function whose return value is a vector.  Define the data that
   the function will use as input, and verify that it returned the
   correct values.  */
                                                                                
extern __attribute__((vector_size(16))) int foo (void);
                                                                                
__attribute__((vector_size(16))) int i = { 100, 200, 300, 400 };
__attribute__((vector_size(16))) int j = { 10, 20, 30, 40 };
__attribute__((vector_size(16))) int k;
                                                                                
extern void abort (void);
extern __attribute__((vector_size(16))) int foo (void);
                                                                                
void
check ()
{
    union {
        __attribute__((vector_size(16))) int v;
        int i[4];
    } u;
                                                                                
    u.v = k;
    if (u.i[0] != 110 || u.i[1] != 220 || u.i[2] != 330 || u.i[3] != 440)
        abort ();
}
                                                                                
int
main ()
{
    k = foo ();
    check ();
    return 0;
}
--- buga.c -------------------------------------------------------------
/* Return a vector.  */
                                                                                
extern __attribute__((vector_size(16))) int i, j;
                                                                                
__attribute__((vector_size(16))) int
foo (void)
{
    return i + j;
}
------------------------------------------------------------------------

-- 
           Summary: -maltivec affects vector return with -mabi=no-altivec
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: janis187 at us dot ibm dot com
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc64-unknown-linux-gnu


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


             reply	other threads:[~2004-04-14 23:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-14 23:35 janis187 at us dot ibm dot com [this message]
2004-04-14 23:49 ` [Bug target/14960] " pinskia at gcc dot gnu dot org
2004-04-19 11:39 ` hpenner at de dot ibm dot com
2004-04-19 11:44 ` aldyh at redhat dot com
2004-04-22 22:06 ` janis187 at us dot ibm dot com
2004-04-24 10:32 ` cvs-commit at gcc dot gnu dot org
2004-04-28  7:20 ` cvs-commit at gcc dot gnu dot org
2004-06-05 20:33 ` mmitchel at gcc dot gnu dot org
2004-06-10  2:02 ` amodra at bigpond dot net dot au
2004-06-10  6:15 ` [Bug target/14960] [3.4 only] " cvs-commit at gcc dot gnu dot org
2004-06-10  6:40 ` amodra at bigpond dot net dot au

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=20040414231341.14960.janis187@us.ibm.com \
    --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).