Commit b6cb06b4 by Nathan Sidwell Committed by Nathan Sidwell

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
parent 73b4a60f
2015-05-27 Nathan Sidwell <nathan@acm.org>
PR c++/66270
* tree.c (build_pointer_type_for_mode): Canonical type does not
inherit can_alias_all.
(build_reference_type_for_mode): Likewise.
2015-05-24 Nathan Sidwell <nathan@acm.org> 2015-05-24 Nathan Sidwell <nathan@acm.org>
PR c++/66243 PR c++/66243
......
2015-05-27 Nathan Sidwell <nathan@acm.org>
PR c++/66270
* g++.dg/ext/alias-canon3.C: New.
2015-05-27 Richard Biener <rguenther@suse.de> 2015-05-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/66272 PR tree-optimization/66272
......
// { dg-do compile }
// PR c++/66270
typedef float __m256 __attribute__ (( __vector_size__(32), __may_alias__ ));
struct A {
__m256 ymm;
const float &f() const;
};
const float &A::f() const {
return ymm[1];
}
...@@ -7719,6 +7719,7 @@ build_pointer_type_for_mode (tree to_type, machine_mode mode, ...@@ -7719,6 +7719,7 @@ build_pointer_type_for_mode (tree to_type, machine_mode mode,
bool can_alias_all) bool can_alias_all)
{ {
tree t; tree t;
bool could_alias = can_alias_all;
if (to_type == error_mark_node) if (to_type == error_mark_node)
return error_mark_node; return error_mark_node;
...@@ -7756,7 +7757,7 @@ build_pointer_type_for_mode (tree to_type, machine_mode mode, ...@@ -7756,7 +7757,7 @@ build_pointer_type_for_mode (tree to_type, machine_mode mode,
if (TYPE_STRUCTURAL_EQUALITY_P (to_type)) if (TYPE_STRUCTURAL_EQUALITY_P (to_type))
SET_TYPE_STRUCTURAL_EQUALITY (t); 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) TYPE_CANONICAL (t)
= build_pointer_type_for_mode (TYPE_CANONICAL (to_type), = build_pointer_type_for_mode (TYPE_CANONICAL (to_type),
mode, false); mode, false);
...@@ -7786,6 +7787,7 @@ build_reference_type_for_mode (tree to_type, machine_mode mode, ...@@ -7786,6 +7787,7 @@ build_reference_type_for_mode (tree to_type, machine_mode mode,
bool can_alias_all) bool can_alias_all)
{ {
tree t; tree t;
bool could_alias = can_alias_all;
if (to_type == error_mark_node) if (to_type == error_mark_node)
return error_mark_node; return error_mark_node;
...@@ -7823,7 +7825,7 @@ build_reference_type_for_mode (tree to_type, machine_mode mode, ...@@ -7823,7 +7825,7 @@ build_reference_type_for_mode (tree to_type, machine_mode mode,
if (TYPE_STRUCTURAL_EQUALITY_P (to_type)) if (TYPE_STRUCTURAL_EQUALITY_P (to_type))
SET_TYPE_STRUCTURAL_EQUALITY (t); 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) TYPE_CANONICAL (t)
= build_reference_type_for_mode (TYPE_CANONICAL (to_type), = build_reference_type_for_mode (TYPE_CANONICAL (to_type),
mode, false); mode, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment