Commit 5993d1c9 by Eric Botcazou Committed by Eric Botcazou

gimple-expr.c (useless_type_conversion_p): Reinstate type canonical check for…

gimple-expr.c (useless_type_conversion_p): Reinstate type canonical check for aggregate types and beef up comment for mode...

	* gimple-expr.c (useless_type_conversion_p): Reinstate type canonical
	check for aggregate types and beef up comment for mode check.

From-SVN: r229714
parent 34148d68
2015-11-03 Eric Botcazou <ebotcazou@adacore.com>
* gimple-expr.c (useless_type_conversion_p): Reinstate type canonical
check for aggregate types and beef up comment for mode check.
2015-11-03 Richard Biener <rguenther@suse.de> 2015-11-03 Richard Biener <rguenther@suse.de>
* tree-vect-data-refs.c (vect_analyze_data_refs): Do not collect * tree-vect-data-refs.c (vect_analyze_data_refs): Do not collect
...@@ -86,7 +86,8 @@ useless_type_conversion_p (tree outer_type, tree inner_type) ...@@ -86,7 +86,8 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
if (inner_type == outer_type) if (inner_type == outer_type)
return true; return true;
/* Changes in machine mode are never useless conversions unless. */ /* Changes in machine mode are never useless conversions because the RTL
middle-end expects explicit conversions between modes. */
if (TYPE_MODE (inner_type) != TYPE_MODE (outer_type)) if (TYPE_MODE (inner_type) != TYPE_MODE (outer_type))
return false; return false;
...@@ -262,14 +263,13 @@ useless_type_conversion_p (tree outer_type, tree inner_type) ...@@ -262,14 +263,13 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
return true; return true;
} }
/* For aggregates compare only the size. Accesses to fields do have /* For aggregates we rely on TYPE_CANONICAL exclusively and require
a type information by themselves and thus we only care if we can i.e. explicit conversions for types involving to be structurally
use the types in move operations. */ compared types. */
else if (AGGREGATE_TYPE_P (inner_type) else if (AGGREGATE_TYPE_P (inner_type)
&& TREE_CODE (inner_type) == TREE_CODE (outer_type)) && TREE_CODE (inner_type) == TREE_CODE (outer_type))
return (TYPE_MODE (outer_type) != BLKmode return TYPE_CANONICAL (inner_type)
|| operand_equal_p (TYPE_SIZE (inner_type), && TYPE_CANONICAL (inner_type) == TYPE_CANONICAL (outer_type);
TYPE_SIZE (outer_type), 0));
else if (TREE_CODE (inner_type) == OFFSET_TYPE else if (TREE_CODE (inner_type) == OFFSET_TYPE
&& TREE_CODE (outer_type) == OFFSET_TYPE) && TREE_CODE (outer_type) == OFFSET_TYPE)
......
2015-11-03 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/discr45.adb: Only compile the test.
2015-11-03 Evgeny Stupachenko <evstupac@gmail.com> 2015-11-03 Evgeny Stupachenko <evstupac@gmail.com>
* g++.dg/ext/mvc4.C: Add dg-require-ifunc condition. * g++.dg/ext/mvc4.C: Add dg-require-ifunc condition.
......
-- { dg-do run } -- { dg-do compile }
-- { dg-options "-O2 -gnatws" } -- { dg-options "-O2 -gnatws" }
procedure Discr45 is procedure Discr45 is
......
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