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]

(C++) patch to type_after_usual_arithmetic_conversions


Since the recent sizetype changes, targets with size_t == unsigned
long have been blowing up on much of the g++ testsuite.

2000-03-22  Jason Merrill  <jason@casey.cygnus.com>

	* typeck.c (type_after_usual_arithmetic_conversions): Prefer a
	SIZETYPE to a non-SIZETYPE.

Index: cp/typeck.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/typeck.c,v
retrieving revision 1.267
diff -c -p -r1.267 typeck.c
*** cp/typeck.c	2000/03/19 05:22:04	1.267
--- cp/typeck.c	2000/03/22 09:35:51
*************** type_after_usual_arithmetic_conversions 
*** 358,363 ****
--- 358,369 ----
  
    if (code1 != REAL_TYPE)
      {
+       /* If one is a sizetype, use it so size_binop doesn't blow up.  */
+       if (TYPE_IS_SIZETYPE (t1) > TYPE_IS_SIZETYPE (t2))
+ 	return build_type_attribute_variant (t1, attributes);
+       if (TYPE_IS_SIZETYPE (t2) > TYPE_IS_SIZETYPE (t1))
+ 	return build_type_attribute_variant (t2, attributes);
+ 
        /* If one is unsigned long long, then convert the other to unsigned
  	 long long.  */
        if (same_type_p (TYPE_MAIN_VARIANT (t1), long_long_unsigned_type_node)

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