RFR: 8276453: Undefined behavior in C1 LIR_OprDesc causes SEGV in fastdebug build [v5]
Man Cao
manc at openjdk.java.net
Tue Nov 9 00:05:34 UTC 2021
On Wed, 3 Nov 2021 20:01:37 GMT, Man Cao <manc at openjdk.org> wrote:
>> Hi all,
>>
>> Could anyone provide some feedback on this bug fix and refactoring change? See https://bugs.openjdk.java.net/browse/JDK-8276453 for more details.
>> If the direction of this change looks good, we can proceed removing the "UGLY HACK" in c1_LIR.hpp and refactor occurrences of "opr->fn()" to "opr.fn()".
>
> Man Cao has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix aarch64 and arm builds
Thanks for the feedback. For JDK-8276563, the operation on "this" seems limited to <, >, +, - operators, which are well defined. However, for this PR, the biggest problem is the "&" operator on "this", in:
bool check_value_mask(intptr_t mask, intptr_t masked_value) const {
return (value() & mask) == masked_value;
}
Compiler can make various optimizations if it believes "this" pointer is aligned.
PS for other reviewers: Looking at the change in "src/hotspot/share/c1/c1_LIR.hpp" is the quickest way to get a high-level idea of this change.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6221
More information about the hotspot-compiler-dev
mailing list