Commit 3f5f6592 by Richard Guenther Committed by Richard Biener

tree-sra.c (create_access_replacement): Only rename the replacement if we can…

tree-sra.c (create_access_replacement): Only rename the replacement if we can rewrite it into SSA form.

2012-03-12  Richard Guenther  <rguenther@suse.de>

        * tree-sra.c (create_access_replacement): Only rename the
        replacement if we can rewrite it into SSA form.  Properly
        mark register typed replacements that we cannot rewrite
        with TREE_ADDRESSABLE.
	* tree-cfg.c (verify_expr): Fix BIT_FIELD_REF verification
	for aggregate or BLKmode results.

From-SVN: r185221
parent 01c1f20d
2012-03-12 Richard Guenther <rguenther@suse.de>
* tree-sra.c (create_access_replacement): Only rename the
replacement if we can rewrite it into SSA form. Properly
mark register typed replacements that we cannot rewrite
with TREE_ADDRESSABLE.
* tree-cfg.c (verify_expr): Fix BIT_FIELD_REF verification
for aggregate or BLKmode results.
2012-03-12 Jakub Jelinek <jakub@redhat.com> 2012-03-12 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/52533 PR tree-optimization/52533
......
...@@ -2790,7 +2790,7 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) ...@@ -2790,7 +2790,7 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
error ("invalid position or size operand to BIT_FIELD_REF"); error ("invalid position or size operand to BIT_FIELD_REF");
return t; return t;
} }
else if (INTEGRAL_TYPE_P (TREE_TYPE (t)) if (INTEGRAL_TYPE_P (TREE_TYPE (t))
&& (TYPE_PRECISION (TREE_TYPE (t)) && (TYPE_PRECISION (TREE_TYPE (t))
!= TREE_INT_CST_LOW (TREE_OPERAND (t, 1)))) != TREE_INT_CST_LOW (TREE_OPERAND (t, 1))))
{ {
...@@ -2798,7 +2798,9 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) ...@@ -2798,7 +2798,9 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
"field size of BIT_FIELD_REF"); "field size of BIT_FIELD_REF");
return t; return t;
} }
if (!INTEGRAL_TYPE_P (TREE_TYPE (t)) else if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
&& !AGGREGATE_TYPE_P (TREE_TYPE (t))
&& TYPE_MODE (TREE_TYPE (t)) != BLKmode
&& (GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (t))) && (GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (t)))
!= TREE_INT_CST_LOW (TREE_OPERAND (t, 1)))) != TREE_INT_CST_LOW (TREE_OPERAND (t, 1))))
{ {
......
...@@ -1924,13 +1924,19 @@ create_access_replacement (struct access *access, bool rename) ...@@ -1924,13 +1924,19 @@ create_access_replacement (struct access *access, bool rename)
repl = create_tmp_var (access->type, "SR"); repl = create_tmp_var (access->type, "SR");
add_referenced_var (repl); add_referenced_var (repl);
if (rename) if (!access->grp_partial_lhs
&& rename)
mark_sym_for_renaming (repl); mark_sym_for_renaming (repl);
if (!access->grp_partial_lhs if (TREE_CODE (access->type) == COMPLEX_TYPE
&& (TREE_CODE (access->type) == COMPLEX_TYPE || TREE_CODE (access->type) == VECTOR_TYPE)
|| TREE_CODE (access->type) == VECTOR_TYPE)) {
if (!access->grp_partial_lhs)
DECL_GIMPLE_REG_P (repl) = 1; DECL_GIMPLE_REG_P (repl) = 1;
}
else if (access->grp_partial_lhs
&& is_gimple_reg_type (access->type))
TREE_ADDRESSABLE (repl) = 1;
DECL_SOURCE_LOCATION (repl) = DECL_SOURCE_LOCATION (access->base); DECL_SOURCE_LOCATION (repl) = DECL_SOURCE_LOCATION (access->base);
DECL_ARTIFICIAL (repl) = 1; DECL_ARTIFICIAL (repl) = 1;
......
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