summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-27 20:36:14 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-27 20:36:14 +0000
commit3d4beec7595508eb40fd5ff80882390d753c0734 (patch)
tree2d1ddb9c581feb9557b80c8483d01fd02391336a /gcc/tree.c
parent3a40f0f679a2a42c50c5549cd2323538dc4dc854 (diff)
downloadgcc-3d4beec7595508eb40fd5ff80882390d753c0734.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223773 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index c22fa765f4c..ca48c60dd10 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -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);