[jdk16] RFR: 8259227: C2 crashes with SIGFPE due to a division that floats above its zero check

Christian Hagedorn chagedorn at openjdk.java.net
Wed Jan 6 14:30:09 UTC 2021


This bug is very similar to [JDK-8257822](https://bugs.openjdk.java.net/browse/JDK-8257822). In this testcase, a `Div` node has no longer its zero check as direct control input and is later moved before the zero check by `IfNode::dominated_by()` which updates all data nodes to a dominating `If` (in JDK-8257822 it was done by `PhaseIdealLoop::dominated_by()`) .

I suggest to use the same fix for `IfNode::dominated_by()` as for `PhaseIdealLoop::dominated_by()` in JDK-8257822 to only move data nodes to the dominating `If` if it is not a `Div` or `Mod` node that could have a zero divisor (i.e. a zero check).

Thanks,
Christian

-------------

Commit messages:
 - 8259227: C2 crashes with SIGFPE due to a division that floats above its zero check

Changes: https://git.openjdk.java.net/jdk16/pull/89/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk16&pr=89&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8259227
  Stats: 124 lines in 6 files changed: 99 ins; 22 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk16/pull/89.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk16 pull/89/head:pull/89

PR: https://git.openjdk.java.net/jdk16/pull/89


More information about the hotspot-compiler-dev mailing list