public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/14960] New: -maltivec affects vector return with -mabi=no-altivec
@ 2004-04-14 23:35 janis187 at us dot ibm dot com
  2004-04-14 23:49 ` [Bug target/14960] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: janis187 at us dot ibm dot com @ 2004-04-14 23:35 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/14960] -maltivec affects vector return with -mabi=no-altivec
  2004-04-14 23:35 [Bug target/14960] New: -maltivec affects vector return with -mabi=no-altivec janis187 at us dot ibm dot com
@ 2004-04-14 23:49 ` pinskia at gcc dot gnu dot org
  2004-04-19 11:39 ` hpenner at de dot ibm dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-14 23:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-14 23:25 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-04-14 23:25:07
               date|                            |
   Target Milestone|---                         |3.4.1


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/14960] -maltivec affects vector return with -mabi=no-altivec
  2004-04-14 23:35 [Bug target/14960] New: -maltivec affects vector return with -mabi=no-altivec janis187 at us dot ibm dot com
  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
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hpenner at de dot ibm dot com @ 2004-04-19 11:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hpenner at de dot ibm dot com  2004-04-19 09:25 -------
Yes, this is a bug. Looks to me, that rs6000_function_arg has a wrong check.
I think, we should check for TARGET_ALTIVEC_ABI instead of TARGET_ALTIVEC,
when we decide how to pass return value.


Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.397.2.35
diff -u -p -r1.397.2.35 rs6000.c
--- rs6000.c    30 Mar 2004 09:01:22 -0000      1.397.2.35
+++ rs6000.c    19 Apr 2004 09:21:52 -0000
@@ -16200,7 +16200,7 @@ rs6000_function_value (valtype, func)
           && TARGET_HARD_FLOAT
           && SPLIT_COMPLEX_ARGS)
     return rs6000_complex_function_value (mode);
-  else if (TREE_CODE (valtype) == VECTOR_TYPE && TARGET_ALTIVEC)
+  else if (TREE_CODE (valtype) == VECTOR_TYPE && TARGET_ALTIVEC_ABI)
     regno = ALTIVEC_ARG_RETURN;
   else
     regno = GP_ARG_RETURN;



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldyh at redhat dot com


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/14960] -maltivec affects vector return with -mabi=no-altivec
  2004-04-14 23:35 [Bug target/14960] New: -maltivec affects vector return with -mabi=no-altivec janis187 at us dot ibm dot com
  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
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: aldyh at redhat dot com @ 2004-04-19 11:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From aldyh at redhat dot com  2004-04-19 10:55 -------
Subject: Re:  -maltivec affects vector return with -mabi=no-altivec

> Yes, this is a bug. Looks to me, that rs6000_function_arg has a wrong check.
> I think, we should check for TARGET_ALTIVEC_ABI instead of TARGET_ALTIVEC,
> when we decide how to pass return value.

Hartmut.  This patch is OK.  Please submit it to gcc-patches and
commit it as preapproved by me.  Then close the PR.

Thank you.
Aldy


-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/14960] -maltivec affects vector return with -mabi=no-altivec
  2004-04-14 23:35 [Bug target/14960] New: -maltivec affects vector return with -mabi=no-altivec janis187 at us dot ibm dot com
                   ` (2 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janis187 at us dot ibm dot com @ 2004-04-22 22:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From janis187 at us dot ibm dot com  2004-04-22 21:53 -------
Is this on hold because of other discussions about how altivec options are
supposed to interact?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hpenner at de dot ibm dot
                   |                            |com


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/14960] -maltivec affects vector return with -mabi=no-altivec
  2004-04-14 23:35 [Bug target/14960] New: -maltivec affects vector return with -mabi=no-altivec janis187 at us dot ibm dot com
                   ` (3 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-04-24 10:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-04-24 06:37 -------
Subject: Bug 14960

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	amodra@gcc.gnu.org	2004-04-24 06:37:20

Modified files:
	gcc            : ChangeLog 
	gcc/config/rs6000: rs6000.c rs6000.h 

Log message:
	PR target/14960
	* config/rs6000/rs6000.c (rs6000_stack_info): Rename total_raw_size
	to non_fixed_size, and leave out fixed_size from the sum.
	(generate_set_vrsave): Correct clobbers.
	(rs6000_emit_epilogue): Test TARGET_ALTIVEC with TARGET_ALTIVEC_SAVE.
	(rs6000_function_value): Test TARGET_ALTIVEC and TARGET_ALTIVEC_ABI.
	(rs6000_libcall_value): Likewise.
	* config/rs6000/rs6000.h (FUNCTION_VALUE_REGNO_P): Likewise.
	(FUNCTION_ARG_REGNO_P): Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3477&r2=2.3478
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&r1=1.629&r2=1.630
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.h.diff?cvsroot=gcc&r1=1.319&r2=1.320



-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/14960] -maltivec affects vector return with -mabi=no-altivec
  2004-04-14 23:35 [Bug target/14960] New: -maltivec affects vector return with -mabi=no-altivec janis187 at us dot ibm dot com
                   ` (4 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-04-28  7:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-04-28 05:21 -------
Subject: Bug 14960

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	hammer-3_3-branch
Changes by:	amodra@gcc.gnu.org	2004-04-28 05:21:36

Modified files:
	gcc            : ChangeLog.hammer 
	gcc/config/rs6000: rs6000.c rs6000.h 

Log message:
	PR target/14960
	* config/rs6000/rs6000.c (rs6000_stack_info): Rename total_raw_size
	to non_fixed_size, and leave out fixed_size from the sum.
	(generate_set_vrsave): Correct clobbers.
	(rs6000_emit_epilogue): Test TARGET_ALTIVEC with TARGET_ALTIVEC_SAVE.
	(rs6000_function_value): Test TARGET_ALTIVEC and TARGET_ALTIVEC_ABI.
	(rs6000_libcall_value): Likewise.
	* config/rs6000/rs6000.h (FUNCTION_VALUE_REGNO_P): Likewise.
	(FUNCTION_ARG_REGNO_P): Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.hammer.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.1.2.392&r2=1.1.2.393
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.397.2.37&r2=1.397.2.38
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.h.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.234.2.24&r2=1.234.2.25



-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/14960] -maltivec affects vector return with -mabi=no-altivec
  2004-04-14 23:35 [Bug target/14960] New: -maltivec affects vector return with -mabi=no-altivec janis187 at us dot ibm dot com
                   ` (5 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-06-05 20:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-06-05 20:33 -------
Would one of you please apply the patch to 3.4 and close the PR?

-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/14960] -maltivec affects vector return with -mabi=no-altivec
  2004-04-14 23:35 [Bug target/14960] New: -maltivec affects vector return with -mabi=no-altivec janis187 at us dot ibm dot com
                   ` (6 preceding siblings ...)
  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
  9 siblings, 0 replies; 11+ messages in thread
