Commit e11e491d by Richard Guenther Committed by Richard Biener

re PR middle-end/32639 (ptrmem1.C now ICE's on mainline)

2007-07-05  Richard Guenther  <rguenther@suse.de>

	PR middle-end/32639
	* alias.c (get_alias_set): Tread METHOD_TYPE the same as
	FUNCTION_TYPE.
	* tree-ssa.c (useless_type_conversion_p): Check canonical
	types early.

From-SVN: r126389
parent f6cdc432
2007-07-05 Richard Guenther <rguenther@suse.de>
PR middle-end/32639
* alias.c (get_alias_set): Tread METHOD_TYPE the same as
FUNCTION_TYPE.
* tree-ssa.c (useless_type_conversion_p): Check canonical
types early.
2007-07-05 Anatoly Sokolov <aesok@post.ru> 2007-07-05 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr.md (zero_extendqihi2, zero_extendqisi2, * config/avr/avr.md (zero_extendqihi2, zero_extendqisi2,
......
...@@ -620,7 +620,8 @@ get_alias_set (tree t) ...@@ -620,7 +620,8 @@ get_alias_set (tree t)
/* There are no objects of FUNCTION_TYPE, so there's no point in /* There are no objects of FUNCTION_TYPE, so there's no point in
using up an alias set for them. (There are, of course, pointers using up an alias set for them. (There are, of course, pointers
and references to functions, but that's different.) */ and references to functions, but that's different.) */
else if (TREE_CODE (t) == FUNCTION_TYPE) else if (TREE_CODE (t) == FUNCTION_TYPE
|| TREE_CODE (t) == METHOD_TYPE)
set = 0; set = 0;
/* Unless the language specifies otherwise, let vector types alias /* Unless the language specifies otherwise, let vector types alias
......
...@@ -920,6 +920,11 @@ useless_type_conversion_p (tree outer_type, tree inner_type) ...@@ -920,6 +920,11 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
if (inner_type == outer_type) if (inner_type == outer_type)
return true; return true;
/* If we know the canonical types, compare them. */
if (TYPE_CANONICAL (inner_type)
&& TYPE_CANONICAL (inner_type) == TYPE_CANONICAL (outer_type))
return true;
/* Changes in machine mode are never useless conversions. */ /* Changes in machine mode are never useless conversions. */
if (TYPE_MODE (inner_type) != TYPE_MODE (outer_type)) if (TYPE_MODE (inner_type) != TYPE_MODE (outer_type))
return false; return false;
...@@ -1029,11 +1034,6 @@ useless_type_conversion_p (tree outer_type, tree inner_type) ...@@ -1029,11 +1034,6 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
if (TREE_CODE (inner_type) != TREE_CODE (outer_type)) if (TREE_CODE (inner_type) != TREE_CODE (outer_type))
return false; return false;
/* If we know the canonical types, compare them. */
if (TYPE_CANONICAL (inner_type)
&& TYPE_CANONICAL (inner_type) == TYPE_CANONICAL (outer_type))
return true;
/* ??? Add structural equivalence check. */ /* ??? Add structural equivalence check. */
/* ??? This should eventually just return false. */ /* ??? This should eventually just return 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