Integrated: 8270533: AArch64: size_fits_all_mem_uses should return false if its output is a CAS

Andrew Haley aph at openjdk.java.net
Wed Sep 8 10:12:09 UTC 2021


On Thu, 15 Jul 2021 09:31:49 GMT, Andrew Haley <aph at openjdk.org> wrote:

> `size_fits_all_mem_uses(AddPNode)` is used to determine if an add with shift expression can be used as an input to a MemNode. However, it is not correct when one of its outputs is a CAS. This causes a crash when a single AddPNode feeds a CAS and an ordinary MemNode.
> 
> This bug is probably latent in the current HotSpot because `pd_clone_address_expressions()` clones AddPNodes that are used as inputs to MemNodes, so `size_fits_all_mem_uses()` never sees a CAS as one of its outputs. The matcher for a CompareAndSwapX node doesn't call `size_fits_all_mem_uses()`, so this can only happen when the same expression feeds both an ordinary MemNode and a CompareAndSwapX.
> 
> This bug has been back-ported to JDK 8u, so it must be fixed there. Even though the bug is latent in current HotSpot, it should be fixed.

This pull request has now been integrated.

Changeset: 6750c34c
Author:    Andrew Haley <aph at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/6750c34c92b5f28bba4a88ac798b800fce380d32
Stats:     7 lines in 1 file changed: 7 ins; 0 del; 0 mod

8270533: AArch64: size_fits_all_mem_uses should return false if its output is a CAS

Reviewed-by: adinn, ngasson

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

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


More information about the hotspot-compiler-dev mailing list