Bug 15106

Summary: [3.4 only] vector varargs failure passing from altivec to non-altivec code for -m32
Product: gcc Reporter: janis187
Component: targetAssignee: Alan Modra <amodra>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs, marcus
Priority: P2 Keywords: ABI, wrong-code
Version: 3.4.0   
Target Milestone: 3.4.1   
Host: Target: powerpc64-linux powerpc-linux
Build: Known to work: 4.0.0
Known to fail: Last reconfirmed: 2004-04-27 09:18:24
Bug Depends on: 15191    
Bug Blocks:    
Attachments: test case: two source files plus Makefile

Description janis187 2004-04-23 19:56:50 UTC
It should be possible to write a library function that accepts vector
arguments in a variable-length argument list, with that function
compiled with -mno-altivec, the caller compiled with -maltivec, and
both using the same Altivec ABI.  With mainline this works for -m64 but
not with -m32.  The hammer-3.3 branch has the same problem; I haven't
tried it for other branches but assume that 3.4 has does the same thing.
                                                                                
The tarball includes two source files plus a Makefile that will build
them in different combinations.  The specific problem described here
is demonstrated by the following, using a biarch powerpc64-linux
compiler from mainline sources.  Results for this test are not affected
by patches from Alan Modra on April 23 or from Fariborz Jahanian on
April 21.
                                                                                
dufur% $GCC -m32 -maltivec -mabi=altivec -c -o bug_passer.o bug_passer.c
dufur% $GCC -m32 -mno-altivec -mabi=altivec -c -o bug_passee.o bug_passee.c
dufur% $GCC -m32 bug_passer.o bug_passee.o
dufur% a.out
Aborted
                                                                                
If other failing combinations generated by the Makefile are not supported
then they should be documented as not expected to work.
Comment 1 janis187 2004-04-23 19:57:57 UTC
Created attachment 6154 [details]
test case: two source files plus Makefile
Comment 2 Alan Modra 2004-04-27 09:18:23 UTC
Confirmed.  -m32 vector varargs looks badly broken.
Comment 3 Alan Modra 2004-04-28 14:47:16 UTC
prototype patch at http://gcc.gnu.org/ml/gcc/2004-04/msg01316.html
Comment 4 Alan Modra 2004-05-11 16:35:13 UTC
Fixed on mainline and hammer-3_3-branch.  Patches listed in
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15191
Comment 5 Alan Modra 2004-06-10 06:45:28 UTC
Fixed