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

Incorrect optimization level and comment specified for unsafe.cpp

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b49
    • Verification:
      Not verified

      Backports

        Description


        In file make/bsd/makefiles/gcc.make - the optimization level specified for unsafe.cpp is -01 instead of -O1.

        In file make/bsd/makefiles/gcc.make the following comment is incorrect:

            # There are some files which don't like precompiled headers
            # The following files are build with 'OPT_CFLAGS/NOOPT' (-O0) in the opt build.
            # But Clang doesn't support a precompiled header which was compiled with -O3
            # to be used in a compilation unit which uses '-O0'. We could also prepare an
            # extra '-O0' PCH file for the opt build and use it here, but it's probably
            # not worth the effort as long as only two files need this special handling.

        Needs to be updated to reflect:

        - Not all files in the list are compiled with 'OPT_CFLAGS/NOOPT'.

        - The precompiled header may be compiled with -O3 or -Os depending on the setting of 'OPT_CFLAGS_DEFAULT'.

        - This is not just an issue between the compilation of -O0 and -O3. The issue is more general. When USE_CLANG is true, if the PCH file is compiled at a higher optimization level, (-Os or -O3), than the C++ file, (-O0 thru -O2), the following compile time error message is generated.
        error: __OPTIMIZE_SIZE__ predefined macro was enabled in PCH file but is currently disabled

        - The last sentence should be updated, because since the files in the list are not all compiled with -O0, the solution would only solve the issue for some of the files but not all.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                lfoltan Lois Foltan
                Reporter:
                lfoltan Lois Foltan
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: