[mingw-gcc] Revised patch for GCC bug #56742 (again)
Erik van Pienbroek
epienbro at fedoraproject.org
Sat Jun 1 11:34:20 UTC 2013
commit 01a67839349f2dce21991841481027071c0cf98d
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date: Sat Jun 1 13:34:06 2013 +0200
Revised patch for GCC bug #56742 (again)
gcc-bug-56742-seh-uncaught-throw.patch | 35 +++++++++++++++++++++----------
mingw-gcc.spec | 2 +-
2 files changed, 25 insertions(+), 12 deletions(-)
---
diff --git a/gcc-bug-56742-seh-uncaught-throw.patch b/gcc-bug-56742-seh-uncaught-throw.patch
index faf1069..788f4fd 100644
--- a/gcc-bug-56742-seh-uncaught-throw.patch
+++ b/gcc-bug-56742-seh-uncaught-throw.patch
@@ -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 ();
diff --git a/mingw-gcc.spec b/mingw-gcc.spec
index 8153fe9..5b6c872 100644
--- a/mingw-gcc.spec
+++ b/mingw-gcc.spec
@@ -698,7 +698,7 @@ rm -f $RPM_BUILD_ROOT%{_bindir}/%{mingw64_target}-%{mingw64_target}-*
%changelog
-* Wed May 22 2013 Erik van Pienbroek <epienbro at fedoraproject.org> - 4.8.0-4
+* Sat Jun 1 2013 Erik van Pienbroek <epienbro at fedoraproject.org> - 4.8.0-4
- Revised patch for GCC bug #56742
* Sun Apr 14 2013 Nicola Fontana <ntd at entidi.it> - 4.8.0-3
More information about the scm-commits
mailing list