[multiple changes]

2014-06-24  Chung-Lin Tang  <cltang@codesourcery.com>

	PR tree-optimization/61554
	* tree-ssa-propagate.c: Include "bitmap.h".
	(substitute_and_fold_dom_walker): Add 'bitmap need_eh_cleanup' member,
	properly update constructor/destructor.
	(substitute_and_fold_dom_walker::before_dom_children):
	Remove call to gimple_purge_dead_eh_edges, add bb->index to
	need_eh_cleaup instead.
	(substitute_and_fold): Call gimple_purge_all_dead_eh_edges on
	need_eh_cleanup.

testsuite/
2014-06-24  Markus Trippelsdorf  <markus@trippelsdorf.de>

	PR tree-optimization/61554
	* g++.dg/torture/pr61554.C: New testcase.

From-SVN: r211928
This commit is contained in:
Chung-Lin Tang 2014-06-24 06:33:58 +00:00
parent 0967188e42
commit 335123531f
4 changed files with 75 additions and 2 deletions

View File

@ -1,3 +1,15 @@
2014-06-24 Chung-Lin Tang <cltang@codesourcery.com>
PR tree-optimization/61554
* tree-ssa-propagate.c: Include "bitmap.h".
(substitute_and_fold_dom_walker): Add 'bitmap need_eh_cleanup' member,
properly update constructor/destructor.
(substitute_and_fold_dom_walker::before_dom_children):
Remove call to gimple_purge_dead_eh_edges, add bb->index to
need_eh_cleaup instead.
(substitute_and_fold): Call gimple_purge_all_dead_eh_edges on
need_eh_cleanup.
2014-06-23 Jan Hubicka <hubicka@ucw.cz>
* varpool.c (dump_varpool_node): Dump used_by_single_function.

View File

@ -1,3 +1,8 @@
2014-06-24 Markus Trippelsdorf <markus@trippelsdorf.de>
PR tree-optimization/61554
* g++.dg/torture/pr61554.C: New testcase.
2014-06-23 Max Ostapenko <m.ostapenko@partner.samsung.com>
* c-c++-common/asan/strlen-overflow-1.c: Change match patterns.

View File

@ -0,0 +1,46 @@
// { dg-do compile }
struct A
{
A ();
};
const unsigned long &min (const unsigned long &, const unsigned long &) {}
template <typename _InputIterator1, typename _InputIterator2,
typename _OutputIterator, typename _BinaryOperation>
void transform (_InputIterator1 p1, _InputIterator2, _OutputIterator,
_BinaryOperation p4)
{
for (; p1;)
p4 (0, 0);
}
class multi_array
{
public:
multi_array (int &, int &);
int &resize_ranges;
int resize___trans_tmp_1;
void m_fn1 ()
{
multi_array a (resize_ranges, this->m_fn2 ());
const unsigned long &(*b)(const unsigned long &, const unsigned long &)
= min;
transform (&resize___trans_tmp_1, 0, 0, b);
A c;
}
~multi_array ()
{
for (int i; &base_;)
;
}
int base_;
int &m_fn2 ();
};
class B
{
void m_fn3 (const int &, const int &);
multi_array _bookingSnapshotBlock;
};
void B::m_fn3 (const int &, const int &) { _bookingSnapshotBlock.m_fn1 (); }

View File

@ -29,6 +29,7 @@
#include "function.h"
#include "gimple-pretty-print.h"
#include "dumpfile.h"
#include "bitmap.h"
#include "sbitmap.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
@ -1031,8 +1032,13 @@ public:
fold_fn (fold_fn_), do_dce (do_dce_), something_changed (false)
{
stmts_to_remove.create (0);
need_eh_cleanup = BITMAP_ALLOC (NULL);
}
~substitute_and_fold_dom_walker ()
{
stmts_to_remove.release ();
BITMAP_FREE (need_eh_cleanup);
}
~substitute_and_fold_dom_walker () { stmts_to_remove.release (); }
virtual void before_dom_children (basic_block);
virtual void after_dom_children (basic_block) {}
@ -1042,6 +1048,7 @@ public:
bool do_dce;
bool something_changed;
vec<gimple> stmts_to_remove;
bitmap need_eh_cleanup;
};
void
@ -1144,7 +1151,7 @@ substitute_and_fold_dom_walker::before_dom_children (basic_block bb)
/* If we cleaned up EH information from the statement,
remove EH edges. */
if (maybe_clean_or_replace_eh_stmt (old_stmt, stmt))
gimple_purge_dead_eh_edges (bb);
bitmap_set_bit (need_eh_cleanup, bb->index);
if (is_gimple_assign (stmt)
&& (get_gimple_rhs_class (gimple_assign_rhs_code (stmt))
@ -1235,6 +1242,9 @@ substitute_and_fold (ssa_prop_get_value_fn get_value_fn,
}
}
if (!bitmap_empty_p (walker.need_eh_cleanup))
gimple_purge_all_dead_eh_edges (walker.need_eh_cleanup);
statistics_counter_event (cfun, "Constants propagated",
prop_stats.num_const_prop);
statistics_counter_event (cfun, "Copies propagated",