Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8140091

remove VMStructs cast_uint64_t workaround for GCC 4.1.1 bug

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 9
    • hotspot
    • b92

        The workaround was added to fix:

        https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27724

        New code added by JDK-8139170 breaks builds on 32-bit platforms:

        /opt/jprt/T/P1/235039.cthaling/s/hotspot/src/share/vm/runtime/vmStructs.cpp:3102:30: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
           { name, cast_uint64_t(value) },
                                      ^
        /opt/jprt/T/P1/235039.cthaling/s/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp:86:3: note: in expansion of macro 'GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY'
           declare_preprocessor_constant("VM_Version::CPU_AVX512VL", CPU_AVX512VL)
           ^
        /opt/jprt/T/P1/235039.cthaling/s/hotspot/src/share/vm/runtime/vmStructs.cpp:3340:3: note: in expansion of macro 'VM_LONG_CONSTANTS_CPU'
           VM_LONG_CONSTANTS_CPU(GENERATE_VM_LONG_CONSTANT_ENTRY,
           ^

        The reason is that cast_uint64_t takes a size_t as argument:

        static inline uint64_t cast_uint64_t(size_t x)
        {
          return x;
        }

        but the passed value is an unsigned 64-bit constant value:

        #define CPU_AVX512VL UCONST64(0x100000000)

        GCC bug 27724 is a serious bug and we should not build the JDK with that version. I am proposing to remove the workaround and add a check in the Makefiles to not allow GCC 4.1.1 to build HotSpot.

              twisti Christian Thalinger (Inactive)
              twisti Christian Thalinger (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: