diff options
author | Nathan Sidwell <nathan@acm.org> | 2015-05-27 20:36:14 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2015-05-27 20:36:14 +0000 |
commit | b6cb06b486508141178bcbbf788e610c05f97295 (patch) | |
tree | 2d1ddb9c581feb9557b80c8483d01fd02391336a /gcc/tree.c | |
parent | 73b4a60f5cac0df12dd2346cf3963d9700e8e205 (diff) | |
download | gcc-b6cb06b486508141178bcbbf788e610c05f97295.zip gcc-b6cb06b486508141178bcbbf788e610c05f97295.tar.gz gcc-b6cb06b486508141178bcbbf788e610c05f97295.tar.bz2 |
re PR c++/66270 (ICE: canonical types differ for identical types)
PR c++/66270
* tree.c (build_pointer_type_for_mode): Canonical type does not
inherit can_alias_all.
(build_reference_type_for_mode): Likewise.
PR c++/66270
* g++.dg/ext/alias-canon3.C: New.
From-SVN: r223773
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -7719,6 +7719,7 @@ build_pointer_type_for_mode (tree to_type, machine_mode mode, bool can_alias_all) { tree t; + bool could_alias = can_alias_all; if (to_type == error_mark_node) return error_mark_node; @@ -7756,7 +7757,7 @@ build_pointer_type_for_mode (tree to_type, machine_mode mode, if (TYPE_STRUCTURAL_EQUALITY_P (to_type)) SET_TYPE_STRUCTURAL_EQUALITY (t); - else if (TYPE_CANONICAL (to_type) != to_type) + else if (TYPE_CANONICAL (to_type) != to_type || could_alias) TYPE_CANONICAL (t) = build_pointer_type_for_mode (TYPE_CANONICAL (to_type), mode, false); @@ -7786,6 +7787,7 @@ build_reference_type_for_mode (tree to_type, machine_mode mode, bool can_alias_all) { tree t; + bool could_alias = can_alias_all; if (to_type == error_mark_node) return error_mark_node; @@ -7823,7 +7825,7 @@ build_reference_type_for_mode (tree to_type, machine_mode mode, if (TYPE_STRUCTURAL_EQUALITY_P (to_type)) SET_TYPE_STRUCTURAL_EQUALITY (t); - else if (TYPE_CANONICAL (to_type) != to_type) + else if (TYPE_CANONICAL (to_type) != to_type || could_alias) TYPE_CANONICAL (t) = build_reference_type_for_mode (TYPE_CANONICAL (to_type), mode, false); |