GCC Bugzilla – Bug 23070
[3.4 only] CALL_V4_CLEAR_FP_ARGS flag not properly set
Last modified: 2005-11-10 02:49:19 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"
Confirmed
http://gcc.gnu.org/ml/gcc-patches/2005-08/msg01201.html
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
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
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
Fixed.
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