http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50678

--- Comment #33 from Iain Sandoe <iains at gcc dot gnu.org> 2011-10-17 09:58:53 
UTC ---
Created attachment 25518
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25518
test of a foreign except thrown from a sig handler in c++

1. the code for the D10 libSystem unwind library is available from here:
http://www.opensource.apple.com/tarballs/libunwind/

(the D9 unwinder is just that of gcc-4.0).

2. Looking at a build of this, the order of the assignments (R newRegisters =
register) seems generally scrambled when the getCFA function is inlined.  This
is reproducible with the vendor's tools and the source in 1 at optimization
levels > 0 and not Os.

3. The scrambling is consistent (in and out) - and I'm not 100% sure about
whether this is the fault... ISTM that so long as the re-ordering is local (and
consistent) to optimized code, it could be harmless.

4. the code attached tries to simplify things by emulating the effect from c++.
 I hope that it tries to test the the Right Thing - i.e. that register that
should be preserved across the call to do_fail () are, indeed, preserved to the
catch.

5. I find that the test code succeeds on i386 (D9 and D10).

6. I find that the test code fails on x86-64 (D9 - using the _current_ libgcc_s
unwinder - DYLD_LIBRARY_PATH inserted).  Fails on x86-64 D10 using the
libSystem unwinder (with the scrambling as noted).

... i.e. it fails on two different unwinders.  On both rbx seems to end up as
0.

any comments on the validity of the test would be appreciated.

Reply via email to