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

c1 is broken if it is compiled by gcc without -fno-lifetime-dse


    • Subcomponent:
    • Resolved In Build:
    • CPU:


       Both release build and fastdebug generate broken c1 if the building toolchain are gcc6+. The reason that slowdebug is fine because it doesn't use gcc optimizations.

      Here is the configure which can produce the broken c1.
      --enable-option-checking=fatal --with-debug-level=fastdebug --with-native-debug-symbols=internal --with-extra-cxxflags="-g -pipe -Wformat -Wno-cpp -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -std=gnu++98 -fno-delete-null-pointer-checks" --with-extra-cflags="-g -pipe -Wformat -Wno-cpp -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -std=gnu++98 -Wno-error -fno-delete-null-pointer-checks" --with-extra-asflags="-g -pipe -Wformat -Wno-cpp -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -std=gnu++98 -Wno-error -fno-delete-null-pointer-checks" --with-extra-ldflags=-Wl,-z,relro --with-num-cores=16 --disable-javac-server --with-jvm-features=zgc --disable-warnings-as-errors

      The trigger is '-std=gnu++98' in --with-extra-cflags. it's not a valid option for cc1, so it will disturb configure from detecting the availability of -fno-lifetime-dse. As a result, JVM_CFLAGS of spec.mk misses -fno-lifetime-dse.

      The generated c1 is broken so the whole 'make images' can't complete. sanity test like '-version' would fail.

      ./jdk/bin/java -version
      # To suppress the following error report, specify this argument
      # after -XX: or in .hotspotrc: SuppressErrorAt=/bitMap.cpp:186
      # A fatal error has been detected by the Java Runtime Environment:
      # Internal Error (/home/ubuntu/build/jdk/src/hotspot/share/utilities/bitMap.cpp:186), pid=34159, tid=34172
      # assert(bit < _size) failed: BitMap index out of bounds: 18446744072294738859 >= 26
      # JRE version: OpenJDK Runtime Environment (15.0) (fastdebug build 15-internal+0-adhoc.ubuntu.jdk)
      # Java VM: OpenJDK 64-Bit Server VM (fastdebug 15-internal+0-adhoc.ubuntu.jdk, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x55e764] BitMap::verify_index(unsigned long) const+0x34
      # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /backup/undefinedC1/core.34159)
      # An error report file with more information is saved as:
      # /backup/undefinedC1/hs_err_pid34159.log
      [thread 34175 also had an error]
      # Compiler replay data is saved as:
      # /backup/undefinedC1/replay_pid34159.log
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      Aborted (core dumped)


          Issue Links



              • Assignee:
                xliu Xin Liu
                xliu Xin Liu
              • Votes:
                0 Vote for this issue
                3 Start watching this issue


                • Created: