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: 20000717 ICE compiling gcc/tree.c on hppa2.0-hp-hpux10.20.gnu.orgPATCH: Re: 20000717 ICE compiling gcc/tree.c on hppa2.0-hp-hpux10.20.gnu.org


I believe the following patch fixes the problem.  It has been checked
with full bootstraps under hpux 10.20 (hppa1.1) and linux (i686).
However, I don't have access to a machine that uses sibcalls and
has ARGS_GROW_DOWNWARD defined.  Thus, I can't check whether the set
and test bits correspond.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2000-08-04  J. David Anglin  <dave@hiauly1.hia.nrc.ca>

	* calls.c (check_sibcall_argument_overlap_1,
	check_sibcall_argument_overlap): Set and test bits in the
	stored_args_map using nonnegative indices when arguments
	have negative offsets (ARGS_GROW_DOWNWARD).

--- calls.c.orig	Tue Jul 18 16:16:28 2000
+++ calls.c	Fri Aug  4 13:15:30 2000
@@ -1960,6 +1960,10 @@
       else
 	return 0;
 
+#ifdef ARGS_GROW_DOWNWARD
+      i = -i - GET_MODE_SIZE (GET_MODE (x));
+#endif
+
       for (k = 0; k < GET_MODE_SIZE (GET_MODE (x)); k++)
 	if (i + k < stored_args_map->n_bits
 	    && TEST_BIT (stored_args_map, i + k))
@@ -1999,7 +2003,7 @@
      rtx insn;
      struct arg_data *arg;
 {     
-  int low, high;
+  int i, low, high;
 
   if (insn == NULL_RTX)
     insn = get_insns ();
@@ -2011,9 +2015,18 @@
 	check_sibcall_argument_overlap_1 (PATTERN (insn)))
       break;
 
+#ifdef ARGS_GROW_DOWNWARD
+  /* stack_slot is negative, but we want to index stored_args_map
+	 with positive values.  */
+  high = -arg->offset.constant;
+  low = high - arg->size.constant;
+#else
   low = arg->offset.constant;
-  for (high = low + arg->size.constant; low < high; low++)
-    SET_BIT (stored_args_map, low);
+  high = low + arg->size.constant;
+#endif
+
+  for (i = low; i < high; i++)
+    SET_BIT (stored_args_map, i);
   return insn != NULL_RTX;
 }
 

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