diff options
author | Richard Guenther <rguenther@suse.de> | 2009-08-12 15:10:47 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-08-12 15:10:47 +0000 |
commit | daad02781a10022ac810312c46fda483809c3634 (patch) | |
tree | 637efc702dde071c504b6d68951b06bfb3f2b5c1 /gcc | |
parent | 30de16328a546dd06011235d86ef573dc2ffba6e (diff) | |
download | gcc-daad02781a10022ac810312c46fda483809c3634.zip gcc-daad02781a10022ac810312c46fda483809c3634.tar.gz gcc-daad02781a10022ac810312c46fda483809c3634.tar.bz2 |
alias.c (get_alias_set): Honor TYPE_STRUCTURAL_EQUALITY_P.
2009-08-12 Richard Guenther <rguenther@suse.de>
* alias.c (get_alias_set): Honor TYPE_STRUCTURAL_EQUALITY_P.
* gimplify.c (gimplify_modify_expr): Do not use
lang_hooks.types_compatible_p.
* tree-ssa.c (useless_type_conversion_p): For aggregates
just return false if the canonical types differ.
From-SVN: r150695
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/alias.c | 17 | ||||
-rw-r--r-- | gcc/gimplify.c | 3 | ||||
-rw-r--r-- | gcc/tree-ssa.c | 13 |
4 files changed, 26 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bf7518e..e4b074c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2009-08-12 Richard Guenther <rguenther@suse.de> + + * alias.c (get_alias_set): Honor TYPE_STRUCTURAL_EQUALITY_P. + * gimplify.c (gimplify_modify_expr): Do not use + lang_hooks.types_compatible_p. + * tree-ssa.c (useless_type_conversion_p): For aggregates + just return false if the canonical types differ. + 2009-08-12 Sebastian Pop <sebastian.pop@amd.com> PR middle-end/40980 diff --git a/gcc/alias.c b/gcc/alias.c index 442be82..eaa127e 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -680,11 +680,20 @@ get_alias_set (tree t) } /* Variant qualifiers don't affect the alias set, so get the main - variant. Always use the canonical type as well. - If this is a type with a known alias set, return it. */ + variant. */ t = TYPE_MAIN_VARIANT (t); - if (TYPE_CANONICAL (t)) - t = TYPE_CANONICAL (t); + + /* Always use the canonical type as well. If this is a type that + requires structural comparisons to identify compatible types + use alias set zero. */ + if (TYPE_STRUCTURAL_EQUALITY_P (t)) + return 0; + t = TYPE_CANONICAL (t); + /* Canonical types shouldn't form a tree nor should the canonical + type require structural equality checks. */ + gcc_assert (!TYPE_STRUCTURAL_EQUALITY_P (t) && TYPE_CANONICAL (t) == t); + + /* If this is a type with a known alias set, return it. */ if (TYPE_ALIAS_SET_KNOWN_P (t)) return TYPE_ALIAS_SET (t); diff --git a/gcc/gimplify.c b/gcc/gimplify.c index dc8d0c0..eaea16d 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -4322,8 +4322,7 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, /* Insert pointer conversions required by the middle-end that are not required by the frontend. This fixes middle-end type checking for for example gcc.dg/redecl-6.c. */ - if (POINTER_TYPE_P (TREE_TYPE (*to_p)) - && lang_hooks.types_compatible_p (TREE_TYPE (*to_p), TREE_TYPE (*from_p))) + if (POINTER_TYPE_P (TREE_TYPE (*to_p))) { STRIP_USELESS_TYPE_CONVERSION (*from_p); if (!useless_type_conversion_p (TREE_TYPE (*to_p), TREE_TYPE (*from_p))) diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 97e15ae..a402703 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -1102,17 +1102,12 @@ useless_type_conversion_p (tree outer_type, tree inner_type) return true; } - /* For aggregates we may need to fall back to structural equality - checks. */ + /* For aggregates we rely on TYPE_CANONICAL exclusively and require + explicit conversions for types involving to be structurally + compared types. */ else if (AGGREGATE_TYPE_P (inner_type) && TREE_CODE (inner_type) == TREE_CODE (outer_type)) - { - if (TYPE_STRUCTURAL_EQUALITY_P (outer_type) - || TYPE_STRUCTURAL_EQUALITY_P (inner_type)) - return lang_hooks.types_compatible_p (inner_type, outer_type); - - return false; - } + return false; return false; } |