This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
(C++) patch to type_after_usual_arithmetic_conversions
- To: gcc-patches at gcc dot gnu dot org
- Subject: (C++) patch to type_after_usual_arithmetic_conversions
- From: Jason Merrill <jason at cygnus dot com>
- Date: Wed, 22 Mar 2000 02:10:41 -0800
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)