]> gcc.gnu.org Git - gcc.git/commitdiff
re PR lto/44230 (Do not create need for multiple EH personalities)
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 27 May 2010 14:11:35 +0000 (14:11 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 27 May 2010 14:11:35 +0000 (14:11 +0000)
PR lto/44230
* dwarf2out.c (dwarf2out_begin_prologue): Fix nits in sorry message.
lto/
* lto.h (lto_eh_personality): New prototype.
* lto.c: Include debug.h.
(first_personality_decl): New static variable.
(lto_materialize_function): Set it to DECL_FUNCTION_PERSONALITY of the
first function for which it is non-null.
(lto_eh_personality_decl): New static variable.
(lto_eh_personality): New function.
* lto-lang.c (LANG_HOOKS_EH_PERSONALITY): Redefine to above function.
* Make-lang.in (lto/lto.o): Add dependency on debug.h.

From-SVN: r159921

gcc/ChangeLog
gcc/dwarf2out.c
gcc/lto/ChangeLog
gcc/lto/Make-lang.in
gcc/lto/lto-lang.c
gcc/lto/lto.c
gcc/lto/lto.h

index 947d1b11c8dabf690a4e8d523812e91ad9a27461..9c4d319df4ca5831c16fdfa342208bec17511ce3 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-27  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR lto/44230
+       * dwarf2out.c (dwarf2out_begin_prologue): Fix nits in sorry message.
+
 2010-05-27  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/44284
index a50e02ae5081469c12e52ceac4bcb216611b54d9..ca2194f2b484c82340a4837053a41b092f5c0fe5 100644 (file)
@@ -4009,12 +4009,11 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED,
         current_unit_personality = personality;
 
       /* We cannot keep a current personality per function as without CFI
-        asm at the point where we emit the CFI data there is no current
+        asm, at the point where we emit the CFI data, there is no current
         function anymore.  */
-      if (personality
-         && current_unit_personality != personality)
-       sorry ("Multiple EH personalities are supported only with assemblers "
-              "supporting .cfi.personality directive.");
+      if (personality && current_unit_personality != personality)
+       sorry ("multiple EH personalities are supported only with assemblers "
+              "supporting .cfi_personality directive");
     }
 }
 
index 0ab3a925bfa2e896aeb5cdfd0c3afb737fca62cd..2922c80a7751d21fa75c4460b398a30ec43c35d5 100644 (file)
@@ -1,3 +1,16 @@
+2010-05-27  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR lto/44230
+       * lto.h (lto_eh_personality): New prototype.
+       * lto.c: Include debug.h.
+       (first_personality_decl): New static variable.
+       (lto_materialize_function): Set it to DECL_FUNCTION_PERSONALITY of the
+       first function for which it is non-null.
+       (lto_eh_personality_decl): New static variable.
+       (lto_eh_personality): New function.
+       * lto-lang.c (LANG_HOOKS_EH_PERSONALITY): Redefine to above function.
+       * Make-lang.in (lto/lto.o): Add dependency on debug.h.
+
 2010-05-26  Steven Bosscher  <steven@gcc.gnu.org>
 
        * lto-lang.c: Do not include expr.h.
index 149644972af150c7dd0b8686a9c30d9506544d05..b18747e76bbab320eb6fcdd8d479010157bf4596 100644 (file)
@@ -84,7 +84,7 @@ lto/lto.o: lto/lto.c $(CONFIG_H) $(SYSTEM_H) coretypes.h opts.h \
        toplev.h $(TREE_H) $(DIAGNOSTIC_H) $(TM_H) $(LIBIBERTY_H) \
        $(CGRAPH_H) $(GGC_H) tree-ssa-operands.h $(TREE_PASS_H) \
        langhooks.h vec.h $(BITMAP_H) pointer-set.h $(IPA_PROP_H) \