From: amodra at bigpond dot net dot au @ 2004-06-10  2:02 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |amodra at bigpond dot net
                   |dot org                     |dot au
             Status|NEW                         |ASSIGNED


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/14960] [3.4 only] -maltivec affects vector return with -mabi=no-altivec
  2004-04-14 23:35 [Bug target/14960] New: -maltivec affects vector return with -mabi=no-altivec janis187 at us dot ibm dot com
                   ` (7 preceding siblings ...)
  2004-06-10  2:02 ` amodra at bigpond dot net dot au
@ 2004-06-10  6:15 ` cvs-commit at gcc dot gnu dot org
  2004-06-10  6:40 ` amodra at bigpond dot net dot au
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-10  6:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-06-10 06:15 -------
Subject: Bug 14960

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	amodra@gcc.gnu.org	2004-06-10 06:15:32

Modified files:
	gcc            : ChangeLog 
	gcc/config/rs6000: rs6000.c rs6000.h 

Log message:
	PR target/14960
	2004-04-24  Alan Modra  <amodra@bigpond.net.au>
	* config/rs6000/rs6000.c (rs6000_stack_info): Rename total_raw_size
	to non_fixed_size, and leave out fixed_size from the sum.
	(generate_set_vrsave): Correct clobbers.
	(rs6000_emit_epilogue): Test TARGET_ALTIVEC with TARGET_ALTIVEC_SAVE.
	(rs6000_function_value): Test TARGET_ALTIVEC and TARGET_ALTIVEC_ABI.
	(rs6000_libcall_value): Likewise.
	* config/rs6000/rs6000.h (FUNCTION_VALUE_REGNO_P): Likewise.
	(FUNCTION_ARG_REGNO_P): Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.486&r2=2.2326.2.487
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.576.2.21&r2=1.576.2.22
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.306.4.5&r2=1.306.4.6



-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/14960] [3.4 only] -maltivec affects vector return with -mabi=no-altivec
  2004-04-14 23:35 [Bug target/14960] New: -maltivec affects vector return with -mabi=no-altivec janis187 at us dot ibm dot com
                   ` (8 preceding siblings ...)
  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
  9 siblings, 0 replies; 11+ messages in thread
From: amodra at bigpond dot net dot au @ 2004-06-10  6:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From amodra at bigpond dot net dot au  2004-06-10 06:40 -------
Fixed

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-06-10  6:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-14 23:35 [Bug target/14960] New: -maltivec affects vector return with -mabi=no-altivec janis187 at us dot ibm dot com
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

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).