aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 2f5bd2a..75447be 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -84,6 +84,7 @@ The callgraph:
#include "tree-dump.h"
#include "tree-flow.h"
#include "value-prof.h"
+#include "except.h"
static void cgraph_node_remove_callers (struct cgraph_node *node);
static inline void cgraph_edge_remove_caller (struct cgraph_edge *e);
@@ -1953,6 +1954,12 @@ cgraph_add_new_function (tree fndecl, bool lowered)
current_function_decl = NULL;
break;
}
+
+ /* Set a personality if required and we already passed EH lowering. */
+ if (lowered
+ && (function_needs_eh_personality (DECL_STRUCT_FUNCTION (fndecl))
+ == eh_personality_lang))
+ DECL_FUNCTION_PERSONALITY (fndecl) = lang_hooks.eh_personality ();
}
/* Return true if NODE can be made local for API change.