Integrated: 8361140: Missing OptimizePtrCompare check in ConnectionGraph::reduce_phi_on_cmp
Guanqiang Han
duke at openjdk.org
Mon Jul 14 07:41:46 UTC 2025
On Fri, 4 Jul 2025 02:49:27 GMT, Guanqiang Han <duke at openjdk.org> wrote:
> When running with `-XX:-OptimizePtrCompare` (which disables pointer comparison optimization), the compiler may hit an assertion failure in debug builds because `optimize_ptr_compare` is still being called. This violates the intended usage of the flag and leads to unexpected crashes.
>
> This patch adds an early return to `reduce_phi_on_cmp` when `OptimizePtrCompare` is false. Since the optimization relies on `optimize_ptr_compare` for static reasoning about comparisons, there's no benefit in proceeding with `reduce_phi_on_cmp` when this flag is disabled.
This pull request has now been integrated.
Changeset: 14c79be1
Author: han gq <hanguanqiang at kylinos.cn>
Committer: Christian Hagedorn <chagedorn at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/14c79be1613c9d737a9536087ac48914ee4ba8d9
Stats: 110 lines in 3 files changed: 107 ins; 1 del; 2 mod
8361140: Missing OptimizePtrCompare check in ConnectionGraph::reduce_phi_on_cmp
Reviewed-by: chagedorn, cslucas
-------------
PR: https://git.openjdk.org/jdk/pull/26125
More information about the hotspot-compiler-dev
mailing list