diff options
author | Andrew Pinski <pinskia@physics.uc.edu> | 2004-10-11 03:42:09 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2004-10-10 20:42:09 -0700 |
commit | 0ad28ddea6a397689d8d03e4eb165312b7487655 (patch) | |
tree | ba27ac02d6df5a9d734fba44b00edb8f74204304 /gcc/fold-const.c | |
parent | 5c70192c1d006b8ca0f028aea3e88f0964f7b8b8 (diff) | |
download | gcc-0ad28ddea6a397689d8d03e4eb165312b7487655.zip gcc-0ad28ddea6a397689d8d03e4eb165312b7487655.tar.gz gcc-0ad28ddea6a397689d8d03e4eb165312b7487655.tar.bz2 |
re PR c++/17554 (crashes in on kopete build (KDE's kdenetwork))
2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/17554
part of c++/17657
middle-end/17703
* semantics.c (maybe_cleanup_point_expr): Call
fold_build_cleanup_point_expr.
(maybe_cleanup_point_expr_void): New function.
(add_decl_expr): Call maybe_cleanup_point_expr_void.
(finish_expr_stmt): Likewise.
(finish_return_stmt): Likewise.
(finish_for_expr): Likewise.
(finish_asm_stmt): Likewise.
* typeck.c (condition_conversion): Call
fold_build_cleanup_point_expr.
2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/17703
part of PR c++/17657
* fold-const.c (fold_build_cleanup_point_expr): New function.
* tree.h (fold_build_cleanup_point_expr): Prototype.
2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/17554
* g++.dg/init/for3.C: New test.
PR c++/17657
* g++.dg/opt/switch2.C: New test.
PR middle-end/17703
* g++.dg/warn/Wreturn-2.C: New test.
From-SVN: r88869
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 41feda3..1dba1fb 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -10465,6 +10465,21 @@ fold_relational_const (enum tree_code code, tree type, tree op0, tree op1) return constant_boolean_node (result, type); } +/* Build an expression for the a clean point containing EXPR with type TYPE. + Don't build a cleanup point expression for EXPR which don't have side + effects. */ + +tree +fold_build_cleanup_point_expr (tree type, tree expr) +{ + /* If the expression does not have side effects then we don't have to wrap + it with a cleanup point expression. */ + if (!TREE_SIDE_EFFECTS (expr)) + return expr; + + return build1 (CLEANUP_POINT_EXPR, type, expr); +} + /* Build an expression for the address of T. Folds away INDIRECT_REF to avoid confusing the gimplify process. */ |