aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-12-07 13:04:57 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-12-07 13:04:57 +0000
commita6b15ad077bc9de883b11f6f89ed6133427a88a2 (patch)
treebaa288c19c0e443a3ffeb3e972ffaeb77f2af4e4 /gcc/tree-sra.c
parent0717bfbd1778001f3f15370e9d7fdef4f749f88f (diff)
downloadgcc-a6b15ad077bc9de883b11f6f89ed6133427a88a2.zip
gcc-a6b15ad077bc9de883b11f6f89ed6133427a88a2.tar.gz
gcc-a6b15ad077bc9de883b11f6f89ed6133427a88a2.tar.bz2
tree-sra.c (scalarize_use): Create another temporary with the proper type for signed types in the use_all...
* tree-sra.c (scalarize_use): Create another temporary with the proper type for signed types in the use_all && !is_output bitfield case. From-SVN: r142537
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 8cada85..aa16193 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -3223,12 +3223,20 @@ scalarize_use (struct sra_elt *elt, tree *expr_p, gimple_stmt_iterator *gsi,
if (!elt->use_block_copy)
{
tree type = TREE_TYPE (bfexpr);
- tree var, vpos;
+ tree var = make_rename_temp (type, "SR"), tmp, vpos;
+ gimple st = NULL;
- if (!TYPE_UNSIGNED (type))
- type = unsigned_type_for (type);
+ gimple_assign_set_rhs1 (stmt, var);
+ update = true;
- var = make_rename_temp (type, "SR");
+ if (!TYPE_UNSIGNED (type))
+ {
+ type = unsigned_type_for (type);
+ tmp = make_rename_temp (type, "SR");
+ st = gimple_build_assign (var,
+ fold_convert (TREE_TYPE (var), tmp));
+ var = tmp;
+ }
gimple_seq_add_stmt (&seq,
gimple_build_assign
@@ -3245,8 +3253,8 @@ scalarize_use (struct sra_elt *elt, tree *expr_p, gimple_stmt_iterator *gsi,
sra_explode_bitfield_assignment
(var, vpos, true, &seq, blen, bpos, elt);
- gimple_assign_set_rhs1 (stmt, var);
- update = true;
+ if (st)
+ gimple_seq_add_stmt (&seq, st);
}
else
sra_sync_for_bitfield_assignment