Revised patch for GCC bug #56742 (again)

This commit is contained in:
Erik van Pienbroek 2013-06-01 13:34:06 +02:00
parent 8a50d56954
commit 01a6783934
2 changed files with 25 additions and 12 deletions

View File

@ -1,6 +1,8 @@
--- a/gcc/config/i386/i386.c
+++ a/gcc/config/i386/i386.c
@@ -35564,6 +35564,35 @@ ix86_pad_short_function (void)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 3470fef..20163b1 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -35564,6 +35564,46 @@ ix86_pad_short_function (void)
}
}
@ -17,26 +19,37 @@
+
+ FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
+ {
+ rtx insn = BB_END (e->src);
+ rtx insn, next;
+
+ /* Find the beginning of the epilogue. */
+ while (insn != NULL
+ && (!NOTE_P (insn)
+ || NOTE_KIND (insn) != NOTE_INSN_EPILOGUE_BEG))
+ insn = PREV_INSN (insn);
+ for (insn = BB_END (e->src); insn != NULL; insn = PREV_INSN (insn))
+ if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_EPILOGUE_BEG)
+ break;
+ if (insn == NULL)
+ continue;
+
+ /* We only care about preceeding insns that can throw. */
+ insn = prev_active_insn (insn);
+ if (insn != NULL && can_throw_internal (insn))
+ emit_insn_after (gen_nops (const1_rtx), insn);
+ if (insn == NULL || !can_throw_internal (insn))
+ continue;
+
+ /* Do not separate calls from their debug information. */
+ for (next = NEXT_INSN (insn); next != NULL; next = NEXT_INSN (next))
+ if (NOTE_P (next)
+ && (NOTE_KIND (next) == NOTE_INSN_VAR_LOCATION
+ || NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION))
+ insn = next;
+ else
+ break;
+
+ emit_insn_after (gen_nops (const1_rtx), insn);
+ }
+}
+
/* Implement machine specific optimizations. We implement padding of returns
for K8 CPUs and pass to avoid 4 jumps in the single 16 byte window. */
static void
@@ -35573,6 +35602,9 @@ ix86_reorg (void)
@@ -35573,6 +35613,9 @@ ix86_reorg (void)
with old MDEP_REORGS that are not CFG based. Recompute it now. */
compute_bb_for_insn ();

View File

@ -698,7 +698,7 @@ rm -f $RPM_BUILD_ROOT%{_bindir}/%{mingw64_target}-%{mingw64_target}-*
%changelog
* Wed May 22 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 4.8.0-4
* Sat Jun 1 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 4.8.0-4
- Revised patch for GCC bug #56742
* Sun Apr 14 2013 Nicola Fontana <ntd@entidi.it> - 4.8.0-3