This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: trunk still frozen?


Hi,

Richard Earnshaw <rearnsha@arm.com> wrote:
> arm-netbsdelf is bootstrapping ok, but showing many new regressions from 
> the testsuite.  I haven't had chance to investigate why yet, but most of 
> them seem to be c++ related (it wouldn't surprise me if this is a sj/lj 
> exception regression).
[snip]
> g++
> 
> FAIL: g++.dg/opt/cleanup1.C execution test
> FAIL: g++.jason/template24.C  Execution test
> FAIL: g++.jason/thunk1.C  Execution test
> FAIL: g++.jason/thunk2.C  Execution test
> FAIL: g++.jason/thunk3.C  Execution test
> FAIL: g++.law/arg8.C  Execution test
> FAIL: g++.law/cvt2.C  Execution test
> FAIL: g++.law/temps3.C  Execution test
> FAIL: g++.law/temps5.C  Execution test
> FAIL: g++.law/virtual3.C  Execution test
> FAIL: g++.mike/eh2.C  Execution test
> FAIL: g++.mike/net34.C  Execution test
> FAIL: g++.mike/p2846.C  Execution test
> FAIL: g++.mike/temp.C  Execution test
> FAIL: g++.other/dtor10.C  Execution test
> FAIL: g++.other/empty1.C  Execution test
> FAIL: g++.other/inline8.C  Execution test
> FAIL: g++.other/unchanging1.C  Execution test
> FAIL: g++.robertl/eb115.C  Execution test
> FAIL: g++.robertl/eb27.C  Execution test
> FAIL: g++.robertl/eb77.C  Execution test
> 
> 21 New failures (3 old failures fixed)

I've got similar errors on sh4-unknown-linux-gnu. With looking
assembler codes, it seems the caller of a sturct valued function
passes the struct value address as the first argument, but the
callee function uses struct_value_rtx for it. I guess that it's
related with the Jason Marrill's change
<URL:http://gcc.gnu.org/ml/gcc-patches/2002-12/msg00755.html>.
I don't understand well his change, but the attached patch solves
such new regressions on SH. It may be wrong fix but I hope it
helps to clarify the problem.

Regards,
	kaz
--
2002-12-20  Kaz Kojima  <kkojima@gcc.gnu.org>

[ChangeLog]
	* function.h (struct function): Add flag has_struct_val_arg.
	(current_function_has_struct_val_arg): New macro.
	* function.c (assign_parms): Treat struct value address as
	the first argument if current_function_has_struct_val_arg
	is non-zero.
	(prepare_function_start): Initialize
	current_function_has_struct_val_arg.

[cp/ChangeLog]
	* semantics.c (genrtl_start_function): Set
	current_function_has_struct_val_arg.

diff -u3pr ORIG/gcc/gcc/function.h LOCAL/gcc/gcc/function.h
--- ORIG/gcc/gcc/function.h	Tue Dec 17 07:12:00 2002
+++ LOCAL/gcc/gcc/function.h	Thu Dec 19 20:30:50 2002
@@ -399,6 +399,10 @@ struct function GTY(())
      return the address of where it has put a structure value.  */
   unsigned int returns_pcc_struct : 1;
   
+  /* Nonzero if function has the structure value address as the first
+     argument.  */
+  unsigned int has_struct_val_arg : 1;
+  
   /* Nonzero if the current function returns a pointer type.  */
   unsigned int returns_pointer : 1;
 
@@ -518,6 +522,7 @@ extern int virtuals_instantiated;
 #define current_function_returns_struct (cfun->returns_struct)
 #define current_function_returns_pcc_struct (cfun->returns_pcc_struct)
 #define current_function_returns_pointer (cfun->returns_pointer)
+#define current_function_has_struct_val_arg (cfun->has_struct_val_arg)
 #define current_function_needs_context (cfun->needs_context)
 #define current_function_calls_setjmp (cfun->calls_setjmp)
 #define current_function_calls_alloca (cfun->calls_alloca)
diff -u3pr ORIG/gcc/gcc/function.c LOCAL/gcc/gcc/function.c
--- ORIG/gcc/gcc/function.c	Tue Dec 17 07:12:00 2002
+++ LOCAL/gcc/gcc/function.c	Thu Dec 19 20:31:44 2002
@@ -4256,7 +4256,8 @@ assign_parms (fndecl)
   /* If struct value address is treated as the first argument, make it so.  */
   if (aggregate_value_p (DECL_RESULT (fndecl))
       && ! current_function_returns_pcc_struct
-      && struct_value_incoming_rtx == 0)
+      && (current_function_has_struct_val_arg
+	  || struct_value_incoming_rtx == 0))
     {
       tree type = build_pointer_type (TREE_TYPE (fntype));
 
@@ -6178,6 +6179,7 @@ prepare_function_start ()
   current_function_is_thunk = 0;
 
   current_function_returns_pcc_struct = 0;
+  current_function_has_struct_val_arg = 0;
   current_function_returns_struct = 0;
   current_function_epilogue_delay_list = 0;
   current_function_uses_const_pool = 0;
diff -u3pr ORIG/gcc/gcc/cp/semantics.c LOCAL/gcc/gcc/cp/semantics.c
--- ORIG/gcc/gcc/cp/semantics.c	Tue Dec 17 07:13:00 2002
+++ LOCAL/gcc/gcc/cp/semantics.c	Thu Dec 19 20:33:51 2002
@@ -2531,6 +2531,9 @@ genrtl_start_function (fn)
 	DECL_SAVED_FUNCTION_DATA (fn) = NULL;
     }
 
+  if (aggregate_value_p (DECL_RESULT (fn)))
+    current_function_has_struct_val_arg = 1;
+
   /* Keep track of how many functions we're presently expanding.  */
   ++function_depth;


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