From e0004427824f78e9ab1ec2a1eb241ff49fb4f8a1 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Tue, 7 Jun 2005 10:05:09 +0000 Subject: [PATCH] tree-ssa.c (tree_ssa_useless_type_conversion_1): Fix comments. 2005-06-07 Richard Guenther * tree-ssa.c (tree_ssa_useless_type_conversion_1): Fix comments. From-SVN: r100704 --- gcc/ChangeLog | 5 +++++ gcc/tree-ssa.c | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 356b35e6c8c..6deb5e0779c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-06-07 Richard Guenther + + * tree-ssa.c (tree_ssa_useless_type_conversion_1): Fix + comments. + 2005-06-07 Geoffrey Keating * config/rs6000/host-darwin.c (segv_handler): Widen the possible diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 03e39a5ee55..0a83b786b7d 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -849,8 +849,8 @@ delete_tree_ssa (void) } -/* Return true if EXPR is a useless type conversion, otherwise return - false. */ +/* Return true if the conversion from INNER_TYPE to OUTER_TYPE is a + useless type conversion, otherwise return false. */ bool tree_ssa_useless_type_conversion_1 (tree outer_type, tree inner_type) @@ -881,8 +881,9 @@ tree_ssa_useless_type_conversion_1 (tree outer_type, tree inner_type) && TREE_CODE (TREE_TYPE (outer_type)) == VOID_TYPE) return true; - /* Pointers and references are equivalent once we get to GENERIC, - so strip conversions that just switch between them. */ + /* Pointers/references are equivalent if their pointed to types + are effectively the same. This allows to strip conversions between + pointer types with different type qualifiers. */ else if (POINTER_TYPE_P (inner_type) && POINTER_TYPE_P (outer_type) && TYPE_REF_CAN_ALIAS_ALL (inner_type) -- 2.30.2