diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2000-03-02 18:29:56 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2000-03-02 13:29:56 -0500 |
commit | 21318741bb4f00d87f558a2f11d462fa61381e80 (patch) | |
tree | 012b815e352352c505a47f997f46e1b9d2d6618a /gcc/cp | |
parent | 42f602d842e3fe935b626e082eff27d5621ea2b3 (diff) | |
download | gcc-21318741bb4f00d87f558a2f11d462fa61381e80.zip gcc-21318741bb4f00d87f558a2f11d462fa61381e80.tar.gz gcc-21318741bb4f00d87f558a2f11d462fa61381e80.tar.bz2 |
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
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 20 |
2 files changed, 13 insertions, 11 deletions
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 <kenner@vlsi1.ultra.nyu.edu> + + * typeck.c (comptypes): Treat sizetype like its language equivalent. + 2000-03-01 Bernd Schmidt <bernds@cygnus.co.uk> * 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) { |