diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1998-02-16 04:52:31 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1998-02-15 23:52:31 -0500 |
commit | b7f6588dd26feb66e936f4a3817d28c8ea929fae (patch) | |
tree | a79a0fce1411246619cb9375b2e5e885167e3226 /gcc/fold-const.c | |
parent | f75778a8d6315df5f100475fa2cd1bb0423d8019 (diff) | |
download | gcc-b7f6588dd26feb66e936f4a3817d28c8ea929fae.zip gcc-b7f6588dd26feb66e936f4a3817d28c8ea929fae.tar.gz gcc-b7f6588dd26feb66e936f4a3817d28c8ea929fae.tar.bz2 |
tree.c (first_rtl_op): New fn.
* tree.c (first_rtl_op): New fn.
(unsave_expr_now): Use it.
* print-tree.c (print_node): Likewise.
* tree.c (has_cleanups): New fn.
* fold-const.c (fold, case CLEANUP_POINT_EXPR): Use it. Be more
conservative about pushing the cleanup point down.
* tree.h: Declare them.
From-SVN: r18023
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 4d021db..35d8beb 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -5920,7 +5920,7 @@ fold (expr) /* Pull arithmetic ops out of the CLEANUP_POINT_EXPR where appropriate. */ case CLEANUP_POINT_EXPR: - if (! TREE_SIDE_EFFECTS (arg0)) + if (! has_cleanups (arg0)) return TREE_OPERAND (t, 0); { @@ -5941,12 +5941,14 @@ fold (expr) { arg01 = TREE_OPERAND (arg0, 1); - if (! TREE_SIDE_EFFECTS (arg00)) + if (TREE_CONSTANT (arg00) + || ((code0 == TRUTH_ANDIF_EXPR || code0 == TRUTH_ORIF_EXPR) + && ! has_cleanups (arg00))) return fold (build (code0, type, arg00, fold (build1 (CLEANUP_POINT_EXPR, TREE_TYPE (arg01), arg01)))); - if (! TREE_SIDE_EFFECTS (arg01)) + if (TREE_CONSTANT (arg01)) return fold (build (code0, type, fold (build1 (CLEANUP_POINT_EXPR, TREE_TYPE (arg00), arg00)), |