Keeping unreachable code
Robert Dewar
dewar@gnat.com
Sun Feb 3 15:29:00 GMT 2002
<<It can if it thinks it is 'dead' code and it does since no jumps targets the
code. The address of the exception handler is kept in a table so the runtime
library can find it.
>>
It cannot throw away a fucntion that could potentially be called from
some other file, that's obvious, and that's what you disagreed with.
<<It is not a whole C function it throws away...it is part of the code I
have modified it to emit for __try/__except blocks.
>>
Then it is not a function, and has nothing to do with what I said. Of course
it will throw away code of the kind you describe. In fact I think you are
persuing a lost cause here. Optimization will kill you in general (we have
found that in the move from GCC 2.8.1 to GCC 3 for GNAT, it was impossible
to keep the old GNAT zero cost exception mechanism working, because of
optimziations -- not only throwing away code, but more importantly, moving
code around in ways that are inconsistent with the model -- I bet you will
run into the same problem.
Why are you doing this at all?
More information about the Gcc
mailing list