This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: 2.95.2 argument-passing bug on PowerPC (LinuxPPC)
- To: <stevenj at gil-galad dot mit dot edu>
- Subject: Re: 2.95.2 argument-passing bug on PowerPC (LinuxPPC)
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Mon, 8 Nov 1999 00:04:50 +0100
- Cc: gcc-bugs at gcc dot gnu dot org,gcc-patches at gcc dot gnu dot org
- References: <Pine.LNX.4.10.9911071429270.15244-100000@gil-galad.mit.edu>
Am Son, 07 Nov 1999 schrieb stevenj@gil-galad.mit.edu:
>On Sun, 7 Nov 1999, Franz Sirl wrote:
>[in http://egcs.cygnus.com/ml/gcc-bugs/1999-11/msg00255.html]
>> this seems to be a very old platform independent bug. It was triggered on PPC
>> by the argument passing fixes in gcc >= 2.95.
>> [...]
>> The appended patch fixes the testcase for me, I think it should be applied to
>> both the release and the mainline.
>
>Thanks Franz! I really appreciate this rapid fix, as the problem was
>halting my development work on my machine. I can confirm that your fix
>corrects the testcase on my machine. (Also, the original program in which
>I found the bug now works, too.)
>
>I urge the gcc maintainers to include this patch (or something derived
>from it) into future gcc releases.
Unfortunately, even though the testsuite passed without errors, the patch is
not right :-(. It failed on one of my private testcases. I looked a bit closer
and did a new version.
Franz.
Index: function.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/function.c,v
retrieving revision 1.90.4.2
diff -u -p -r1.90.4.2 function.c
--- function.c 1999/09/07 07:34:04 1.90.4.2
+++ function.c 1999/11/07 21:06:57
@@ -5274,7 +5274,15 @@ locate_and_pad_parm (passed_mode, type,
- offset_ptr->constant);
}
#else /* !ARGS_GROW_DOWNWARD */
- pad_to_arg_alignment (initial_offset_ptr, boundary);
+ if (!in_regs
+#ifdef REG_PARM_STACK_SPACE
+ || REG_PARM_STACK_SPACE (fndecl) > 0
+#endif
+ )
+ {
+ pad_to_arg_alignment (initial_offset_ptr, boundary);
+ }
+
*offset_ptr = *initial_offset_ptr;
#ifdef PUSH_ROUNDING