This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: what optimizations are invalid in java?


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]