[patch] Re: GCC 2.95 Solaris7 i86pc compilation fail with-g generates internal compiler error

Mark Mitchell mark@codesourcery.com
Tue Aug 10 09:51:00 GMT 1999


>>>>> "Alexandre" == Alexandre Oliva <oliva@dcc.unicamp.br> writes:

	* pt.c (tsubst): Use build_index_type to build in-template array
	index type.  Fixes g++.oliva/dwarf1.C.

  Index: gcc/cp/pt.c
  ===================================================================
  RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/pt.c,v
  retrieving revision 1.319
  diff -u -r1.319 pt.c
  --- gcc/cp/pt.c	1999/08/04 09:07:48	1.319
  +++ gcc/cp/pt.c	1999/08/05 21:44:30
  @@ -6193,11 +6193,8 @@
		 not PROCESSING_TEMPLATE_DECL.  */
	      || TREE_CODE (max) != INTEGER_CST)
	    {
  -	    tree itype = make_node (INTEGER_TYPE);
  -	    TYPE_MIN_VALUE (itype) = size_zero_node;
  -	    TYPE_MAX_VALUE (itype) = build_min (MINUS_EXPR, sizetype, max,
  -						integer_one_node);
  -	    return itype;
  +	    return build_index_type (build_min
  +	      (MINUS_EXPR, sizetype, max, integer_one_node));
	    }

	  if (integer_zerop (omax))

I don't think this is correct.  For one thing, build_index_type
attempts to perform conversions on MAX; as noted in the comment it may
be template dependent.  What is MAX in the case you're interested in?
Is PROCESSING_TEMPLATE_DECL true?  The dwarf=-handling code should
never be looking at template bodies, so it shouldn't matter what we do
here if PROCESSING_TEMPLATE_DECL is true.  Can you track down a bit
more completely what's going on when we get here and what's going
wrong?

Thanks!

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


More information about the Gcc-patches mailing list