diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-24 08:57:08 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-24 08:57:08 +0000 |
commit | 8ee04e9181b8adf5bf764790262d8e1be4b2bd61 (patch) | |
tree | 51aecd8b2f2c3befb06643fdb25f37d339b19690 /gcc/gimple.c | |
parent | 91a9732c0780f5d354787dfa86f585e27c7c1f8b (diff) | |
download | gcc-8ee04e9181b8adf5bf764790262d8e1be4b2bd61.tar.gz |
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: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191658 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r-- | gcc/gimple.c | 27 |
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); |