Bug 23070 - [3.4 only] CALL_V4_CLEAR_FP_ARGS flag not properly set
Summary: [3.4 only] CALL_V4_CLEAR_FP_ARGS flag not properly set
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.3
: P2 normal
Target Milestone: 3.4.5
Assignee: Alan Modra
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2005-07-26 06:36 UTC by Tong Ho
Modified: 2005-11-10 02:49 UTC (History)
1 user (show)

See Also:
Host:
Target: powerpc-eabi-gcc
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-08-19 03:21:14


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tong Ho 2005-07-26 06:36:52 UTC
When a prototyped function of var-arg is called without any arguments
to the variable part, "crxor 6,6,6" is not generated.  "-O0
-mno-prototype" does NOT resolve the problem either.

--------test.c--------
int test(const char *a, ...);

void test1(const char *a)
{ test(a, 0); }

void test2(const char *a)
{ test(a); }

--------test.s--------
        .file   "test.c"
        .section        ".text"
        .align 2
        .globl test1
        .type   test1, @function
test1:
        stwu 1,-24(1)
        mflr 0
        stw 31,20(1)
        stw 0,28(1)
        mr 31,1
        stw 3,8(31)
        lwz 3,8(31)
        li 4,0
        crxor 6,6,6    <== has it
        bl test
        lwz 11,0(1)
        lwz 0,4(11)
        mtlr 0
        lwz 31,-4(11)
        mr 1,11
        blr
        .size   test1, .-test1
        .align 2
        .globl test2
        .type   test2, @function
test2:
        stwu 1,-24(1)
        mflr 0
        stw 31,20(1)
        stw 0,28(1)
        mr 31,1
        stw 3,8(31)
        lwz 3,8(31)
        bl test       <== does not have
        lwz 11,0(1)
        lwz 0,4(11)
        mtlr 0
        lwz 31,-4(11)
        mr 1,11
        blr
        .size   test2, .-test2
        .ident  "GCC: (GNU) 3.4.3"
Comment 1 Alan Modra 2005-08-19 03:21:14 UTC
Confirmed
Comment 3 CVS Commits 2005-08-23 00:34:52 UTC
Subject: Bug 23070

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	amodra@gcc.gnu.org	2005-08-23 00:33:19

Modified files:
	gcc            : ChangeLog 
	gcc/config/rs6000: rs6000.c sysv4.opt 

Log message:
	PR target/23070
	* config/rs6000/rs6000.c (function_arg): For ABI_V4 calls to
	stdarg functions, set/clear the fp marker even when no variable
	args are passed.
	* config/rs6000/sysv4.opt (mprototype): Describe.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9800&r2=2.9801
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&r1=1.860&r2=1.861
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/sysv4.opt.diff?cvsroot=gcc&r1=1.5&r2=1.6

Comment 4 CVS Commits 2005-08-23 02:29:31 UTC
Subject: Bug 23070

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	amodra@gcc.gnu.org	2005-08-23 02:28:19

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

Log message:
	PR target/23070
	* config/rs6000/rs6000.c (function_arg): For ABI_V4 calls to
	stdarg functions, set/clear the fp marker even when no variable
	args are passed.
	* config/rs6000/sysv4.h (SUBTARGET_SWITCHES): Describe
	-mprototype and -mno-prototype.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.382&r2=2.7592.2.383
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.788.2.7&r2=1.788.2.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/sysv4.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.158.4.2&r2=1.158.4.3

Comment 5 Alan Modra 2005-10-29 22:35:41 UTC
Subject: Bug 23070

Author: amodra
Date: Sat Oct 29 22:35:37 2005
New Revision: 105998

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=105998
Log:
	PR target/23070
	* config/rs6000/rs6000.c (function_arg): For ABI_V4 calls to
	stdarg functions, set/clear the fp marker even when no variable
	args are passed.
	* config/rs6000/sysv4.h (SUBTARGET_SWITCHES): Describe
	-mprototype and -mno-prototype.


Modified:
    branches/gcc-3_4-branch/gcc/ChangeLog
    branches/gcc-3_4-branch/gcc/config/rs6000/rs6000.c
    branches/gcc-3_4-branch/gcc/config/rs6000/sysv4.h

Comment 6 Alan Modra 2005-10-29 22:36:46 UTC
Fixed.
Comment 7 carlos 2006-04-04 01:11:45 UTC
Subject: Bug 23070

Author: carlos
Date: Tue Apr  4 01:11:42 2006
New Revision: 112655

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112655
Log:

2006-04-03  Carlos O'Donell  <carlos@codesourcery.com>

	Backport:
	2005-08-23  Alan Modra  <amodra@bigpond.net.au>

	PR target/23070
	* config/rs6000/rs6000.c (function_arg): For ABI_V4 calls to
	stdarg functions, set/clear the fp marker even when no variable
	args are passed.
	* config/rs6000/sysv4.h (mprototype): Describe.


Modified:
    branches/csl-gxxpro-3_4-branch/ChangeLog.csl
    branches/csl-gxxpro-3_4-branch/gcc/config/rs6000/rs6000.c
    branches/csl-gxxpro-3_4-branch/gcc/config/rs6000/sysv4.h