[jdk8u-dev] RFR: 8329826: GCC 12 reports some compiler error when building jdk8

mirabilos duke at openjdk.org
Tue May 7 16:59:59 UTC 2024


On Tue, 9 Apr 2024 09:30:05 GMT, Kun Wang <kwang at openjdk.org> wrote:

> Env:
> ldd (GNU libc) 2.38
> gcc (GCC) 12.3.1 
> 
> Test the PR patch;
> Build release/fastdebug/slowdebug version pass
> 
> Reported issue : https://bugs.openjdk.org/browse/JDK-8329826

hotspot/make/linux/makefiles/adlc.make line 69:

> 67: # CFLAGS_WARN holds compiler options to suppress/enable warnings.
> 68: # Compiler warnings are treated as errors
> 69: CFLAGS_WARN = $(WARNINGS_ARE_ERRORS) -Wno-register

that’s probably okay to ignore

hotspot/make/linux/makefiles/gcc.make line 215:

> 213: endif
> 214: 
> 215: WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Wno-stringop-overflow

disabling the warning instead of fixing the code is not the proper way to deal with this

hotspot/src/share/vm/opto/type.cpp line 2560:

> 2558:             ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass();
> 2559:             field = k->get_field_by_offset(_offset, true);
> 2560:           }

This is useless papering over, not a fix, and not even good because it makes the code less legible at no gain.

Better to convert the two `assert`s to actual checks which abort the control flow of the function if triggered.

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

PR Review Comment: https://git.openjdk.org/jdk8u-dev/pull/479#discussion_r1567472991
PR Review Comment: https://git.openjdk.org/jdk8u-dev/pull/479#discussion_r1567472360
PR Review Comment: https://git.openjdk.org/jdk8u-dev/pull/479#discussion_r1567475835


More information about the jdk8u-dev mailing list