diff options
author | Jason Merrill <jason@redhat.com> | 2010-05-06 15:46:03 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-05-06 15:46:03 -0400 |
commit | ebad523301c12f27e56a3008916e4e41f518ba57 (patch) | |
tree | a0ded03e5675ac2991167c1d2a5332b05c60dc5f /gcc | |
parent | 9aaa1ee883ca0e914b52d5b4bd21933b77267c28 (diff) | |
download | gcc-ebad523301c12f27e56a3008916e4e41f518ba57.zip gcc-ebad523301c12f27e56a3008916e4e41f518ba57.tar.gz gcc-ebad523301c12f27e56a3008916e4e41f518ba57.tar.bz2 |
gimplify.c (gimplify_modify_expr_rhs): Don't return GS_OK for stripping WITH_SIZE_EXPR.
* gimplify.c (gimplify_modify_expr_rhs): Don't return GS_OK for
stripping WITH_SIZE_EXPR.
(gimplify_expr) [MODIFY_EXPR]: Trust GS_OK even if the rhs didn't
change.
From-SVN: r159124
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/gimplify.c | 21 |
2 files changed, 17 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 777f08a..a759547 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2010-05-06 Jason Merrill <jason@redhat.com> + + * gimplify.c (gimplify_modify_expr_rhs): Don't return GS_OK for + stripping WITH_SIZE_EXPR. + (gimplify_expr) [MODIFY_EXPR]: Trust GS_OK even if the rhs didn't + change. + 2010-05-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * config.gcc: Removed mips-sgi-irix5*, mips-sgi-irix6.[0-4]* from diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 8d2bc58..51ec4b5 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -4291,7 +4291,10 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, if (TREE_CODE (TREE_OPERAND (*from_p, 0)) == CALL_EXPR) { *from_p = TREE_OPERAND (*from_p, 0); - ret = GS_OK; + /* We don't change ret in this case because the + WITH_SIZE_EXPR might have been added in + gimplify_modify_expr, so returning GS_OK would lead to an + infinite loop. */ changed = true; } break; @@ -6628,16 +6631,12 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, case MODIFY_EXPR: case INIT_EXPR: - { - tree from = TREE_OPERAND (*expr_p, 1); - ret = gimplify_modify_expr (expr_p, pre_p, post_p, - fallback != fb_none); - /* Don't let the end of loop logic change GS_OK into GS_ALL_DONE - if the RHS has changed. */ - if (ret == GS_OK && *expr_p == save_expr - && TREE_OPERAND (*expr_p, 1) != from) - continue; - } + ret = gimplify_modify_expr (expr_p, pre_p, post_p, + fallback != fb_none); + /* Don't let the end of loop logic change GS_OK to GS_ALL_DONE; + gimplify_modify_expr_rhs might have changed the RHS. */ + if (ret == GS_OK && *expr_p) + continue; break; case TRUTH_ANDIF_EXPR: |