diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-19 12:37:03 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-19 12:37:03 +0000 |
commit | 9f2e27aec644274d0146c3b42b1e65ff0a23b3dd (patch) | |
tree | 385291f03f96ddd5e27e38e3699d4190262d85a3 /gcc/tree-data-ref.c | |
parent | e5b1e0803813939e7c6fe159c17cb6386032566c (diff) | |
download | gcc-9f2e27aec644274d0146c3b42b1e65ff0a23b3dd.tar.gz |
gcc/
PR tree-optimization/49742
* tree-data-ref.c (get_references_in_stmt): Treat the lhs of a call
as a potential write.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176446 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r-- | gcc/tree-data-ref.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index d58542c91ca..97be86c406d 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -4158,33 +4158,37 @@ get_references_in_stmt (gimple stmt, VEC (data_ref_loc, heap) **references) ref->pos = op1; ref->is_read = true; } - - if (DECL_P (*op0) - || (REFERENCE_CLASS_P (*op0) && get_base_address (*op0))) - { - ref = VEC_safe_push (data_ref_loc, heap, *references, NULL); - ref->pos = op0; - ref->is_read = false; - } } else if (stmt_code == GIMPLE_CALL) { - unsigned i, n = gimple_call_num_args (stmt); + unsigned i, n; + op0 = gimple_call_lhs_ptr (stmt); + n = gimple_call_num_args (stmt); for (i = 0; i < n; i++) { - op0 = gimple_call_arg_ptr (stmt, i); + op1 = gimple_call_arg_ptr (stmt, i); - if (DECL_P (*op0) - || (REFERENCE_CLASS_P (*op0) && get_base_address (*op0))) + if (DECL_P (*op1) + || (REFERENCE_CLASS_P (*op1) && get_base_address (*op1))) { ref = VEC_safe_push (data_ref_loc, heap, *references, NULL); - ref->pos = op0; + ref->pos = op1; ref->is_read = true; } } } + else + return clobbers_memory; + if (*op0 + && (DECL_P (*op0) + || (REFERENCE_CLASS_P (*op0) && get_base_address (*op0)))) + { + ref = VEC_safe_push (data_ref_loc, heap, *references, NULL); + ref->pos = op0; + ref->is_read = false; + } return clobbers_memory; } |