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: [patch] Re: GCC 2.95 Solaris7 i86pc compilation fail with -g generates internal compiler error


On Aug  4, 1999, Richard Henderson <rth@cygnus.com> wrote:

> On Tue, Aug 03, 1999 at 07:24:40AM -0300, Alexandre Oliva wrote:

>> @@ -10053,6 +10053,9 @@
>> TYPE_MIN_VALUE (itype) = size_zero_node;
>> TYPE_MAX_VALUE (itype) = build_min
>> (MINUS_EXPR, sizetype, size, integer_one_node);
>> +		    /* If the precision is not set,
>> +                       dwarfout.c:fundamental_type_code will abort. */
>> +		    TYPE_PRECISION (itype) = TYPE_PRECISION (sizetype);

> This should just call build_index_type instead.

Like this?  (Thanks for the tip!  Some hand-holding is always good for
gcc-hacking beginners like me :-)

Index: gcc/cp/ChangeLog
from  Alexandre Oliva  <oliva@dcc.unicamp.br>
	
	* pt.c (tsubst): Use build_index_type to build in-template array
	index type.  Fixes g++.oliva/dwarf1.C.
	* decl.c (grokdeclarator): Likewise, just for consistency, as it
	doesn't seem to trigger the bug without it.
	
Index: gcc/cp/decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl.c,v
retrieving revision 1.391
diff -u -r1.391 decl.c
--- gcc/cp/decl.c	1999/08/04 09:07:47	1.391
+++ gcc/cp/decl.c	1999/08/05 21:44:28
@@ -10052,10 +10052,8 @@
 			  size = t;
 		      }
 
-		    itype = make_node (INTEGER_TYPE);
-		    TYPE_MIN_VALUE (itype) = size_zero_node;
-		    TYPE_MAX_VALUE (itype) = build_min
-		      (MINUS_EXPR, sizetype, size, integer_one_node);
+		    itype = build_index_type (build_min
+		      (MINUS_EXPR, sizetype, size, integer_one_node));
 		    goto dont_grok_size;
 		  }
 
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))

No regressions in `make check-g++' mainline; testing release branch
now.

Ok to install in mainline?  Release branch?

BTW, is it really true that Solaris7/x86 doesn't support dwarf2?  It
seems that plain dwarf is utterly bit-rotten :-(

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{dcc.unicamp.br,guarana.{org,com}} aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them

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