[11] RFR: Fix Windows build failure due to nesting macro

Aleksey Shipilev shade at redhat.com
Wed Jul 15 08:51:55 UTC 2020


It seems MSVC dislikes the nested #if within the assert macro. Current Windows builds fail in
sh/jdk11 with:

c:/buildbot/worker/build-shenandoah-jdk11-windows/build/src/hotspot/share/opto/escape.cpp(2436) :
error C2121: '#' : invalid character : possibly the result of a macro expansion
c:/buildbot/worker/build-shenandoah-jdk11-windows/build/src/hotspot/share/opto/escape.cpp(2436) :
error C2143: syntax error : missing ')' before 'if'
c:/buildbot/worker/build-shenandoah-jdk11-windows/build/src/hotspot/share/opto/escape.cpp(2436) :
error C2059: syntax error : ')'
c:/buildbot/worker/build-shenandoah-jdk11-windows/build/src/hotspot/share/opto/escape.cpp(2436) :
error C2143: syntax error : missing ';' before '{'

Fix:

--- a/src/hotspot/share/opto/escape.cpp Wed Jul 08 17:15:01 2020 +0200
+++ b/src/hotspot/share/opto/escape.cpp Wed Jul 15 10:48:43 2020 +0200
@@ -2428,13 +2428,11 @@
       int opcode = uncast_base->Opcode();
       assert(opcode == Op_ConP || opcode == Op_ThreadLocal ||
              opcode == Op_CastX2P || uncast_base->is_DecodeNarrowPtr() ||
              (uncast_base->is_Mem() && (uncast_base->bottom_type()->isa_rawptr() != NULL)) ||
              (uncast_base->is_Proj() && uncast_base->in(0)->is_Allocate())
-#if INCLUDE_SHENANDOAHGC
-             || uncast_base->Opcode() == Op_ShenandoahLoadReferenceBarrier
-#endif
+             SHENANDOAHGC_ONLY(|| (uncast_base->Opcode() == Op_ShenandoahLoadReferenceBarrier))
              , "sanity");
     }
   }
   return base;
 }


I am going to push this after Andrew lands his CPU merges.

Testing: {Windows, Linux} builds

-- 
Thanks,
-Aleksey




More information about the shenandoah-dev mailing list