summaryrefslogtreecommitdiff
path: root/gcc/gimple-expr.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-21 18:00:30 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-21 18:00:30 +0000
commitdfea98eedd7732837240a8eacc5fafbb9f0f7398 (patch)
tree2bfe7b1e099bea665cddc4e5183b26a96c308ecc /gcc/gimple-expr.c
parent5ce1b137aa0429f2ff0bc638272a3a25c160ac18 (diff)
downloadgcc-dfea98eedd7732837240a8eacc5fafbb9f0f7398.tar.gz
PR middle-end/67966
* tree.c (verify_type): Verify that TYPE_MODE match between TYPE_CANONICAL and type. * expr.c (store_expr_with_bounds): Revert my previous change. * expmed.c (store_bit_field_1): Revert prevoius change. * gimple-expr.c (useless_type_conversion_p): Require TYPE_MODE to match for all types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229132 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-expr.c')
-rw-r--r--gcc/gimple-expr.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/gcc/gimple-expr.c b/gcc/gimple-expr.c
index 2a6ba1aadb9..c6dd2ebb0e9 100644
--- a/gcc/gimple-expr.c
+++ b/gcc/gimple-expr.c
@@ -87,10 +87,8 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
if (inner_type == outer_type)
return true;
- /* Changes in machine mode are never useless conversions unless we
- deal with aggregate types in which case we defer to later checks. */
- if (TYPE_MODE (inner_type) != TYPE_MODE (outer_type)
- && !AGGREGATE_TYPE_P (inner_type))
+ /* Changes in machine mode are never useless conversions unless. */
+ if (TYPE_MODE (inner_type) != TYPE_MODE (outer_type))
return false;
/* If both the inner and outer types are integral types, then the
@@ -270,10 +268,9 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
use the types in move operations. */
else if (AGGREGATE_TYPE_P (inner_type)
&& TREE_CODE (inner_type) == TREE_CODE (outer_type))
- return (!TYPE_SIZE (outer_type)
- || (TYPE_SIZE (inner_type)
- && operand_equal_p (TYPE_SIZE (inner_type),
- TYPE_SIZE (outer_type), 0)));
+ return (TYPE_MODE (outer_type) != BLKmode
+ || operand_equal_p (TYPE_SIZE (inner_type),
+ TYPE_SIZE (outer_type), 0));
else if (TREE_CODE (inner_type) == OFFSET_TYPE
&& TREE_CODE (outer_type) == OFFSET_TYPE)