Question on arithmetic overflow detection support in C2

Krystal Mok rednaxelafx at
Wed Jun 27 08:05:32 PDT 2012

On Wed, Jun 27, 2012 at 9:52 PM, Rémi Forax <forax at> wrote:

> On 06/27/2012 03:37 PM, Krystal Mok wrote:
>> Hi all,
>> Just FYI, I've posted an updated version of the patch here:
>> checked_add_prototype.ver3.**patch<>
>> It pretty much implements what John suggested in a previous email (quoted
>> below).
>> This version still suffers from a couple of problem mentioned before:
>> 1. It's emitting a jmpConU instead of a jmpCon during instruction
>> selection. Is there a way to force it use jmpCon here?
> I'm may be wrong but the idea is to put 0 (or a very small value) to the
> frequency of the basic block
> that follow the jump on overflow.
> No, that's a different problem. The problem here is that the Matcher
decided to use an unsigned version of conditional jump, instead of a normal
(signed) version.
It doesn't really affect the actual emitted code because I've made both
cases do the same thing. But it just doesn't feel right to be using the
unsigned version here.

- Kris

>  2. I had to use a fixed register for the sum projection of CheckedAddI,
>> otherwise I couldn't find a way to specify this projection should use the
>> same register as "dst".
>> - Kris
> Rémi
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the hotspot-compiler-dev mailing list