This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [ast-optimizer-branch] simplifying C++
On Mon, Jun 17, 2002 at 04:32:00PM -0400, Diego Novillo wrote:
> I would very much like to minimize the extensions we make,
> though. But I don't know enough about Java or C++ to have a
> useful opinion.
A try/catch construct is the obvious must.
Throw and rethrow are helpful. We'll almost certainly want to
move some of the dead-eh-region elimination in except.c from
rtl to trees.
A cleanup-block construct is required for C++ destructors. I
don't recall enough of the semantics of Java try/finally to
know off-hand if we can just use the same code. The difference
would be: can you branch out of the "finally" part of the
Java finally block? If so, is the property that C++ destructors
are better behaved, flow-of-control-wise, interesting to us?
It may not be, given that we would be able to see the other
edges leaving the finally block.
Java has "synchronized" methods, which iirc grab a mutex
associated with the object on entry to the function, and release
it on exit. At heart this is just another cleanup-block with
some specific function calls inside. However, this is interesting
in that post-inlining we may be able to eliminate redundant locks.
As we discussed the other week, it may be interesting to look at
the other constructs that OpenMP (or some other relevant standard)
provide, and implement some superset of Java's synchronization.
r~