summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-28 08:41:34 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-28 08:41:34 +0000
commit427fa425045eb4955c3b061401980ae511921f2a (patch)
tree9e1011f7bd2bbdc04604d922f6f081da97ad7d29
parentcdfd86a7bd5534de470b75e40b69076a9fb27de8 (diff)
downloadgcc-427fa425045eb4955c3b061401980ae511921f2a.tar.gz
gcc/
PR middle-end/61919 * tree-outof-ssa.c (insert_partition_copy_on_edge) (insert_value_copy_on_edge, insert_rtx_to_part_on_edge) (insert_part_to_rtx_on_edge): Copy partition_to_pseudo rtxes before inserting them in the insn stream. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213116 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/tree-outof-ssa.c26
2 files changed, 21 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2ad6f4be3f1..56d3b250a03 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2014-07-28 Richard Sandiford <rdsandiford@googlemail.com>
+
+ PR middle-end/61919
+ * tree-outof-ssa.c (insert_partition_copy_on_edge)
+ (insert_value_copy_on_edge, insert_rtx_to_part_on_edge)
+ (insert_part_to_rtx_on_edge): Copy partition_to_pseudo rtxes before
+ inserting them in the insn stream.
+
2014-07-28 Marek Polacek <polacek@redhat.com>
PR middle-end/61913
diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c
index d5a635bc623..88aff5ca554 100644
--- a/gcc/tree-outof-ssa.c
+++ b/gcc/tree-outof-ssa.c
@@ -260,8 +260,8 @@ insert_partition_copy_on_edge (edge e, int dest, int src, source_location locus)
set_curr_insn_location (locus);
var = partition_to_var (SA.map, src);
- seq = emit_partition_copy (SA.partition_to_pseudo[dest],
- SA.partition_to_pseudo[src],
+ seq = emit_partition_copy (copy_rtx (SA.partition_to_pseudo[dest]),
+ copy_rtx (SA.partition_to_pseudo[src]),
TYPE_UNSIGNED (TREE_TYPE (var)),
var);
@@ -274,7 +274,7 @@ insert_partition_copy_on_edge (edge e, int dest, int src, source_location locus)
static void
insert_value_copy_on_edge (edge e, int dest, tree src, source_location locus)
{
- rtx seq, x;
+ rtx dest_rtx, seq, x;
enum machine_mode dest_mode, src_mode;
int unsignedp;
tree var;
@@ -289,7 +289,8 @@ insert_value_copy_on_edge (edge e, int dest, tree src, source_location locus)
fprintf (dump_file, "\n");
}
- gcc_assert (SA.partition_to_pseudo[dest]);
+ dest_rtx = copy_rtx (SA.partition_to_pseudo[dest]);
+ gcc_assert (dest_rtx);
set_location_for_edge (e);
/* If a locus is provided, override the default. */
@@ -300,9 +301,9 @@ insert_value_copy_on_edge (edge e, int dest, tree src, source_location locus)
var = SSA_NAME_VAR (partition_to_var (SA.map, dest));
src_mode = TYPE_MODE (TREE_TYPE (src));
- dest_mode = GET_MODE (SA.partition_to_pseudo[dest]);
+ dest_mode = GET_MODE (dest_rtx);
gcc_assert (src_mode == TYPE_MODE (TREE_TYPE (var)));
- gcc_assert (!REG_P (SA.partition_to_pseudo[dest])
+ gcc_assert (!REG_P (dest_rtx)
|| dest_mode == promote_decl_mode (var, &unsignedp));
if (src_mode != dest_mode)
@@ -312,15 +313,14 @@ insert_value_copy_on_edge (edge e, int dest, tree src, source_location locus)
}
else if (src_mode == BLKmode)
{
- x = SA.partition_to_pseudo[dest];
+ x = dest_rtx;
store_expr (src, x, 0, false);
}
else
- x = expand_expr (src, SA.partition_to_pseudo[dest],
- dest_mode, EXPAND_NORMAL);
+ x = expand_expr (src, dest_rtx, dest_mode, EXPAND_NORMAL);
- if (x != SA.partition_to_pseudo[dest])
- emit_move_insn (SA.partition_to_pseudo[dest], x);
+ if (x != dest_rtx)
+ emit_move_insn (dest_rtx, x);
seq = get_insns ();
end_sequence ();
@@ -356,7 +356,7 @@ insert_rtx_to_part_on_edge (edge e, int dest, rtx src, int unsignedsrcp,
mems. Usually we give the source. As we result from SSA names
the left and right size should be the same (and no WITH_SIZE_EXPR
involved), so it doesn't matter. */
- seq = emit_partition_copy (SA.partition_to_pseudo[dest],
+ seq = emit_partition_copy (copy_rtx (SA.partition_to_pseudo[dest]),
src, unsignedsrcp,
partition_to_var (SA.map, dest));
@@ -390,7 +390,7 @@ insert_part_to_rtx_on_edge (edge e, rtx dest, int src, source_location locus)
var = partition_to_var (SA.map, src);
seq = emit_partition_copy (dest,
- SA.partition_to_pseudo[src],
+ copy_rtx (SA.partition_to_pseudo[src]),
TYPE_UNSIGNED (TREE_TYPE (var)),
var);