RFR: 8276563: Undefined Behaviour in class Assembler [v9]

Andrew Haley aph at openjdk.java.net
Thu Nov 18 10:50:45 UTC 2021


On Thu, 18 Nov 2021 06:41:36 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Andrew Haley has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Tweako stuff.
>
> src/hotspot/cpu/aarch64/register_aarch64.hpp line 156:
> 
>> 154:   FloatRegister successor() const {
>> 155:     return as_FloatRegister((encoding() + 1) % (unsigned)number_of_registers);
>> 156:   }
> 
> Different from the other two, why? If we need validity checks here, should we not do them with the other types too?

The modulo-32 behaviour in `successor()` is because of an ugly hack elsewhere. The aim of this patch is to remove the UB in class Assembler, not to fix anything else. That's just to make this patch as simple as it can be.

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

PR: https://git.openjdk.java.net/jdk/pull/6280


More information about the hotspot-compiler-dev mailing list