]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386.c (ix86_output_function_epilogue): Don't insert a label at the end of an functio...
authorAsher Langton <langton2@llnl.gov>
Thu, 29 Jun 2006 21:49:19 +0000 (21:49 +0000)
committerAsher Langton <langton@gcc.gnu.org>
Thu, 29 Jun 2006 21:49:19 +0000 (21:49 +0000)
* config/i386/i386.c (ix86_output_function_epilogue): Don't
insert a label at the end of an function under Mach-O.

From-SVN: r115079

gcc/ChangeLog
gcc/config/i386/i386.c

index fdcc4b8b7a45c2f9c0e80af9ee0779de67cedf38..5a8cb4a192463896accb02efd8cff51d543b508d 100644 (file)
@@ -1,3 +1,9 @@
+2006-06-29  Asher Langton  <langton2@llnl.gov>
+
+       PR target/25765
+       * config/i386/i386.c (ix86_output_function_epilogue): Don't
+       insert a label at the end of an function under Mach-O.
+       
 2006-06-29  Eric Christopher  <echristo@apple.com>
            Evan Cheng  <evan.cheng@apple.com>
 
index bce7991ad09744fea4bc2f603a8451dc9ff600fb..6c8e1a7e66e51962671c9078f1d4b8976d3f584f 100644 (file)
@@ -5700,6 +5700,23 @@ ix86_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
 {
   if (pic_offset_table_rtx)
     REGNO (pic_offset_table_rtx) = REAL_PIC_OFFSET_TABLE_REGNUM;
+#if TARGET_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
+
 }
 \f
 /* Extract the parts of an RTL expression that is a valid memory address