aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-in.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-12-11 14:46:09 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-12-11 14:46:09 +0000
commitdad027154e8fff4ccc35940dbd60d4cbc6575aad (patch)
treeef6d51c28d88455bb982f5b2c2a001f4c88cdb52 /gcc/lto-streamer-in.c
parente219f32f4b52e334503376ba983ee1503dd34e09 (diff)
downloadgcc-dad027154e8fff4ccc35940dbd60d4cbc6575aad.zip
gcc-dad027154e8fff4ccc35940dbd60d4cbc6575aad.tar.gz
gcc-dad027154e8fff4ccc35940dbd60d4cbc6575aad.tar.bz2
re PR lto/41662 (FAIL: g++.dg/lto/20081109 cp_lto_20081109_0.o-cp_lto_20081109_1.o execute -O2 -fwhopr)
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. From-SVN: r155163
Diffstat (limited to 'gcc/lto-streamer-in.c')
-rw-r--r--gcc/lto-streamer-in.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index a0ead410..781cf46 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -578,6 +578,11 @@ fixup_eh_region_pointers (struct function *fn, HOST_WIDE_INT root_region)
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
@@ -593,6 +598,8 @@ lto_init_eh (void)
if (dwarf2out_do_frame ())
dwarf2out_frame_init ();
#endif
+
+ eh_initialized_p = true;
}
@@ -605,7 +612,6 @@ input_eh_regions (struct lto_input_block *ib, struct data_in *data_in,
{
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)
@@ -616,11 +622,7 @@ input_eh_regions (struct lto_input_block *ib, struct data_in *data_in,
/* 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);
@@ -2121,6 +2123,12 @@ lto_input_ts_function_decl_tree_pointers (struct lto_input_block *ib,
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 ();
}