-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flow_graph_compiler.cc: 914: error: expected: !is_optimizing() #36587
Comments
Using dart/sdk/pkg/vm/tool/dart_precompiled_runtime2, DebugX64, we get
|
Attaching fuzz.dart as txt. |
The following shift causes the assert. It has no env().
|
As before, having an env() or not seems something that really needs a serious rework in our IR, since it seems to work more by chance than by design. In this particular case, though, the shift is introduced by BinaryIntegerOpInstr::Canonicalize(), which generates the explicit shift factor 1, but fails to set the shift_range (or an env). Since no range analysis follows, this seems a clear omission. |
The following CL fixes the assert fail, since we see that the shift factor is never out of range (so we don't need a slow path). I would like some careful review on the omission of env(), by design, or by accident? |
Rationale: Queries the constant of a shift operation to determine if it is in range when range analysis has not run. This seems in general a good idea, since some optimizations occur *after* range analysis, and we were missing those cases. In this particular case, it also avoids an assert fail on a shift by one without env() that was introduced by a pass that has no subsequent range analysis. In this case, it is unclear whether not having an env() was an accident, or on purpose since the shift factor is known to be well-behaved. Please have a careful look! #36587 Change-Id: I12b4cb773f31899e17bfce8506bce599ccbef8ba Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99382 Commit-Queue: Aart Bik <ajcbik@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>
Nightly DartFuzz divergence:
Isolate (/b/s/w/itpuZWHB/dart_fuzzBUJXGL) AOT-O3-DebugX64 - JIT-noVFP-O3-DebugSIMARM: !DIVERGENCE! 1.9:988261705 (output=false)
fail1:
../../runtime/vm/compiler/backend/flow_graph_compiler.cc: 914: error: expected: !is_optimizing()
version=2.2.1-edge.bed1bab2cd4b79694db9ace0e5497b8bb9eb1ab8 (Thu Apr 11 02:01:03 2019 +0000) on "linux_x64"
thread=21979, isolate=isolate(0x565334276900)
pc 0x00005653323efcec fp 0x00007fffdb317990 dart::Profiler::DumpStackTrace(void*)
pc 0x00005653326fb6f2 fp 0x00007fffdb317a70 dart::Assert::Fail(char const*, ...)
pc 0x00005653325399e3 fp 0x00007fffdb317bf0 /b/s/w/ir/pkg/vm/tool/../../../out/DebugX64/gen_snapshot+0x7939e3
pc 0x000056533253f471 fp 0x00007fffdb317c50 dart::ThrowErrorSlowPathCode::EmitNativeCode(dart::FlowGraphCompiler*)
pc 0x0000565332538aac fp 0x00007fffdb317c90 dart::FlowGraphCompiler::GenerateDeferredCode()
pc 0x00005653324db152 fp 0x00007fffdb318300 dart::PrecompileParsedFunctionHelper::Compile(dart::CompilationPipeline*)
pc 0x00005653324dd798 fp 0x00007fffdb318d70 /b/s/w/ir/pkg/vm/tool/../../../out/DebugX64/gen_snapshot+0x737798
pc 0x00005653324d7694 fp 0x00007fffdb318e20 dart::Precompiler::CompileFunction(dart::Precompiler*, dart::Thread*, dart::Zone*, dart::Function const&)
pc 0x00005653324d5eeb fp 0x00007fffdb318e90 dart::Precompiler::ProcessFunction(dart::Function const&)
pc 0x00005653324d11f3 fp 0x00007fffdb318ec0 dart::Precompiler::Iterate()
pc 0x00005653324ce2fd fp 0x00007fffdb3198d0 dart::Precompiler::DoCompileAll()
pc 0x00005653324cdde5 fp 0x00007fffdb319cf0 dart::Precompiler::CompileAll()
pc 0x00005653326eed52 fp 0x00007fffdb319db0 Dart_Precompile
pc 0x000056533210ec9a fp 0x00007fffdb319f20 dart::bin::main(int, char**)
-- End of DumpStackTrace
The text was updated successfully, but these errors were encountered: