Integrated: JDK-8300823: UB: Compile::_phase_optimize_finished is initialized too late
Damon Fenacci
duke at openjdk.org
Fri Jan 27 12:17:24 UTC 2023
On Wed, 25 Jan 2023 12:17:52 GMT, Damon Fenacci <duke at openjdk.org> wrote:
> Clang _Undefined Behaviour Sanitizer_ has pointed out a spurious load of the `bool` field `Compile::_phase_optimize_finished` with non-boolean values.
>
> This is due to `Compile::_phase_optimize_finished` being initialized too late in the `Compile::Init` method (e.g. https://github.com/openjdk/jdk/blob/544c16e0bdd4335b2624158fd1f6521984aa5079/src/hotspot/share/opto/compile.cpp#L983 indirectly invokes `Compile::phase_optimize_finished()` to read the field).
>
> So, moving the `_phase_optimize_finished` initialization (and the initialization of the other 2 fields in the same `ASSERT` block) up in the `Compile::Init` method.
This pull request has now been integrated.
Changeset: e4252bb9
Author: Damon Fenacci <damon.fenacci at oracle.com>
Committer: Tobias Hartmann <thartmann at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/e4252bb91478e9c2f0a5bbdae7cd663838d91b1b
Stats: 13 lines in 1 file changed: 6 ins; 6 del; 1 mod
8300823: UB: Compile::_phase_optimize_finished is initialized too late
Reviewed-by: thartmann, chagedorn
-------------
PR: https://git.openjdk.org/jdk/pull/12192
More information about the hotspot-compiler-dev
mailing list