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
This commit is contained in:
Richard Biener 2014-01-09 09:21:02 +00:00 committed by Richard Biener
parent b5ebc99140
commit 2aaed0f304
6 changed files with 36 additions and 3 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -1,3 +1,8 @@
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.

View File

@ -0,0 +1,21 @@
/* { 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;
}

View File

@ -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;

View File

@ -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 */

View File

@ -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);