From a3d09469041ab66ee1e12c2f3e4de33c4bf96732 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 18 Sep 2019 11:28:20 +0000 Subject: [PATCH] re PR lto/91763 (go.go-torture/execute/printnil.go FAILs) 2019-09-18 Richard Biener PR lto/91763 * lto-streamer-in.c (input_eh_regions): Move EH init to lto_materialize_function. * tree-streamer-in.c (lto_input_ts_function_decl_tree_pointers): Likewise. lto/ * lto.c (lto_materialize_function): Initialize EH by looking at the function personality and flag_exceptions setting. From-SVN: r275872 --- gcc/ChangeLog | 8 ++++++++ gcc/lto-streamer-in.c | 5 ----- gcc/lto/ChangeLog | 6 ++++++ gcc/lto/lto.c | 6 ++++++ gcc/tree-streamer-in.c | 6 ------ 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 57850818f28..1907307c762 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-09-18 Richard Biener + + PR lto/91763 + * lto-streamer-in.c (input_eh_regions): Move EH init to + lto_materialize_function. + * tree-streamer-in.c (lto_input_ts_function_decl_tree_pointers): + Likewise. + 2019-09-18 Richard Sandiford * tree-ssa-ccp.c (get_value_for_expr): Check whether CONSTANTs diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index 3158edd4c5f..32b5d5fa50c 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -615,11 +615,6 @@ input_eh_regions (class lto_input_block *ib, class data_in *data_in, lto_tag_check_range (tag, LTO_eh_table, LTO_eh_table); - /* If the file contains EH regions, then it was compiled with - -fexceptions. In that case, initialize the backend EH - machinery. */ - lto_init_eh (); - gcc_assert (fn->eh); root_region = streamer_read_hwi (ib); diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 4e68fbf2854..a73cbc4ca9f 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2019-09-18 Richard Biener + + PR lto/91763 + * lto.c (lto_materialize_function): Initialize EH by looking + at the function personality and flag_exceptions setting. + 2019-08-23 Jakub Jelinek PR middle-end/91283 diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 814f03a1777..af3590cdad8 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -107,6 +107,12 @@ lto_materialize_function (struct cgraph_node *node) return; if (DECL_FUNCTION_PERSONALITY (decl) && !first_personality_decl) first_personality_decl = DECL_FUNCTION_PERSONALITY (decl); + /* If the file contains a function with a language specific EH + personality set or with EH enabled initialize the backend EH + machinery. */ + if (DECL_FUNCTION_PERSONALITY (decl) + || opt_for_fn (decl, flag_exceptions)) + lto_init_eh (); } /* Let the middle end know about the function. */ diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c index dcd511e4b55..5152d10956b 100644 --- a/gcc/tree-streamer-in.c +++ b/gcc/tree-streamer-in.c @@ -802,12 +802,6 @@ lto_input_ts_function_decl_tree_pointers (class lto_input_block *ib, } } #endif - - /* 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 (); } -- 2.30.2