-       $(COMMON_H) $(TIMEVAR_H) $(GIMPLE_H) $(LTO_H) $(LTO_TREE_H) \
+       $(COMMON_H) debug.h $(TIMEVAR_H) $(GIMPLE_H) $(LTO_H) $(LTO_TREE_H) \
        $(LTO_TAGS_H) $(LTO_STREAMER_H) gt-lto-lto.h
 lto/lto-elf.o: lto/lto-elf.c $(CONFIG_H) coretypes.h $(SYSTEM_H) \
        toplev.h $(LTO_H) $(TM_H) $(LIBIBERTY_H) $(GGC_H) $(LTO_STREAMER_H)
index 4882315435898e44a05a4d63a599e8c0eeae751b..974e3d7328bdcf8ed1c4c0e893634513b75d8826 100644 (file)
@@ -1161,6 +1161,8 @@ static void lto_init_ts (void)
 #define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true
 #undef LANG_HOOKS_TYPES_COMPATIBLE_P
 #define LANG_HOOKS_TYPES_COMPATIBLE_P NULL
+#undef LANG_HOOKS_EH_PERSONALITY
+#define LANG_HOOKS_EH_PERSONALITY lto_eh_personality
 
 /* Attribute hooks.  */
 #undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
index d1ccc5a9adfcc4d794e6304373df01028233c898..52ef9edbafdab847ad2465e1e97bc64b3e376620 100644 (file)
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "pointer-set.h"
 #include "ipa-prop.h"
 #include "common.h"
+#include "debug.h"
 #include "timevar.h"
 #include "gimple.h"
 #include "lto.h"
@@ -61,6 +62,9 @@ along with GCC; see the file COPYING3.  If not see
 DEF_VEC_P(bitmap);
 DEF_VEC_ALLOC_P(bitmap,heap);
 
+static GTY(()) tree first_personality_decl;
+
+
 /* Read the constructors and inits.  */
 
 static void
@@ -75,7 +79,7 @@ lto_materialize_constructors_and_inits (struct lto_file_decl_data * file_data)
                         data, len);
 }
 
-/* Read the function body for the function associated with NODE if possible.  */
+/* Read the function body for the function associated with NODE.  */
 
 static void
 lto_materialize_function (struct cgraph_node *node)
@@ -113,9 +117,11 @@ lto_materialize_function (struct cgraph_node *node)
         WPA mode, the body of the function is not needed.  */
       if (!flag_wpa)
        {
-         allocate_struct_function (decl, false);
-         announce_function (node->decl);
+         allocate_struct_function (decl, false);
+         announce_function (decl);
          lto_input_function_body (file_data, decl, data);
+         if (DECL_FUNCTION_PERSONALITY (decl) && !first_personality_decl)
+           first_personality_decl = DECL_FUNCTION_PERSONALITY (decl);
          lto_stats.num_function_bodies++;
        }
 
@@ -1844,6 +1850,28 @@ do_whole_program_analysis (void)
 }
 
 
+static GTY(()) tree lto_eh_personality_decl;
+
+/* Return the LTO personality function decl.  */
+
+tree
+lto_eh_personality (void)
+{
+  if (!lto_eh_personality_decl)
+    {
+      /* Use the first personality DECL for our personality if we don't
+        support multiple ones.  This ensures that we don't artificially
+        create the need for them in a single-language program.  */
+      if (first_personality_decl && !dwarf2out_do_cfi_asm ())
+       lto_eh_personality_decl = first_personality_decl;
+      else
+       lto_eh_personality_decl = lhd_gcc_personality ();
+    }
+
+  return lto_eh_personality_decl;
+}
+
+
 /* Main entry point for the GIMPLE front end.  This front end has
    three main personalities:
 
index 7f8e108054d020751199bf6e80b8b8169310070a..cdd30d6e96052ba541a16b1ce0b19fcac9941f7a 100644 (file)
@@ -36,6 +36,7 @@ typedef struct lto_file_struct
 extern const char *resolution_file_name;
 
 /* In lto.c  */
+extern tree lto_eh_personality (void);
 extern void lto_main (int);
 extern void lto_read_all_file_options (void);
 
This page took 0.125218 seconds and 5 git commands to generate.