-
Enhancement
-
Resolution: Fixed
-
P4
-
11, 17, 21, 22
-
b20
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8320782 | 21.0.2 | Aleksey Shipilev | P4 | Resolved | Fixed | b09 |
src/hotspot/share/adlc/main.cpp parses in the -D inputs and sets AD.set_preproc_def(flag, def)
And then when the AD file is parsed, it checks ArchDesc::get_preproc_def to see if it should include the relevant code section or not.
You can for example find #ifdef _LP64 all over the AD files.
The flags are set in make/hotspot/gensrc/GensrcAdlc.gmk
ADLC_CFLAGS += -DASSERT
...
ifeq ($(call isTargetOs, linux), true)
ADLCFLAGS += -DLINUX=1 -D_GNU_SOURCE=1
We never pass ASSERT or PRODUCT to ADLCFLAGS, hence we cannot use #ifdef with those flags (or rather they are always undefined).
We should fix this, so that the flags can be used consistently with all other C2 code. For example, I would like to be able to make some rules in AD files available only in debug (ASSERT) mode.
And then when the AD file is parsed, it checks ArchDesc::get_preproc_def to see if it should include the relevant code section or not.
You can for example find #ifdef _LP64 all over the AD files.
The flags are set in make/hotspot/gensrc/GensrcAdlc.gmk
ADLC_CFLAGS += -DASSERT
...
ifeq ($(call isTargetOs, linux), true)
ADLCFLAGS += -DLINUX=1 -D_GNU_SOURCE=1
We never pass ASSERT or PRODUCT to ADLCFLAGS, hence we cannot use #ifdef with those flags (or rather they are always undefined).
We should fix this, so that the flags can be used consistently with all other C2 code. For example, I would like to be able to make some rules in AD files available only in debug (ASSERT) mode.
- backported by
-
JDK-8320782 ADLC: pass ASSERT and PRODUCT flags
- Resolved
- relates to
-
JDK-8299254 Support dealing with standard assert macro
- Resolved
- links to
-
Commit openjdk/jdk21u/cae64609
-
Commit openjdk/jdk/504b0bda
-
Review openjdk/jdk17u-dev/2034
-
Review openjdk/jdk21u/396
-
Review openjdk/jdk/16178
(2 links to)