template_type_parm and typename_type not supported by dump_type_prefix

John David Anglin dave@hiauly1.hia.nrc.ca
Wed Jul 4 11:35:00 GMT 2001


> I have been looking at it a bit and I suspect that dump_type_suffix
> and dump_type_prefix have been miscompiled.  The following tree leads
> to sorry being called in dump_type_suffix:

> I think I need to look at the assembler code for dump_type_suffix to
> see if the switch statement in it is ok.

The problem appears to be caused by the patch below.  The TEMPLATE_TYPE_PARM
case statements in dump_type_prefix and dump_type_suffix are not present in
in the assembler output with it.  Reversing it appears to correct the
problem.  I am doing a full bootstrap now for hppa1.1-hp-hpux10.20.

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

===================================================================
RCS file: /cvs/gcc/egcs/gcc/stmt.c,v
retrieving revision 1.199
retrieving revision 1.200
diff -u -r1.199 -r1.200
--- egcs/gcc/stmt.c	2001/06/08 18:12:54	1.199
+++ egcs/gcc/stmt.c	2001/06/18 15:35:46	1.200
@@ -6293,8 +6293,10 @@
 	  /* Node has no children so we check low and high bounds to remove
 	     redundant tests.  Only one of the bounds can exist,
 	     since otherwise this node is bounded--a case tested already.  */
+	  int high_bound = node_has_high_bound (node, index_type);
+	  int low_bound = node_has_low_bound (node, index_type);
 
-	  if (!node_has_high_bound (node, index_type))
+	  if (!high_bound && low_bound)
 	    {
 	      emit_cmp_and_jump_insns (index,
 				       convert_modes
@@ -6306,7 +6308,7 @@
 				       default_label);
 	    }
 
-	  if (!node_has_low_bound (node, index_type))
+	  else if (!low_bound && high_bound)
 	    {
 	      emit_cmp_and_jump_insns (index,
 				       convert_modes
@@ -6315,6 +6317,24 @@
 						     VOIDmode, 0),
 					unsignedp),
 				       LT, NULL_RTX, mode, unsignedp, 0,
+				       default_label);
+	    }
+	  else if (!low_bound && !high_bound)
+	    {
+	      /* Instead of doing two branches emit test (index-low) <= (high-low).  */
+	      tree new_bound = fold (build (MINUS_EXPR, index_type, node->high,
+					    node->low));
+	      rtx new_index;
+	      
+	      new_index = expand_binop (mode, sub_optab, index,
+			      		expand_expr (node->low, NULL_RTX,
+						     VOIDmode, 0),
+				        NULL_RTX, 0, OPTAB_WIDEN);
+				
+	      emit_cmp_and_jump_insns (new_index,
+				       expand_expr (new_bound, NULL_RTX,
+						    VOIDmode, 0),
+				       GT, NULL_RTX, mode, 1, 0,
 				       default_label);
 	    }
 



More information about the Gcc-bugs mailing list