re PR middle-end/42678 (ICE with lto1 in expand_mult, at expmed.c:3253)

2010-01-13  Richard Guenther  <rguenther@suse.de>

	PR lto/42678
	* tree-pass.h (PROP_gimple_lcx): New.
	* cfgexpand.c (pass_expand): Require PROP_gimple_lcx.
	* passes.c (init_optimization_passes): Move pass_lower_complex_O0
	before the final cleanup_eh.
	(dump_properties): Dump PROP_gimple_lcx.
	* tree-complex.c (pass_lower_complex): Provide PROP_gimple_lcx.
	(tree_lower_complex_O0): Remove.
	(gate_no_optimization): Run if PROP_gimple_lcx is not set.
	(pass_lower_complex_O0): Provide PROP_gimple_lcx.  Run
	tree_lower_complex, schedule TODO_update_ssa.
	* lto-streamer-out.c (output_function): Stream the functions
	properties.
	* lto-streamer-in.c (input_function): Likewise.
	(lto_read_body): Do not override them here.

	* gfortran.dg/lto/20100110-1_0.f90: New testcase.

From-SVN: r155853
This commit is contained in:
Richard Guenther 2010-01-13 10:07:47 +00:00 committed by Richard Biener
parent 288de41a81
commit 688a482d63
9 changed files with 62 additions and 36 deletions

View File

@ -1,3 +1,21 @@
2010-01-13 Richard Guenther <rguenther@suse.de>
PR lto/42678
* tree-pass.h (PROP_gimple_lcx): New.
* cfgexpand.c (pass_expand): Require PROP_gimple_lcx.
* passes.c (init_optimization_passes): Move pass_lower_complex_O0
before the final cleanup_eh.
(dump_properties): Dump PROP_gimple_lcx.
* tree-complex.c (pass_lower_complex): Provide PROP_gimple_lcx.
(tree_lower_complex_O0): Remove.
(gate_no_optimization): Run if PROP_gimple_lcx is not set.
(pass_lower_complex_O0): Provide PROP_gimple_lcx. Run
tree_lower_complex, schedule TODO_update_ssa.
* lto-streamer-out.c (output_function): Stream the functions
properties.
* lto-streamer-in.c (input_function): Likewise.
(lto_read_body): Do not override them here.
2010-01-12 Joseph Myers <joseph@codesourcery.com>
PR c/42708

View File

@ -3743,7 +3743,8 @@ struct rtl_opt_pass pass_expand =
NULL, /* next */
0, /* static_pass_number */
TV_EXPAND, /* tv_id */
PROP_ssa | PROP_gimple_leh | PROP_cfg,/* properties_required */
PROP_ssa | PROP_gimple_leh | PROP_cfg
| PROP_gimple_lcx, /* properties_required */
PROP_rtl, /* properties_provided */
PROP_ssa | PROP_trees, /* properties_destroyed */
TODO_verify_ssa | TODO_verify_flow

View File

@ -1291,6 +1291,9 @@ input_function (tree fn_decl, struct data_in *data_in,
fn->va_list_gpr_size = bp_unpack_value (bp, 8);
bitpack_delete (bp);
/* Input the current IL state of the function. */
fn->curr_properties = lto_input_uleb128 (ib);
/* Read the static chain and non-local goto save area. */
fn->static_chain_decl = lto_input_tree (ib, data_in);
fn->nonlocal_goto_save_area = lto_input_tree (ib, data_in);
@ -1466,14 +1469,6 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl,
/* We should now be in SSA. */
cfun->gimple_df->in_ssa_p = true;
/* Fill in properties we know hold for the rebuilt CFG. */
cfun->curr_properties = PROP_ssa
| PROP_cfg
| PROP_gimple_any
| PROP_gimple_lcf
| PROP_gimple_leh
| PROP_referenced_vars;
/* Restore decl state */
file_data->current_decl_state = file_data->global_decl_state;

View File

@ -1872,6 +1872,9 @@ output_function (struct cgraph_node *node)
lto_output_bitpack (ob->main_stream, bp);
bitpack_delete (bp);
/* Output current IL state of the function. */
output_uleb128 (ob, fn->curr_properties);
/* Output the static chain and non-local goto save area. */
lto_output_tree_ref (ob, fn->static_chain_decl);
lto_output_tree_ref (ob, fn->nonlocal_goto_save_area);

View File

@ -728,7 +728,6 @@ init_optimization_passes (void)
NEXT_PASS (pass_refactor_eh);
NEXT_PASS (pass_lower_eh);
NEXT_PASS (pass_build_cfg);
NEXT_PASS (pass_lower_complex_O0);
NEXT_PASS (pass_lower_vector);
NEXT_PASS (pass_warn_function_return);
NEXT_PASS (pass_build_cgraph_edges);
@ -943,6 +942,7 @@ init_optimization_passes (void)
NEXT_PASS (pass_uncprop);
NEXT_PASS (pass_local_pure_const);
}
NEXT_PASS (pass_lower_complex_O0);
NEXT_PASS (pass_cleanup_eh);
NEXT_PASS (pass_lower_resx);
NEXT_PASS (pass_nrv);
@ -1883,6 +1883,8 @@ dump_properties (FILE *dump, unsigned int props)
fprintf (dump, "PROP_rtl\n");
if (props & PROP_gimple_lomp)
fprintf (dump, "PROP_gimple_lomp\n");
if (props & PROP_gimple_lcx)
fprintf (dump, "PROP_gimple_lcx\n");
}
void

