This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: what optimizations are invalid in java?
- From: Tom Tromey <tromey at redhat dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc at gcc dot gnu dot org, java at gcc dot gnu dot org
- Date: 12 Mar 2002 12:49:14 -0700
- Subject: Re: what optimizations are invalid in java?
- References: <20020310122105.GD13110@atrey.karlin.mff.cuni.cz>
- Reply-to: tromey at redhat dot com
>>>>> "Jan" == Jan Hubicka <jh@suse.cz> writes:
Jan> thinking more about Java and exceptions, can someone who
Jan> understand standard better than I do comment what transfromations
Jan> are valid and what invalid:
Jan> fold_const: We can remove dead parts of expresisons poossibly eliminating
Jan> trap.
If they are dead then they can't be executed, correct?
In that case no trap could occur.
Jan> cleanup_cfg: We may eliminate fp comparison that traps in case the associated
Jan> branch is not needed.
Floating point operations never result in traps in Java.
Integer division and mod are the only arithmetic operators to do this.
Jan> GCSE: Can we do code motion that reorder traps? I guess not.
Nope. Java has fairly strict ordering. The effects of an assignment
occurring before such a trap must be visible after the exception is
thrown.
Tom