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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155853
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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
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);
/* 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;
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);
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);
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);
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
+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
--- /dev/null
+! { 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
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
};
\f
-/* 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 =
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 */
}
};
#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)