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]

PATCH for rs6000.c (was: Re: Results for egcs-2.92.18 19981103 (gcc2 ss-980609 experimental) testsuite on powerpc-redhat-linux-gnu


		Am Fri, 13 Nov 1998 schrieb Mike Stump:
>> Date: Fri, 13 Nov 1998 21:43:59 +0100
>> To: mrs@wrs.com (Mike Stump)
>> From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
>> Cc: meissner@cygnus.com, dje@watson.ibm.com
>
>> At 20:40 13.11.98 , Mike Stump wrote:
>> >> Date: Fri, 13 Nov 1998 12:31:41 +0100
>> >> From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
>> >
>> >I might be related to ASM_OUTPUT_MI_THUNK, though offhand, it seems
>> >like it should be a bug in the mi C++ code.
>
>> Ah, yes. A quick look in the .s file reveals that the thunk code
>> modifies r4 instead of r3. So I changed the following line from
>
>> char *this_reg = reg_names[ aggregate_value_p (TREE_TYPE (function)) ? 3 : 4];
>
>> to:
>> char *this_reg = reg_names[ aggregate_value_p (TREE_TYPE (function)) ? 4 : 3];
>
>> and this fixes all of your tests that FAIL.
>
>> Michael, is this fix correct? Since you did this code, it would be best if
>> you could comment on it, cause I don't know the intention behind it.
>
>Ah, given the fact it is so new, and the fact the FAILs turn to
>PASSes, then I would have a tendency to think your on the right path.
>Thanks for all your efforts tracking this down!

It turned out that my first attempt is only partially correct, it breaked the
thunk*.C tests. The correct fix seems to be the following one, which was
inspired by shamelessly lurking into other archs. The check for variadic
functions was not quite correct. With the fix it passes now all the
mysteriously failing c++ tests. Hmm, it would be nice to have a testcase, which
tests for thunk behaviour across multiple objectfiles. Can someone come up with
such a beast?

Franz.


	* rs6000/rs6000.c (output_mi_thunk): Correct test for
	variadic/non-variadic functions

Index: rs6000.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.47
diff -u -p -r1.47 rs6000.c
--- rs6000.c	1998/10/15 16:52:52	1.47
+++ rs6000.c	1998/11/15 10:25:17
@@ -4474,7 +4474,7 @@ output_mi_thunk (file, thunk_fndecl, del
      int delta;
      tree function;
 {
-  char *this_reg = reg_names[ aggregate_value_p (TREE_TYPE (function)) ? 3 : 4 ];
+  char *this_reg = reg_names[ aggregate_value_p (TREE_TYPE (TREE_TYPE (function))) ? 4 : 3 ];
   char *r0	 = reg_names[0];
   char *sp	 = reg_names[1];
   char *toc	 = reg_names[2];



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