This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 2.95.2 argument-passing bug on PowerPC (LinuxPPC)


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]