diff options
author | Seongbae Park <seongbae.park@gmail.com> | 2007-03-14 05:48:35 +0000 |
---|---|---|
committer | Seongbae Park <spark@gcc.gnu.org> | 2007-03-14 05:48:35 +0000 |
commit | e31657e8129711f53f3fd09d846b54bd1b5cfb39 (patch) | |
tree | b1cd7e69e39cc361885098ef2120d09353c8c59f /gcc | |
parent | 0503394970a7baf231310100775bc853b6b600a4 (diff) | |
download | gcc-e31657e8129711f53f3fd09d846b54bd1b5cfb39.tar.gz |
re PR tree-optimization/30590 (tree-nrv optimization clobbers return variable)
2007-03-13 Seongbae Park <seongbae.park@gmail.com>
PR tree-optimization/30590
* tree-nrv.c (tree_nrv): Check for the partial update of the
return value.
From-SVN: r122909
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree-nrv.c | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 45d009db9e5..1e5a199e178 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-03-13 Seongbae Park <seongbae.park@gmail.com> + + PR tree-optimization/30590 + * tree-nrv.c (tree_nrv): Check for the partial update of the + return value. + 2007-03-13 Alexandre Oliva <aoliva@redhat.com> * flags.h (flag_random_seed): Remove declaration, in favor of... diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c index c33ff0ea31a..906b98fbc8a 100644 --- a/gcc/tree-nrv.c +++ b/gcc/tree-nrv.c @@ -163,6 +163,14 @@ tree_nrv (void) result_type)) return 0; } + else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT) + { + tree addr = get_base_address (GIMPLE_STMT_OPERAND (stmt, 0)); + /* If there's any MODIFY of component of RESULT, + then bail out. */ + if (addr && addr == result) + return 0; + } } } |