RFR(S): 8166742 : SIGFPE in C2 Loop IV elimination

Chuck Rasbold rasbold at google.com
Tue Sep 27 14:56:27 UTC 2016


On Mon, Sep 26, 2016 at 5:35 PM, Vladimir Kozlov <vladimir.kozlov at oracle.com
> wrote:

> Slightly different (cast after /) and jlong type:
>
>   jlong ratio_conl = (jlong) (stride_con2 / stride_con);
>

The division above won't work (at least, it raises a SIGFPE on my Linux x86
platform) when stride_con2 == min_jint   and stride_con == -1.


>   if ((ratio_conl * stride_con) == (jlong)stride_con2) { // Check for exact
>
>
What would be the value of ratio_conl such that this test fails?  I think
I'm missing something...

-- Chuck


> Vladimir
>
> On 9/26/16 5:01 PM, Chuck Rasbold wrote:
>
>> Just to confirm, are you suggesting that the ratio be first computed as a
>> 64 bit quantity, effectively along the lines of...
>>
>>    long ratio_conl = ((long) stride_con2) / stride_con;
>>
>>    if ((ratio_conl * stride_con) == stride_con2 &&
>>        ratio_conl < 0x8000000 ) { // Check for exact
>>      int ratio_con = (int) ratio_conl;
>>
>>
>> On Mon, Sep 26, 2016 at 3:45 PM, Vladimir Kozlov <
>> vladimir.kozlov at oracle.com <mailto:vladimir.kozlov at oracle.com>> wrote:
>>
>>     Hi Chuck
>>
>>     Can you do 'long' arithmetic in existing condition to catch integer
>> overflow instead?
>>
>>     if ((ratio_con * stride_con) == stride_con2) { // Check for exact
>>
>>     thanks,
>>     Vladimir
>>
>>
>>
>>     On 9/26/16 3:18 PM, Chuck Rasbold wrote:
>>
>>         A small fix for an edge case crash in C2...
>>
>>         Bug: https://bugs.openjdk.java.net/browse/JDK-8166742 <
>> https://bugs.openjdk.java.net/browse/JDK-8166742>
>>         Webrev: http://cr.openjdk.java.net/~rasbold/8166742/webrev.00/ <
>> http://cr.openjdk.java.net/~rasbold/8166742/webrev.00/>
>>
>>         Requesting a sponsor and reviews.  Thanks.
>>
>>         -- Chuck
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20160927/696ceeff/attachment.html>


More information about the hotspot-compiler-dev mailing list