summaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-20 17:53:58 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-20 17:53:58 +0000
commit5749b7fb756700f8174502613572f4e111471025 (patch)
tree98b0d0bff7a59feed5c1d5ed59a8533ed0177b82 /gcc/tree-sra.c
parent588e293a9c0655cffe4650eec19fe8b119db823d (diff)
downloadgcc-5749b7fb756700f8174502613572f4e111471025.tar.gz
* tree-sra.c (sra_walk_expr) <VIEW_CONVERT_EXPR>: Disable
scalarization if on the LHS and not a full access. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134487 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 752f87da947..78a100f38d7 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -855,18 +855,28 @@ sra_walk_expr (tree *expr_p, block_stmt_iterator *bsi, bool is_output,
if (elt)
elt->is_vector_lhs = true;
}
+
/* A bit field reference (access to *multiple* fields simultaneously)
- is not currently scalarized. Consider this an access to the
- complete outer element, to which walk_tree will bring us next. */
-
+ is not currently scalarized. Consider this an access to the full
+ outer element, to which walk_tree will bring us next. */
goto use_all;
- case VIEW_CONVERT_EXPR:
case NOP_EXPR:
- /* Similarly, a view/nop explicitly wants to look at an object in a
+ /* Similarly, a nop explicitly wants to look at an object in a
type other than the one we've scalarized. */
goto use_all;
+ case VIEW_CONVERT_EXPR:
+ /* Likewise for a view conversion, but with an additional twist:
+ it can be on the LHS and, in this case, an access to the full
+ outer element would mean a killing def. So we need to punt
+ if we haven't already a full access to the current element,
+ because we cannot pretend to have a killing def if we only
+ have a partial access at some level. */
+ if (is_output && !use_all_p && inner != expr)
+ disable_scalarization = true;
+ goto use_all;
+
case WITH_SIZE_EXPR:
/* This is a transparent wrapper. The entire inner expression really
is being used. */