aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-09-24 08:57:08 +0000
committerRichard Guenther <rguenther@suse.de>2012-09-24 08:57:08 +0000
commit92c0eddb5c09cf0eb005678d6f3fe7a6db19e7d0 (patch)
tree51aecd8b2f2c3befb06643fdb25f37d339b19690 /gcc/gimple.c
parentc0ba7b0fef35cccd7da808af25bd9e1d29363fd0 (diff)
2012-09-24 Richard Guenther <rguenther@suse.de>
PR middle-end/52173 * gimple.c (gimple_copy): Properly mark the copy modified if SSA operands are present. * gcc.dg/tm/pr52173-1.c: New. * gcc.dg/tm/pr52173-2.c: New. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@191658 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 7065040eb31..6088682e04c 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2333,23 +2333,20 @@ gimple_copy (gimple stmt)
}
/* Make copy of operands. */
- if (num_ops > 0)
- {
- for (i = 0; i < num_ops; i++)
- gimple_set_op (copy, i, unshare_expr (gimple_op (stmt, i)));
+ for (i = 0; i < num_ops; i++)
+ gimple_set_op (copy, i, unshare_expr (gimple_op (stmt, i)));
- /* Clear out SSA operand vectors on COPY. */
- if (gimple_has_ops (stmt))
- {
- gimple_set_def_ops (copy, NULL);
- gimple_set_use_ops (copy, NULL);
- }
+ if (gimple_has_mem_ops (stmt))
+ {
+ gimple_set_vdef (copy, gimple_vdef (stmt));
+ gimple_set_vuse (copy, gimple_vuse (stmt));
+ }
- if (gimple_has_mem_ops (stmt))
- {
- gimple_set_vdef (copy, gimple_vdef (stmt));
- gimple_set_vuse (copy, gimple_vuse (stmt));
- }
+ /* Clear out SSA operand vectors on COPY. */
+ if (gimple_has_ops (stmt))
+ {
+ gimple_set_def_ops (copy, NULL);
+ gimple_set_use_ops (copy, NULL);
/* SSA operands need to be updated. */
gimple_set_modified (copy, true);