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]
Other format: [Raw text]

[vta, vta4.4] (don't really) deal with invisible reference arguments


An s390x bootstrap failed bootstrap because of an assertion check in
setting up the initial state for an argument that was passed by
invisible reference.

Oddly, the declaration was not marked DECL_BY_REFERENCE, but even if it
was, var_tracking didn't have code to deal with it.  We simply emit
wrong debug info for this.  With this patch, we'll refrain from emitting
incorrect debug info, at least if VTA is enabled and the parameter is
tracked with VTA.

A proper fix to handle DECL_BY_REFERENCE arguments and to get it set is
yet to be written.  Meanwhile, I'm installing this workaround, that is a
strict improvement, in vta and vta4.4 branches.

for  gcc/ChangeLog.vta
from  Alexandre Oliva  <aoliva@redhat.com>

	* var-tracking.c (vt_add_function_parameters): Work around
	unhandled invisible-reference arguments.

Index: gcc/var-tracking.c
===================================================================
--- gcc/var-tracking.c.orig	2009-07-29 23:14:52.000000000 -0300
+++ gcc/var-tracking.c	2009-07-30 05:36:42.000000000 -0300
@@ -7131,8 +7131,16 @@ vt_add_function_parameters (void)
 	     value, but ATM we don't.  */
 	  && GET_CODE (incoming) != PARALLEL)
 	{
-	  cselib_val *val = cselib_lookup (var_lowpart (mode, incoming),
-					   mode, true);
+	  cselib_val *val;
+
+	  /* ??? We shouldn't ever hit this, but it may happen because
+	     arguments passed by invisible reference aren't dealt with
+	     above: incoming-rtl will have Pmode rather than the
+	     expected mode for the type.  */
+	  if (offset)
+	    continue;
+
+	  val = cselib_lookup (var_lowpart (mode, incoming), mode, true);
 
 	  /* ??? Float-typed values in memory are not handled by
 	     cselib.  */
-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

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