RFR: 8353341: C2: removal of a Mod[DF]Node crashes when the node is already dead [v2]

Marc Chevalier mchevalier at openjdk.org
Wed Apr 2 08:08:08 UTC 2025


On Wed, 2 Apr 2025 07:53:15 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:

>> src/hotspot/share/opto/divnode.cpp line 1522:
>> 
>>> 1520:   bool result_is_unused = proj_out_or_null(TypeFunc::Parms) == nullptr;
>>> 1521:   bool is_dead = proj_out_or_null(TypeFunc::Control) == nullptr;
>>> 1522:   if (result_is_unused && !is_dead) {
>> 
>> Might be easier to read when it's flipped to avoid negation with `!` but I leave it up to you to decide which one you prefer :-)
>> 
>>   bool not_dead = proj_out_or_null(TypeFunc::Control) != nullptr;
>>   if (result_is_unused && not_dead) {
>
> I'd agree if I wrote `!not_dead`. But between writing `! a_positive_property` and `a_negative_property`, I'm much less decided.

I ended up flipping as suggested because I've seen fonts/colors making the `!` not clearly a non-letter (github, for instance isn't very good at that imo), and sometimes, people might be surprised.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24375#discussion_r2024293297


More information about the hotspot-compiler-dev mailing list