Hello all,
I'm building 11.0.226.19 with VS 17.5.1
ie MSVC
ie cl.exe 19.35.32215
tldr is:
```
--- immediate-crash.h.orig 2023-03-17 10:59:27.251900900 +0800
+++ immediate-crash.h 2023-03-17 10:59:37.427856200 +0800
@@ -144,19 +144,22 @@
#if defined(__clang__) || V8_CC_GCC
// __builtin_unreachable() hints to the compiler that this is noreturn and can
// be packed in the function epilogue.
#define IMMEDIATE_CRASH() \
({ \
WRAPPED_TRAP_SEQUENCE_(); \
__builtin_unreachable(); \
})
#else
// This is supporting build with MSVC where there is no __builtin_unreachable().
-#define IMMEDIATE_CRASH() WRAPPED_TRAP_SEQUENCE_()
+#define IMMEDIATE_CRASH() \
+ ({ \
+ WRAPPED_TRAP_SEQUENCE_(); \
+ })
#endif // defined(__clang__) || defined(COMPILER_GCC)
#endif // V8_BASE_IMMEDIATE_CRASH_H_
```
I'm not sure why MSVC didn't get the ({ brackets })
nor do I know why noone else has seen this yet.
The problem started with this change:
In particular, the new macro LABEL_BLOCK in line 59 here:
When building with is_official_build=true, the following happens:
src/compiler/turboshaft/machine-optimization-reducer.h : 1669
OpIndex ReducePhi(base::Vector<const OpIndex> inputs,
RegisterRepresentation rep) {
LABEL_BLOCK(no_change) { return Next::ReducePhi(inputs, rep); }
LABEL_BLOCK line becomes:
for (; false; UNREACHABLE()) no_change: { return Next::ReducePhi(inputs, rep);
}
focus on the for loop, that becomes:
for (; false; FATAL(message))
becomes:
for (; false; IMMEDIATE_CRASH())
becomes:
for (; false; WRAPPED_TRAP_SEQUENCE_())
becomes:
for (; false; TRAP_SEQUENCE_())
becomes:
for (; false; do { TRAP_SEQUENCE1_(); TRAP_SEQUENCE2_(); } while (false))
becomes:
for (; false; do { __debugbreak(); ; } while (false))
Which fails on all compilers (including gcc) thanks to the do following the ;
This would have compiled if it had some extra brackets in there:
for (; false; ({ do { __debugbreak(); ; } while (false) }) )
What can we do about putting in this tiny patch?
And, is noone at google using MSVC ?
cheers,
Paul