diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2009-07-07 22:18:35 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2009-07-07 22:18:35 +0000 |
commit | d665b6e585efbb1d90b33f330a2cd967430c95a1 (patch) | |
tree | bc411ee056cbc9d17c3e9d69c14e65d3779c178c /gcc/tree-cfg.c | |
parent | 438c0fa8a04a3f11df33890b3d183f64fa181b55 (diff) | |
download | gcc-d665b6e585efbb1d90b33f330a2cd967430c95a1.zip gcc-d665b6e585efbb1d90b33f330a2cd967430c95a1.tar.gz gcc-d665b6e585efbb1d90b33f330a2cd967430c95a1.tar.bz2 |
re PR c++/31246 (-Wunreachable-code warnings for compiler-generated code)
2009-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/31246
* gimplify.c (gimplify_expr): Propagate no_warning flag when
gimplifying.
* gimple (gimple_build_call_from_tree): Likewise.
* tree-cfg.c (remove_useless_stmts_warn_notreached): Check
no_warning flag before warning.
cp/
* init.c (build_new_1): Set TREE_NO_WARNING for compiler-generated
code.
* cp-gimplify.c (genericize_eh_spec_block): Likewise.
testsuite/
* g++.dg/warn/pr31246.C: New.
* g++.dg/warn/pr31246-2.C: New.
From-SVN: r149354
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index f18bb97..dd38134 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -1638,6 +1638,8 @@ remove_useless_stmts_warn_notreached (gimple_seq stmts) { gimple stmt = gsi_stmt (gsi); + if (gimple_no_warning_p (stmt)) return false; + if (gimple_has_location (stmt)) { location_t loc = gimple_location (stmt); |