From: Iain Sandoe Date: Fri, 28 Oct 2011 11:59:07 +0000 (+0000) Subject: re PR target/50678 (FAIL: c52104y on x86_64-apple-darwin10) X-Git-Tag: releases/gcc-4.7.0~2740 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a53f35231396649b873de60f93562e322623c743;p=thirdparty%2Fgcc.git re PR target/50678 (FAIL: c52104y on x86_64-apple-darwin10) ada: PR target/50678 * init.c (Darwin/__gnat_error_handler): Apply a work-around to the bug [filed as radar #10302855], which is inconsistent unwind data for sigtramp. Co-Authored-By: Eric Botcazou From-SVN: r180613 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index bacb37129b61..11d0209738bf 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2011-10-28 Iain Sandoe + Eric Botcazou + + PR target/50678 + * init.c (Darwin/__gnat_error_handler): Apply a work-around to the + bug [filed as radar #10302855], which is inconsistent unwind data + for sigtramp. + 2011-10-28 Eric Botcazou PR ada/50842 diff --git a/gcc/ada/init.c b/gcc/ada/init.c index 9ac475da3c53..8d2f4e1f235d 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -2287,6 +2287,16 @@ __gnat_error_handler (int sig, siginfo_t *si, void *ucontext ATTRIBUTE_UNUSED) { struct Exception_Data *exception; const char *msg; +#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 switch (sig) {