RFR: JDK-8294902: Undefined Behavior in C2 regalloc with null references [v6]

Andrew Haley aph at openjdk.org
Fri Dec 2 11:05:12 UTC 2022


On Fri, 2 Dec 2022 10:44:42 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Andrew Haley has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Feedback from reviewers
>
> src/hotspot/share/opto/postaloc.cpp line 259:
> 
>> 257:   if (!can_change_regs) {
>> 258:     return blk_adjust;          // Only check stupid copies!
>> 259:   }
> 
> Style nit here and in other places: weren't these blocks separated by newline before?

I'm not sure what you mean. Can you make these Suggestions? Thanks.

> src/hotspot/share/utilities/globalDefinitions_gcc.hpp line 155:
> 
>> 153:   char* c = (char*)(void*)&dummyObj->field;     \
>> 154:   return (size_t)(c - space);                   \
>> 155: }()
> 
> I am very surprised this does not produce any warnings! Let me test this on different GCCs...

Of course we can't exclude the possibility of warnings, given that taking the offset of a field of a non-POD class is unspecified behaviour. Having said that, I'm not sure exactly what it'd be warning about.

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

PR: https://git.openjdk.org/jdk/pull/10920


More information about the hotspot-dev mailing list