Skip to content
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

Assertion failure with decomposed record pair #51548

Closed
rmacnak-google opened this issue Feb 27, 2023 · 1 comment
Closed

Assertion failure with decomposed record pair #51548

rmacnak-google opened this issue Feb 27, 2023 · 1 comment
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening P2 A bug or feature request we're likely to work on
Milestone

Comments

@rmacnak-google
Copy link
Contributor

The tests

language/records/simple/constants_and_field_access_test/1 Crash (expected Pass)

are failing on configurations

vm-aot-win-debug-x64c
stderr:
../../runtime/vm/compiler/backend/il_x64.cc: 411: error: expected: result_lo == CallingConventions::kReturnReg
version=3.0.0-edge.262efd84fd2b14cf64dfa6c937856d717fbe6e1e (be) (Fri Feb 24 04:09:12 2023 +0000) on "windows_x64"
pid=7376, thread=3548, isolate_group=isolate(00000276633EFFA0), isolate=(nil)(0000000000000000)
os=windows, arch=x64, comp=yes, sim=no
isolate_instructions=0, vm_instructions=0
fp=7b1cefcf10, sp=7b1cefcf10, pc=7ff67865e6d2
  pc 0x00007ff67865e6d2 fp 0x0000007b1cefcf10 Dart_RunLoop+0x444700
-- End of DumpStackTrace
=== Crash occurred when compiling file:///C:/b/s/w/ir/tests/language/records/simple/constants_and_field_access_test.dart_::_getP1N1 in AOT mode in GenerateCode pass
=== When compiling block B1[function entry]:2
ParallelMove ? <- ?
=== When compiling instruction Return:16(v9 T{_Record})
*** BEGIN CFG
GenerateCode
==== file:///C:/b/s/w/ir/tests/language/records/simple/constants_and_field_access_test.dart_::_getP1N1 (RegularFunction)
B0[graph]:0 {
      v5 <- UnboxedConstant(#40 int64) [40, 40] T{_Smi}
}
B1[function entry]:2
ParallelMove ? <- ?
    CheckStackOverflow:8(stack=0, loop=0)
    MoveArgument(v5, SP+0)
    v6 <- StaticCall:30( getP1N1Rec<0> v5, result_type = T{_Record}) T{_Record}
    v7 <- ExtractNthOutput(Extract 0 from v6) T{*?}
    v8 <- ExtractNthOutput(Extract 1 from v6) T{*?}
    v9 <- MakePair(v7, v8) T{*?}
    Return:16(v9 T{_Record})
*** END CFG

--- Re-run this test:

@alexmarkov

@rmacnak-google rmacnak-google added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening labels Feb 27, 2023
@alexmarkov alexmarkov self-assigned this Feb 27, 2023
@alexmarkov
Copy link
Contributor

Reproduced the crash (on Windows but not Linux) and investigating it.
It looks like locations change during code generation:

After AllocateRegisters:

 10:     v31 <- ExtractNthOutput(Extract 0 from v26) T{*?} ((rax, rdx)) => rcx
 12:     v32 <- ExtractNthOutput(Extract 1 from v26) T{*?} ((rax, rdx)) => rbx
 13:     ParallelMove rax <- rcx, rdx <- rbx
 14:     v36 <- MakePair(v31, v32) T{*?} (rax, rdx) => (rax, rdx)
 16:     Return:16(v36 T{_Record}) ((rax, rdx))

This looks correct.

When generating code for Return instruction:

    v7 <- ExtractNthOutput(Extract 0 from v6) T{*?} ((rdx, rax)) => rcx
    v8 <- ExtractNthOutput(Extract 1 from v6) T{*?} ((rdx, rax)) => rbx
    v9 <- MakePair(v7, v8) T{*?} (rax, rdx) => (rdx, rax)
    Return:16(v9 T{_Record}) ((rdx, rax))

rax and rdx are swapped in the PairLocation in MakePair output and Return input.

@a-siva a-siva added this to the Dart 3 beta 3 milestone Feb 27, 2023
@a-siva a-siva added the P2 A bug or feature request we're likely to work on label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

3 participants