View File

@ -1,3 +1,8 @@
2010-01-13 Richard Guenther <rguenther@suse.de>
PR lto/42678
* gfortran.dg/lto/20100110-1_0.f90: New testcase.
2010-01-12 Joseph Myers <joseph@codesourcery.com>
PR c/42708

View File

@ -0,0 +1,19 @@
! { dg-lto-do link }
! { dg-lto-options {{ -O1 -flto }} }
! { dg-suppress-ld-options "-O1" }
SUBROUTINE ylm4(ylm)
COMPLEX, INTENT (OUT):: ylm(1)
INTEGER l,m
COMPLEX ylms
REAL, ALLOCATABLE, SAVE :: ynorm(:)
ylms = 0
DO m = 1, 1
DO l = m, 1
ylm(m) = conjg(ylms)*ynorm(m)
ENDDO
ENDDO
END SUBROUTINE ylm4
PROGRAM test
END

View File

@ -1622,7 +1622,7 @@ struct gimple_opt_pass pass_lower_complex =
0, /* static_pass_number */
TV_NONE, /* tv_id */
PROP_ssa, /* properties_required */
0, /* properties_provided */
PROP_gimple_lcx, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_dump_func
@ -1633,32 +1633,12 @@ struct gimple_opt_pass pass_lower_complex =
};
/* Entry point for complex operation lowering without optimization. */
static unsigned int
tree_lower_complex_O0 (void)
{
int old_last_basic_block = last_basic_block;
gimple_stmt_iterator gsi;
basic_block bb;
FOR_EACH_BB (bb)
{
if (bb->index >= old_last_basic_block)
continue;
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
expand_complex_operations_1 (&gsi);
}
return 0;
}
static bool
gate_no_optimization (void)
{
/* With errors, normal optimization passes are not run. If we don't
lower complex operations at all, rtl expansion will abort. */
return optimize == 0 || sorrycount || errorcount;
return !(cfun->curr_properties & PROP_gimple_lcx);
}
struct gimple_opt_pass pass_lower_complex_O0 =
@ -1667,16 +1647,18 @@ struct gimple_opt_pass pass_lower_complex_O0 =
GIMPLE_PASS,
"cplxlower0", /* name */
gate_no_optimization, /* gate */
tree_lower_complex_O0, /* execute */
tree_lower_complex, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
TV_NONE, /* tv_id */
PROP_cfg, /* properties_required */
0, /* properties_provided */
PROP_gimple_lcx, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_dump_func | TODO_ggc_collect
| TODO_verify_stmts, /* todo_flags_finish */
TODO_dump_func
| TODO_ggc_collect
| TODO_update_ssa
| TODO_verify_stmts /* todo_flags_finish */
}
};

View File

@ -226,6 +226,7 @@ struct dump_file_info
#define PROP_rtl (1 << 7)
#define PROP_gimple_lomp (1 << 8) /* lowered OpenMP directives */
#define PROP_cfglayout (1 << 9) /* cfglayout mode on RTL */
#define PROP_gimple_lcx (1 << 10) /* lowered complex */
#define PROP_trees \
(PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh | PROP_gimple_lomp)