]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Index: gcc/ChangeLog
authorGeoffrey Keating <geoffk@apple.com>
Tue, 9 Oct 2007 22:56:58 +0000 (22:56 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Tue, 9 Oct 2007 22:56:58 +0000 (22:56 +0000)
2007-10-09  Geoffrey Keating  <geoffk@apple.com>

* dwarf2out.c (output_call_frame_info): FDEs are always emitted
if flag_exceptions is not set.
* config/darwin.c (darwin_emit_unwind_label): Rewrite to use
assemble_name rather than incorrectly emulating it.

Index: gcc/testsuite/ChangeLog
2007-10-09  Geoffrey Keating  <geoffk@apple.com>

* gcc.dg/unwind-1.c: New.

From-SVN: r129187

gcc/ChangeLog
gcc/config/darwin.c
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/unwind-1.c [new file with mode: 0644]

index 75956004978ea9244ebc49dba23c79f4659006e5..cb9b8784d549765a98b2e46e5fbcc8d89a58419e 100644 (file)
@@ -1,5 +1,10 @@
 2007-10-09  Geoffrey Keating  <geoffk@apple.com>
 
+       * dwarf2out.c (output_call_frame_info): FDEs are always emitted
+       if flag_exceptions is not set.
+       * config/darwin.c (darwin_emit_unwind_label): Rewrite to use
+       assemble_name rather than incorrectly emulating it.
+
        * doc/extend.texi (Deprecated Features): Mention that <? and >? and
        friends are removed from G++.
 
index d2514740b103603b5715a4f499227618d6abb79d..66d1ab046475c6765b36077abee83c18fb3ae4aa 100644 (file)
@@ -1465,12 +1465,6 @@ darwin_handle_weak_import_attribute (tree *node, tree name,
   return NULL_TREE;
 }
 
-static void
-no_dead_strip (FILE *file, const char *lab)
-{
-  fprintf (file, ".no_dead_strip %s\n", lab);
-}
-
 /* Emit a label for an FDE, making it global and/or weak if appropriate.
    The third parameter is nonzero if this is for exception handling.
    The fourth parameter is nonzero if this is just a placeholder for an
@@ -1479,46 +1473,44 @@ no_dead_strip (FILE *file, const char *lab)
 void
 darwin_emit_unwind_label (FILE *file, tree decl, int for_eh, int empty)
 {
-  const char *base;
   char *lab;
-  bool need_quotes;
-
-  if (DECL_ASSEMBLER_NAME_SET_P (decl))
-    base = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
-  else
-    base = IDENTIFIER_POINTER (DECL_NAME (decl));
-
-  base = targetm.strip_name_encoding (base);
-  need_quotes = name_needs_quotes (base);
 
   if (! for_eh)
     return;
 
-  lab = concat (need_quotes ? "\"" : "", user_label_prefix, base, ".eh",
-               need_quotes ? "\"" : "", NULL);
+  lab = concat (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)), ".eh", NULL);
 
   if (TREE_PUBLIC (decl))
-    fprintf (file, "\t%s %s\n",
-            (DECL_VISIBILITY (decl) != VISIBILITY_HIDDEN
-             ? ".globl"
-             : ".private_extern"),
-            lab);
+    {
+      targetm.asm_out.globalize_label (file, lab);
+      if (DECL_VISIBILITY (decl) == VISIBILITY_HIDDEN)
+       {
+         fputs ("\t.private_extern ", file);
+         assemble_name (file, lab);
+         fputc ('\n', file);
+       }
+    }
 
   if (DECL_WEAK (decl))
-    fprintf (file, "\t.weak_definition %s\n", lab);
+    {
+      fputs ("\t.weak_definition ", file);
+      assemble_name (file, lab);
+      fputc ('\n', file);
+    }
 
+  assemble_name (file, lab);
   if (empty)
     {
-      fprintf (file, "%s = 0\n", lab);
+      fputs (" = 0\n", file);
 
       /* Mark the absolute .eh and .eh1 style labels as needed to
         ensure that we don't dead code strip them and keep such
         labels from another instantiation point until we can fix this
         properly with group comdat support.  */
-      no_dead_strip (file, lab);
+      darwin_mark_decl_preserved (lab);
     }
   else
-    fprintf (file, "%s:\n", lab);
+    fputs (":\n", file);
 
   free (lab);
 }
index d17226e9fcf4e0ceea819dc62328e2e70c6e90b3..8a398e4d465d3324596dc88e8eb80dfff6627c21 100644 (file)
@@ -2223,6 +2223,7 @@ output_call_frame_info (int for_eh)
      specialization doesn't.  */
   if (TARGET_USES_WEAK_UNWIND_INFO
       && ! flag_asynchronous_unwind_tables
+      && flag_exceptions
       && for_eh)
     for (i = 0; i < fde_table_in_use; i++)
       if ((fde_table[i].nothrow || fde_table[i].all_throwers_are_sibcalls)
index ff8f67dbb13ebb7715f1b949a17ef7c9000bd2c1..a764dfecec3d564495798ea6c441203d7a6aa49e 100644 (file)
@@ -1,3 +1,7 @@
+2007-10-09  Geoffrey Keating  <geoffk@apple.com>
+
+       * gcc.dg/unwind-1.c: New.
+
 2007-10-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR libfortran/33683
diff --git a/gcc/testsuite/gcc.dg/unwind-1.c b/gcc/testsuite/gcc.dg/unwind-1.c
new file mode 100644 (file)
index 0000000..a24af92
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do assemble } */
+/* { dg-options "-fleading-underscore -funwind-tables" } */
+
+void func(void) __asm("_func");
+void _func(int x) {}
+void func(void) {}
+