2012/12/1 Ulf Magnusson <[email protected]>:
> On Sat, Dec 1, 2012 at 4:33 PM, NightStrike <[email protected]> wrote:
>> On Sat, Dec 1, 2012 at 3:37 AM, Ulf Magnusson <[email protected]> wrote:
>>> Hi,
>>>
>>> If I've understood things correctly, MinGW-w64 uses the SJLJ
>>> (longjmp-based) exceptions implementation for both win32 and win64,
>>> because DW2 (speedy, table-based) can't pass exceptions through
>>> foreign stack frames (e.g., throwing an exception from within a
>>> callback and catching it at the point of setting the callback won't
>>> work). I also believe MinGW uses DW2, because speedy exceptions was
>>> considered worth the breakage. Two questions:
>>>
>>> 1. Other than being broken for passing exceptions through foreign
>>> stack frames, is there something inherent about win64 that makes DW2
>>> difficult to implement for it?
>>>
>>> 2. How long do you think it'll be before MinGW-w64 has zero-cost
>>> exceptions on win32/win64? From some discussion in #mingw@freenode it
>>> sounded like the proper solution would be to implement the same
>>> zero-cost exception model cl uses (not really familiar with it), but
>>> it was implied that it might be patent encumbered on win32.
>>
>> It's called SEH, and it's done for 64-bit.
>>
>
> Do you mean that only cl uses SEH for zero-cost exceptions on win64,
> or that MinGW-w64 does as well?
>
> I'm also a bit confused by the terminology. Looking at e.g.
> http://www.microsoft.com/msj/0197/exception/exception.aspx, it seems
> SEH is an OS-level mechanism for handling low-level exceptions
> (divide-by-zero and the like).
SEH (structured exception handling) is indeed supported by OS.  For
64-bit it is table-based, for 32-bit it is stack-based.
Based on this unwinding-mechanism you can implement any other
high-level exception mechanism on top.  For 64-bit
beginning with gcc 4.8 c++ uses SEH for c++-exception handling.

> How does this relate to C++ exceptions
> and zero-cost (table-based) exception models? When you say that SEH is
> done for 64-bit, do you mean that a zero-cost exception model layered
> on top of SEH is used on win64?
SEH is - for 64-bit - table based.  And yes, as described above,
c++-exception mechanism is build on-top.

> Is SEH used by cl on win32 as well to
> implement C++ exceptions, only it isn't zero-cost there?
It would be possible. MS' compiler does it, but as I described on IRC,
there is still a latent patent issue pending (Borland patent), which
hinder gcc-community to implement this exception-mechanism for 32-bit
Windows.

Kai

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to