diff options
author | Martin Jambor <mjambor@suse.cz> | 2010-02-08 14:24:12 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2010-02-08 14:24:12 +0100 |
commit | d35455249691b358fa92ecc17ea6ea9bed82164c (patch) | |
tree | 4b118e719920a8763f8b1ffc6037f784aa206126 /gcc/tree-sra.c | |
parent | 5d3579c539106f4a7fc5888de84bd19b42d6c7df (diff) | |
download | gcc-d35455249691b358fa92ecc17ea6ea9bed82164c.zip gcc-d35455249691b358fa92ecc17ea6ea9bed82164c.tar.gz gcc-d35455249691b358fa92ecc17ea6ea9bed82164c.tar.bz2 |
re PR middle-end/42898 (volatile structures and compound literal initializers)
2010-02-08 Martin Jambor <mjambor@suse.cz>
PR middle-end/42898
* tree-sra.c (build_accesses_from_assign): Do not mark in
should_scalarize_away_bitmap if stmt has volatile ops.
(sra_modify_assign): Do not process assigns piecemeal if if stmt
has volatile ops.
From-SVN: r156599
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r-- | gcc/tree-sra.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index c0d3d3f..12b365f 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -1023,7 +1023,8 @@ build_accesses_from_assign (gimple *stmt_ptr, racc = build_access_from_expr_1 (rhs_ptr, stmt, false); lacc = build_access_from_expr_1 (lhs_ptr, stmt, true); - if (should_scalarize_away_bitmap && racc && !is_gimple_reg_type (racc->type)) + if (should_scalarize_away_bitmap && !gimple_has_volatile_ops (stmt) + && racc && !is_gimple_reg_type (racc->type)) bitmap_set_bit (should_scalarize_away_bitmap, DECL_UID (racc->base)); if (lacc && racc @@ -2648,7 +2649,9 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi, there to do the copying and then load the scalar replacements of the LHS. This is what the first branch does. */ - if (contains_view_convert_expr_p (rhs) || contains_view_convert_expr_p (lhs) + if (gimple_has_volatile_ops (*stmt) + || contains_view_convert_expr_p (rhs) + || contains_view_convert_expr_p (lhs) || (access_has_children_p (racc) && !ref_expr_for_all_replacements_p (racc, lhs, racc->offset)) || (access_has_children_p (lacc) |