RFR: 8319822: Use a linear-time algorithm for assert_different_registers() [v12]

Andrew Haley aph at openjdk.org
Mon Jun 3 15:18:03 UTC 2024


On Mon, 3 Jun 2024 13:58:12 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> OK, I get it. I was sort-of thinking that on the 32-bit platforms we support we don't ever have more than 32 registers in a set, but maybe that's not true. I certainly don't want to slow down 32-bit platforms by burdening them with double-word operations for something that can never happen.
>
> Okay. Well, if we have a static assert, we will notice if we have more registers than fit the bitset.

So I'm getting this bizarre failure on arm32. I'm guessing it's actually a compiler bug, but I suppose it might be some dusty corner of C++ to do with template arg substitution. Any thoughts?


In file included from /home/runner/work/jdk/jdk/src/hotspot/share/utilities/globalDefinitions.hpp:29,
                 from /home/runner/work/jdk/jdk/src/hotspot/share/nmt/memflags.hpp:28,
                 from /home/runner/work/jdk/jdk/src/hotspot/share/memory/allocation.hpp:29,
                 from ad_arm.hpp:30,
                 from ad_arm.cpp:28:
/home/runner/work/jdk/jdk/src/hotspot/share/asm/register.hpp: In instantiation of ‘class AbstractRegSet<RegisterImpl*>’:
/home/runner/work/jdk/jdk/src/hotspot/share/asm/register.hpp:272:30:   required from ‘constexpr bool different_registers(R, Rx ...) [with R = RegisterImpl*; Rx = {RegisterImpl*, RegisterImpl*}]’
/home/runner/work/jdk/jdk/src/hotspot/share/asm/register.hpp:278:27:   required from ‘void assert_different_registers(R, Rx ...) [with R = RegisterImpl*; Rx = {RegisterImpl*, RegisterImpl*}]’
/home/runner/work/jdk/jdk/src/hotspot/cpu/arm/arm.ad:8984:52:   required from here
/home/runner/work/jdk/jdk/src/hotspot/share/asm/register.hpp:96:26: error: ‘number_of_registers’ is not a member of ‘RegisterImpl*’
   96 |   STATIC_ASSERT(RegImpl::number_of_registers <= 64);
      |                          ^~~~~~~~~~~~~~~~~~~
/home/runner/work/jdk/jdk/src/hotspot/share/utilities/debug.hpp:287:44: note: in definition of macro ‘STATIC_ASSERT’
  287 | #define STATIC_ASSERT(Cond) static_assert((Cond), #Cond)
      |                                            ^~~~

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16617#discussion_r1624634893


More information about the hotspot-compiler-dev mailing list