This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/50678] [4.7 Regression] FAIL: c52104y on x86_64-apple-darwin10
- From: "iains at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 17 Oct 2011 18:07:09 +0000
- Subject: [Bug target/50678] [4.7 Regression] FAIL: c52104y on x86_64-apple-darwin10
- Auto-submitted: auto-generated
- References: <bug-50678-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50678
--- Comment #36 from Iain Sandoe <iains at gcc dot gnu.org> 2011-10-17 18:07:09 UTC ---
(In reply to comment #35)
> In any case, the problem is elsewhere, namely in the
> unwind info for the _sigtramp function of the libc:
apropos the i386 variant:
> loc_expr_for_reg (0, MCONTEXT_SS_EAX)
> loc_expr_for_reg (1, MCONTEXT_SS_ECX)
> loc_expr_for_reg (2, MCONTEXT_SS_EDX)
note that (despite the consistency within the code here) this differs from the
order in gcc/config/i386/i386.h... (although these are not call-saved, still
... )
apropos the x86_64 variant:
> This should be reported to Apple and probably fixed in the libc.
is there a definitive "right" or "wrong' - should I be patching
gcc/config/i386/darwin.h to match the sigtramp and bug-file against libunwind?
or just file a bug agains the sigtramp (the order there matches the context
order).
It should be possible to produce a test-case w/out Ada (filing a bug that
requires GCC+Ada is not likely to get far). I wonder why my c++ case doesn't
appear to fail.
> In the
> meantime, we can work around it in ada/init.c/__gnat_error_handler:
>
> static void
> __gnat_error_handler (int sig, siginfo_t *si, void *ucontext ATTRIBUTE_UNUSED)
> {
>
> by patching up the context reachable through the ucontext argument. According
> to the comment in the libc file, it is at ucontext->uc_mcontext.
poof-of-principle (needs some careful consideration of how to wrap it so we can
control its removal when the bug is fixed).. [ using
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ is on my mind]
#if defined (__x86_64__)
/* Work around an unwinder bug in libSystem where the unwinder
and the context/sigtramp have different ideas about the reg.
numbers. */
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