rs6000.c (rs6000_output_function_epilogue): Don't insert a label at the end of an...
authorGeoffrey Keating <geoffk@apple.com>
Sat, 26 Jul 2003 07:34:21 +0000 (07:34 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Sat, 26 Jul 2003 07:34:21 +0000 (07:34 +0000)
* config/rs6000/rs6000.c (rs6000_output_function_epilogue): Don't
insert a label at the end of an function under Mach-O.

From-SVN: r69809

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index fa369f4..23f7780 100644 (file)
@@ -1,4 +1,7 @@
-2003-07-25  Geoffrey Keating  <geoffk@apple.com>
+2003-07-26  Geoffrey Keating  <geoffk@apple.com>
+
+       * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Don't
+       insert a label at the end of an function under Mach-O.
 
        * c-decl.c (c_static_assembler_name): Remove TREE_STATIC test.
 
index 10a6a53..19a77fd 100644 (file)
@@ -12116,6 +12116,23 @@ rs6000_output_function_epilogue (file, size)
        }
     }
 
+#if TARGET_OBJECT_FORMAT == OBJECT_MACHO
+  /* Mach-O doesn't support labels at the end of objects, so if
+     it looks like we might want one, insert a NOP.  */
+  {
+    rtx insn = get_last_insn ();
+    while (insn
+          && NOTE_P (insn)
+          && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL)
+      insn = PREV_INSN (insn);
+    if (insn 
+       && (LABEL_P (insn) 
+           || (NOTE_P (insn)
+               && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL)))
+      fputs ("\tnop\n", file);
+  }
+#endif
+
   /* Output a traceback table here.  See /usr/include/sys/debug.h for info
      on its format.