<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div>I don't have one precise proposal, but somehow,</div><div>jmpbuf/setjmp/longjmp should be represented in a higher level in m3cg</div><div>or maybe "even higher level", exception handling.</div><div><br></div><div><br></div><div>There are multiple optimization opportunties and multiple</div><div>opportunities to move/remove target-dependent code.</div><div><br></div><div><br></div><div><br></div><div>In particular m3middle/m3front should not know jmpbuf size.</div><div>Generated C should not have jmpbuf sizes embedded in it.</div><div><br></div><div><br></div><div>gcc has a "builtin" jmpbuf/setjmp/longjmp notion, for use by exception</div><div>handling, that llvm replicates, that is optimized, like to not</div><div>save/restore unused registers.</div><div><br></div><div><br></div><div>Or, yes, there is my alloca proposal, which doesn't solve as much, but does help.</div><div><br></div><div><br></div><div>In particular, the C backend just wants to know something is a "jmpbuf"</div><div>so it can #include <setjmp.h> in the generated code and produce a</div><div>jmpbuf instead of an array of bytes and call setjmp/longjmp or _setjmp/_longjmp.</div><div><br></div><div><br></div><div>Or even better, a C++ backend wants to somehow module Modula-3 exceptions</div><div>as C++ exceptions.</div><div><br></div><div><br></div><div>Or, possibly, the Win32 C backend could model Modula-3 exceptions using</div><div>"structured exception handling" -- advantage over C++ exceptions is portability</div><div>to kernel mode.</div><div><br></div><div><br></div><div>Thoughts?</div><div> - Jay</div><br><br>                                      </div></body>
</html>