http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50678
--- Comment #68 from simon at pushface dot org 2013-02-02 17:27:12 UTC ---
(In reply to comment #66)
> (In reply to comment #65)
>
> Something amazing has happened with Xcode 4.6.
>
> I'm running Darwin 12.2.1, Georg is running 11.4.2.
>
> When I built r195611 with Xcode 4.5.2, the test case failed.
>
> When I built with Xcode 4.6, the test case succeeded.
>
> I have also built (regrettably, with Xcode 4.6) a version with the
> register-swap disabled; *and that succeeded too*. So it no longer matters
> whether we swap rbx, rdx.
Apologies to all; I don't know what I did wrong, but now I've rebuilt the
unpatched tree and a version with register-swap disabled in separate build
trees, and the register-swap is no longer needed in Darwin 12.2.1 and, if
applied, results in the same error that it was designed to cure.
I'm still using Xcode 4.6, but I no longer believe that affects this issue.
The compiler was:
Configured with: ../gcc-trunk-svn/configure --prefix=/opt/gcc-4.8-195682
--disable-multilib --enable-languages=c,ada --target=x86_64-apple-darwin12
--build=x86_64-apple-darwin12
Thread model: posix
gcc version 4.8.0 20130202 (experimental) [trunk revision 195682] (GCC)
Unpatched:
=== acats Summary ===
# of expected passes 2319
# of unexpected failures 1
*** FAILURES: c52104y
=== gnat Summary ===
# of expected passes 1158
# of expected failures 17
# of unsupported tests 5
The patch applied was to remove the register swap implemented at r181474:
Index: gcc/ada/init.c
===================================================================
--- gcc/ada/init.c (revision 195682)
+++ gcc/ada/init.c (working copy)
@@ -2093,25 +2093,6 @@
return 0;
}
-#define HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE
-
-void
-__gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED,
- void *ucontext ATTRIBUTE_UNUSED)
-{
-#if defined (__x86_64__)
- /* Work around radar #10302855/pr50678, where the unwinders (libunwind or
- libgcc_s depending on the system revision) and the DWARF unwind data for
- the sigtramp have different ideas about register numbering (causing rbx
- and rdx to be transposed).. */
- ucontext_t *uc = (ucontext_t *)ucontext ;
- unsigned long t = uc->uc_mcontext->__ss.__rbx;
-
- uc->uc_mcontext->__ss.__rbx = uc->uc_mcontext->__ss.__rdx;
- uc->uc_mcontext->__ss.__rdx = t;
-#endif
-}
-
static void
__gnat_error_handler (int sig, siginfo_t *si, void *ucontext)
{
Patched:
=== acats Summary ===
# of expected passes 2320
# of unexpected failures 0
=== gnat Summary ===
# of expected passes 1158
# of expected failures 17
# of unsupported tests 5
I also ran Iain Sandoe's demo using c++/vendor tools (attachment 25540), which
reported:
$ ./fail
caught and OK..
dummy cleanup, OK
The vendor G++ is
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
so I also ran with the G++ in a darwin11 build of GCC 4.7.0; again,
$ ./fail
caught and OK..
dummy cleanup, OK