Every
test tests a real situation I encountered during development of
both PSEH 1 and PSEH 2 (infinite loops, stack misalignment, compilation
failures, faulty logic, paths in library code that were never executed,
compile-time constants with vs without side effects). Hypothetical
situations are only situations that haven't happened yet
If you have tests to propose, propose tests
Ok these test are fine to test that everything works as it should under
some save assumptions.
The return value of return_positive() is not stored anywhere, and ret
remains uninitialized. Congratulations! you found a compiler bug
No, it's a valid optimisation:
_SEH2EnterFrame is marked returns_twice, GCC should ensure all register
variables to be "dead" (i.e. copied to the stack frame) before calling
it, and warn if they could be clobbered. Trusting the contents of a
register after a call to _SEH2EnterFrame is a bug. Either that, or the
gotos must be confusing GCC's flow control analysis. But the gotos are
necessary for the pretty syntax, so we'll have to pay with yet more
redundant code
The gotos are not "confusing" gcc. SEH2EnterFrame isn't called in the
first except branch, so the compiler is free to keep ret in any
register it likes during that branch. The try branch has no need to
keep ret in any memory location or register at all, because it's not
referenced any more. It's only set to the result of return_zero(). It
wouldn't make sense to store the old result as it will be droped
anyway. In other words the register *is dead* on entering the try
branch. Sorry, but you still didn't find a compiler bug.