When trying to use ObjC exceptions with the new SEH support, the caught object is not the ObjC object, but the _Unwind_Exception instead. Example: @try { id e = [Object new]; printf("@throw %p\n", e); @throw e; } @catch (id e) { printf("@catch %p\n", e); @throw e; } Expected behaviour: Both are the same pointer. Observed behaviour: They differ. Looking further into it, the second pointer is the pointer to the _Unwind_Exception (I added debug code in objc_exception_throw that outputs the pointer after the malloc. It is always the same that's received in the catch). So it seems the generated landing pad for ObjC code is wrong when using SEH. I think it is correct that the landing pad receives the _Unwind_Exception and not the ObjC object. But the landing pad needs to get the ObjC exception out of the _Unwind_Exception and give that back to the user instead of the _Unwind_Exception, which the user should never see. This seems to happen not only with 4.8, but also with 4.9. I marked this bug as blocker, as 4.8 made SEH the default, effectively breaking ObjC execptions on Windows.
Why was this lowered to normal? This is a regression, code that worked fine with GCC 4.7 now just crashes. It makes ObjC code that uses exceptions unusable, as it only crashes.
(In reply to comment #1) > Why was this lowered to normal? This is a regression, code that worked fine > with GCC 4.7 now just crashes. It makes ObjC code that uses exceptions > unusable, as it only crashes. Because ObjC is not a release blocking language, and windows is not a primary platform. That doesn't mean it won't be fixed, that depends on whether someone is volunteering to fix this, just like for any other bug report.
Hmm, this bug looks like a duplicate of PR/56742 Could you test if provided patch in PR/56742 fixes your issue?
Author: ktietz Date: Tue Feb 18 17:02:54 2014 New Revision: 207849 URL: http://gcc.gnu.org/viewcvs?rev=207849&root=gcc&view=rev Log: 2014-02-18 Kai Tietz <ktietz@redhat.com> Jonathan Schleifer <js@webkeks.org> PR objc/56870 * unwind-seh.c (_GCC_specific_handler): Pass proper value to unwind-handler. Modified: trunk/libgcc/ChangeLog trunk/libgcc/unwind-seh.c
Author: ktietz Date: Tue Feb 18 17:04:38 2014 New Revision: 207850 URL: http://gcc.gnu.org/viewcvs?rev=207850&root=gcc&view=rev Log: 2014-02-18 Kai Tietz <ktietz@redhat.com> Jonathan Schleifer <js@webkeks.org> PR objc/56870 * unwind-seh.c (_GCC_specific_handler): Pass proper value to unwind-handler. Modified: branches/gcc-4_8-branch/libgcc/ChangeLog branches/gcc-4_8-branch/libgcc/unwind-seh.c
Fixed