Bug 14567 - [3.4 only] long double and va_arg complex args
Summary: [3.4 only] long double and va_arg complex args
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.1
Assignee: Alan Modra
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2004-03-13 07:10 UTC by Alan Modra
Modified: 2004-10-30 21:09 UTC (History)
1 user (show)

See Also:
Host:
Target: powerpc64-linux
Build:
Known to work: 4.0.0
Known to fail: 3.4.0
Last reconfirmed: 2004-03-13 07:20:17


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Modra 2004-03-13 07:10:55 UTC
va_arg on complex float and complex int is currently broken.
non-va_arg long double is too if split over reg and stack.

This bug report is to remind me to fix this for 3.4.1
Comment 1 CVS Commits 2004-03-13 07:14:16 UTC
Subject: Bug 14567

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	amodra@gcc.gnu.org	2004-03-13 07:14:13

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

Log message:
	PR target/14567
	* config/rs6000/rs6000.h (UNITS_PER_ARG, RS6000_ARG_SIZE): Delete.
	(HARD_REGNO_MODE_OK): Disallow TFmode for fp31.
	* config/rs6000/rs6000.c (rs6000_arg_size): New function.
	Update all users of RS6000_ARG_SIZE.
	(function_arg_advance): Count fregno using mode size.
	(function_arg): Handle long double split over regs and memory.
	(function_arg_partial_nregs): Likewise.
	(rs6000_va_arg): Repackage complex args.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3155&r2=2.3156
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&r1=1.607&r2=1.608
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.h.diff?cvsroot=gcc&r1=1.316&r2=1.317

Comment 2 Andrew Pinski 2004-03-13 07:15:48 UTC
Confirmed.
Comment 3 Alan Modra 2004-03-13 07:24:21 UTC
Patch at http://gcc.gnu.org/ml/gcc-patches/2004-02/msg00632.html
Patch committed to mainline is slightly different to accommodate other changes
to function_arg.
Comment 4 Andrew Pinski 2004-03-17 06:27:30 UTC
I think this changes the alignment of structs passing on powerpc-apple-darwin.  The testcase libffi/
testsuite/libffi.call/cls_3_1byte.c fails now.
Comment 5 Andreas Tobler 2004-03-20 06:10:36 UTC
This patch is not responsible for the changes in the alignment mentioned by
Andrew. (14262 is)
Everything ok.
Comment 6 CVS Commits 2004-06-10 05:44:02 UTC
Subject: Bug 14567

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

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

Log message:
	PR target/14567
	2004-03-13  Alan Modra  <amodra@bigpond.net.au>
	* config/rs6000/rs6000.h (UNITS_PER_ARG, RS6000_ARG_SIZE): Delete.
	(HARD_REGNO_MODE_OK): Disallow TFmode for fp31.
	* config/rs6000/rs6000.c (rs6000_arg_size): New function.
	Update all users of RS6000_ARG_SIZE.
	(function_arg_advance): Count fregno using mode size.
	(function_arg): Handle long double split over regs and memory.
	(function_arg_partial_nregs): Likewise.
	(rs6000_va_arg): Repackage complex args.
	2004-02-23  Fariborz Jahanian <fjahanian@apple.com>
	* config/rs6000/rs6000.c (function_arg): call to
	rs6000_mixed_function_arg for DFmode moved to allow
	normal DFmode incoming register assignment.

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.485&r2=2.2326.2.486
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.20&r2=1.576.2.21
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.4&r2=1.306.4.5

Comment 7 Alan Modra 2004-06-10 05:46:08 UTC
Fixed