+2009-12-11 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41662
+ * lto-streamer-in.c (lto_init_eh): Move eh_initialized_p
+ handling here.
+ (input_eh_regions): Adjust.
+ (lto_input_ts_function_decl_tree_pointers): Initialize EH
+ if a non-NULL DECL_FUNCTION_PERSONALITY was read in.
+
2009-12-11 Duncan Sands <baldrick@free.fr>
* passes.c (make_pass_instance): Allocate and copy the right amount of
static void
lto_init_eh (void)
{
+ static bool eh_initialized_p = false;
+
+ if (eh_initialized_p)
+ return;
+
/* Contrary to most other FEs, we only initialize EH support when at
least one of the files in the set contains exception regions in
it. Since this happens much later than the call to init_eh in
if (dwarf2out_do_frame ())
dwarf2out_frame_init ();
#endif
+
+ eh_initialized_p = true;
}
{
HOST_WIDE_INT i, root_region, len;
enum LTO_tags tag;
- static bool eh_initialized_p = false;
tag = input_record_start (ib);
if (tag == LTO_null)
/* If the file contains EH regions, then it was compiled with
-fexceptions. In that case, initialize the backend EH
machinery. */
- if (!eh_initialized_p)
- {
- lto_init_eh ();
- eh_initialized_p = true;
- }
+ lto_init_eh ();
gcc_assert (fn->eh);
DECL_FUNCTION_PERSONALITY (expr) = lto_input_tree (ib, data_in);
DECL_FUNCTION_SPECIFIC_TARGET (expr) = lto_input_tree (ib, data_in);
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (expr) = lto_input_tree (ib, data_in);
+
+ /* If the file contains a function with an EH personality set,
+ then it was compiled with -fexceptions. In that case, initialize
+ the backend EH machinery. */
+ if (DECL_FUNCTION_PERSONALITY (expr))
+ lto_init_eh ();
}