From 21318741bb4f00d87f558a2f11d462fa61381e80 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Thu, 2 Mar 2000 18:29:56 +0000 Subject: c-common.c (c_common_nodes_and_builtins): Make sizetype_endlink reference the language-equivalent of sizetype. * c-common.c (c_common_nodes_and_builtins): Make sizetype_endlink reference the language-equivalent of sizetype. * c-typeck.c (comptypes): Treat sizetype like its language equivalent. * fold-const.c (size_binop, size_diffop): Put back checks. * gcse.c (dump_hash_table): Fix minor error in last change. * stor-layout.c (set_sizetype): Set TYPE_DOMAIN of sizetype. Clear TYPE_{NEXT,MAIN}_VARIANT and TYPE_{POINTER,REFERENCE}_to of all sizetypes. * cp/typeck.c (comptypes): Treat sizetype like its language equivalent. From-SVN: r32291 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/typeck.c | 20 +++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e42c764..d7e697a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +Thu Mar 2 13:32:01 2000 Richard Kenner + + * typeck.c (comptypes): Treat sizetype like its language equivalent. + 2000-03-01 Bernd Schmidt * typeck.c (maybe_warn_about_returning_address_of_local): Reorganize diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index dd246af..8fc3ab8 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -934,17 +934,15 @@ comptypes (t1, t2, strict) if (t2 == error_mark_node) return 0; - /* If this is a strict comparison with a sizetype, the actual types - won't be the same (since we need to set TYPE_IS_SIZETYPE, so verify - if they are both the same size and signedness. */ - if (strict == COMPARE_STRICT - && TREE_CODE (t2) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t2) - && TREE_CODE (t1) == INTEGER_TYPE - && TREE_UNSIGNED (t1) == TREE_UNSIGNED (t2) - && TYPE_MODE (t1) == TYPE_MODE (t2) - && TYPE_MIN_VALUE (t1) == TYPE_MIN_VALUE (t2) - && TYPE_MAX_VALUE (t1) == TYPE_MAX_VALUE (t2)) - return 1; + /* If either type is the internal version of sizetype, return the + language version. */ + if (TREE_CODE (t1) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t1) + && TYPE_DOMAIN (t1) != 0) + t1 = TYPE_DOMAIN (t1); + + if (TREE_CODE (t2) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t2) + && TYPE_DOMAIN (t2) != 0) + t2 = TYPE_DOMAIN (t2); if (strict & COMPARE_RELAXED) { -- cgit v1.1