Commit 2aaed0f3 by Richard Biener Committed by Richard Biener

re PR tree-optimization/59715 (wrong code at -Os and above on x86_64-linux-gnu)

2014-01-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/59715
	* tree-cfg.h (split_critical_edges): Declare.
	* tree-cfg.c (split_critical_edges): Export.
	* tree-ssa-sink.c (execute_sink_code): Split critical edges.

	* gcc.dg/torture/pr59715.c: New testcase.

From-SVN: r206460
parent b5ebc991
2014-01-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/59715
* tree-cfg.h (split_critical_edges): Declare.
* tree-cfg.c (split_critical_edges): Export.
* tree-ssa-sink.c (execute_sink_code): Split critical edges.
2014-01-09 Max Ostapenko <m.ostapenko@partner.samsung.com>
* cfgexpand.c (expand_stack_vars): Optionally disable
......
2014-01-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/59715
* gcc.dg/torture/pr59715.c: New testcase.
2014-01-09 Max Ostapenko <m.ostapenko@partner.samsung.com>
* c-c++-common/asan/no-asan-globals.c: New test.
......
/* { dg-do run } */
extern void abort (void);
int a = 2, b;
int
main ()
{
int c;
if (!b)
{
b = a;
c = a == 0 ? 1 : 1 % a;
if (c)
b = 0;
}
if (b != 0)
abort ();
return 0;
}
......@@ -159,7 +159,6 @@ static void make_goto_expr_edges (basic_block);
static void make_gimple_asm_edges (basic_block);
static edge gimple_redirect_edge_and_branch (edge, basic_block);
static edge gimple_try_redirect_by_replacing_jump (edge, basic_block);
static unsigned int split_critical_edges (void);
/* Various helpers. */
static inline bool stmt_starts_bb_p (gimple, gimple);
......@@ -7929,7 +7928,7 @@ struct cfg_hooks gimple_cfg_hooks = {
/* Split all critical edges. */
static unsigned int
unsigned int
split_critical_edges (void)
{
basic_block bb;
......
......@@ -93,5 +93,6 @@ extern tree gimplify_build1 (gimple_stmt_iterator *, enum tree_code,
tree, tree);
extern void extract_true_false_edges_from_block (basic_block, edge *, edge *);
extern unsigned int execute_fixup_cfg (void);
extern unsigned int split_critical_edges (void);
#endif /* _TREE_CFG_H */
......@@ -567,7 +567,7 @@ static void
execute_sink_code (void)
{
loop_optimizer_init (LOOPS_NORMAL);
split_critical_edges ();
connect_infinite_loops_to_exit ();
memset (&sink_stats, 0, sizeof (sink_stats));
calculate_dominance_info (CDI_DOMINATORS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment