nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.59k stars 1.47k forks source link

Nim v2 emit / asm var param dereference inconsistency #23114

Open mratsim opened 10 months ago

mratsim commented 10 months ago

Before Nim v2, interpolating a var parameter:

This was the case for both asm and emit statements.

Following Nim v2:

Test case:

import strutils

const
  nim_v2 = (NimMajor, NimMinor) > (1, 6)
  noExplicitVarDeref = defined(cpp) or nim_v2

func ccopy_x86_asm(ctl: uint64, x: var uint64, y: uint64) =
  when noExplicitVarDeref:
    asm """
      testq %[ctl], %[ctl]
      cmovnzq %[y], %[x]
      : [x] "+r" (`x`)
      : [ctl] "r" (`ctl`), [y] "r" (`y`)
      : "cc"
    """
  else:
    asm """
      testq %[ctl], %[ctl]
      cmovnzq %[y], %[x]
      : [x] "+r" (*`x`)
      : [ctl] "r" (`ctl`), [y] "r" (`y`)
      : "cc"
    """

func ccopy_x86_emit(ctl: uint64, x: var uint64, y: uint64) =
  when noExplicitVarDeref:
    {.emit:[
      """
      asm volatile(
        "testq %[ctl], %[ctl]\n"
        "cmovnzq %[y], %[x]\n"
        : [x] "+r" (""", x, """)
        : [ctl] "r" (""", ctl, """), [y] "r" (""", y, """)
        : "cc"
      );"""].}
  else:
    {.emit:[
      """
      asm volatile(
        "testq %[ctl], %[ctl]\n"
        "cmovnzq %[y], %[x]\n"
        : [x] "+r" (*""", x, """)
        : [ctl] "r" (""", ctl, """), [y] "r" (""", y, """)
        : "cc"
      );"""].}

let x = 0x1111111'u64
let y = 0xFFFFFFF'u64

block:
  let ctl = 1'u64
  var a0 = x
  ctl.ccopy_x86_asm(a0, y)

  var a1 = x
  ctl.ccopy_x86_emit(a1, y)

  echo "a0: ", a0.toHex()
  echo "a1: ", a1.toHex()
  doAssert a0 == a1

block:
  let ctl = 0'u64
  var a0 = x
  ctl.ccopy_x86_asm(a0, y)

  var a1 = x
  ctl.ccopy_x86_emit(a1, y)

  echo "a0: ", a0.toHex()
  echo "a1: ", a1.toHex()
  doAssert a0 == a1

Output matrix

lang version status
C v1.6.16 :white_check_mark:
C++ v1.6.16 :white_check_mark:
C v2.0.2 :x:
C++ v2.0.2 :white_check_mark:

Expected output:

a0: 000000000FFFFFFF
a1: 000000000FFFFFFF
a0: 0000000001111111
a1: 0000000001111111

Incorrect:

a0: 0000000001111111
a1: 000000000FFFFFFF
fatal.nim(53)            sysFatal
Error: unhandled exception: ccopy.nim(61, 3) `a0 == a1`  [AssertionDefect]

and that's not taking into account overriding the var pointer, which might lead to writing to random location.

Suggested solution ASM should also auto-deref var pointers.

Note The fix can probably address https://github.com/nim-lang/Nim/issues/18133 in one fell swoop.

ringabout commented 10 months ago

!nim c

import strutils

const
  nim_v2 = (NimMajor, NimMinor) > (1, 6)
  noExplicitVarDeref = defined(cpp) or nim_v2

func ccopy_x86_asm(ctl: uint64, x: var uint64, y: uint64) =
  when noExplicitVarDeref:
    asm """
      testq %[ctl], %[ctl]
      cmovnzq %[y], %[x]
      : [x] "+r" (`x`)
      : [ctl] "r" (`ctl`), [y] "r" (`y`)
      : "cc"
    """
  else:
    asm """
      testq %[ctl], %[ctl]
      cmovnzq %[y], %[x]
      : [x] "+r" (*`x`)
      : [ctl] "r" (`ctl`), [y] "r" (`y`)
      : "cc"
    """

func ccopy_x86_emit(ctl: uint64, x: var uint64, y: uint64) =
  when noExplicitVarDeref:
    {.emit:[
      """
      asm volatile(
        "testq %[ctl], %[ctl]\n"
        "cmovnzq %[y], %[x]\n"
        : [x] "+r" (""", x, """)
        : [ctl] "r" (""", ctl, """), [y] "r" (""", y, """)
        : "cc"
      );"""].}
  else:
    {.emit:[
      """
      asm volatile(
        "testq %[ctl], %[ctl]\n"
        "cmovnzq %[y], %[x]\n"
        : [x] "+r" (*""", x, """)
        : [ctl] "r" (""", ctl, """), [y] "r" (""", y, """)
        : "cc"
      );"""].}

let x = 0x1111111'u64
let y = 0xFFFFFFF'u64

block:
  let ctl = 1'u64
  var a0 = x
  ctl.ccopy_x86_asm(a0, y)

  var a1 = x
  ctl.ccopy_x86_emit(a1, y)

  echo "a0: ", a0.toHex()
  echo "a1: ", a1.toHex()
  doAssert a0 == a1

block:
  let ctl = 0'u64
  var a0 = x
  ctl.ccopy_x86_asm(a0, y)

  var a1 = x
  ctl.ccopy_x86_emit(a1, y)

  echo "a0: ", a0.toHex()
  echo "a1: ", a1.toHex()
  doAssert a0 == a1
github-actions[bot] commented 10 months ago
:penguin: Linux bisect by @ringabout (member)
devel :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/temp.nim temp /home/runner/.choosenim/toolchains/nim-#devel/lib/std/assertions.nim failedAssertImpl /home/runner/.choosenim/toolchains/nim-#devel/lib/std/assertions.nim raiseAssert /home/runner/.choosenim/toolchains/nim-#devel/lib/system/fatal.nim sysFatal Error: unhandled exception: /home/runner/work/Nim/Nim/temp.nim(53, 3) `a0 == a1` [AssertionDefect] Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp' assertions.nim(34) raiseAssert Error: unhandled exception: errGenerated [AssertionDefect] ```

IR

Compiled filesize 100.42 Kb (102,832 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); #define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); #define nimln_(n) \ FR_.line = n; #define nimlf_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__Re75IspeoxXy2oCZHwcRrA[2]; N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_u24)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4666)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_u28)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2); N_LIB_PRIVATE N_NIMCALL(NimStringV2, toHex__temp_u37)(NU64 x_p0); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0); N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u254)(NimStringV2 msg_p0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); static const struct { NI cap; NIM_CHAR data[4+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 4 | NIM_STRLIT_FLAG, "a0: " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {4, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2}; static const struct { NI cap; NIM_CHAR data[4+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 4 | NIM_STRLIT_FLAG, "a1: " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {4, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; static const struct { NI cap; NIM_CHAR data[53+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_6 = { 53 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(53, 3) `a0 == a1` " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_7 = {53, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_6}; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_8 = {4, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2}; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_9 = {4, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; static const struct { NI cap; NIM_CHAR data[53+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_10 = { 53 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(62, 3) `a0 == a1` " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_11 = {53, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_10}; N_LIB_PRIVATE NIM_CONST NU64 x__temp_u32 = 17895697ULL; N_LIB_PRIVATE NIM_CONST NU64 y__temp_u33 = 268435455ULL; N_LIB_PRIVATE NIM_CONST NU64 ctl__temp_u34 = 1ULL; N_LIB_PRIVATE NU64 a0__temp_u35; extern NIM_THREADVAR TFrame* framePtr__system_u4053; N_LIB_PRIVATE NU64 a1__temp_u36; N_LIB_PRIVATE NIM_CONST NU64 ctl__temp_u52 = 0ULL; N_LIB_PRIVATE NU64 a0__temp_u53; N_LIB_PRIVATE NU64 a1__temp_u54; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4450; static N_INLINE(void, nimFrame)(TFrame* s_p0) { { if (!(framePtr__system_u4053 == ((TFrame*) NIM_NIL))) goto LA3_; (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { (*s_p0).calldepth = (NI16)((*framePtr__system_u4053).calldepth + ((NI16)1)); } LA1_: ; (*s_p0).prev = framePtr__system_u4053; framePtr__system_u4053 = s_p0; { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4666(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u4053 = (*framePtr__system_u4053).prev; } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_u24)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2) { nimfr_("ccopy_x86_asm", "/home/runner/work/Nim/Nim/temp.nim"); __asm__(" testq %[ctl], %[ctl]\n" " cmovnzq %[y], %[x]\n" : [x] "+r" (x_p1) : [ctl] "r" (ctl_p0), [y] "r" (y_p2) : "cc" ); popFrame(); } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_u28)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2) { nimfr_("ccopy_x86_emit", "/home/runner/work/Nim/Nim/temp.nim"); asm volatile( "testq %[ctl], %[ctl]\n" "cmovnzq %[y], %[x]\n" : [x] "+r" ((*x_p1)) : [ctl] "r" (ctl_p0), [y] "r" (y_p2) : "cc" ); popFrame(); } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (&nimInErrorMode__system_u4450); return result; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); nimErr_ = nimErrorFlag(); { NimStringV2 colontmpD_; NimStringV2 colontmpD__2; tyArray__Re75IspeoxXy2oCZHwcRrA T3_; tyArray__Re75IspeoxXy2oCZHwcRrA T4_; colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL; a0__temp_u35 = x__temp_u32; ccopy_x86_asm__temp_u24(ctl__temp_u34, (&a0__temp_u35), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; a1__temp_u36 = x__temp_u32; ccopy_x86_emit__temp_u28(ctl__temp_u34, (&a1__temp_u36), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; T3_[0] = TM__SRd76hP9cMfCzdUO857UhQQ_3; colontmpD_ = toHex__temp_u37(a0__temp_u35); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; T3_[1] = colontmpD_; echoBinSafe(T3_, 2); T4_[0] = TM__SRd76hP9cMfCzdUO857UhQQ_5; colontmpD__2 = toHex__temp_u37(a1__temp_u36); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; T4_[1] = colontmpD__2; echoBinSafe(T4_, 2); { if (!!((a0__temp_u35 == a1__temp_u36))) goto LA7_; failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_7); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; } LA7_: ; { LA2_:; } { if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD__2.p); } if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p); } } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; } { NimStringV2 colontmpD__3; NimStringV2 colontmpD__4; tyArray__Re75IspeoxXy2oCZHwcRrA T13_; tyArray__Re75IspeoxXy2oCZHwcRrA T14_; colontmpD__3.len = 0; colontmpD__3.p = NIM_NIL; colontmpD__4.len = 0; colontmpD__4.p = NIM_NIL; a0__temp_u53 = x__temp_u32; ccopy_x86_asm__temp_u24(ctl__temp_u52, (&a0__temp_u53), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; a1__temp_u54 = x__temp_u32; ccopy_x86_emit__temp_u28(ctl__temp_u52, (&a1__temp_u54), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; T13_[0] = TM__SRd76hP9cMfCzdUO857UhQQ_8; colontmpD__3 = toHex__temp_u37(a0__temp_u53); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; T13_[1] = colontmpD__3; echoBinSafe(T13_, 2); T14_[0] = TM__SRd76hP9cMfCzdUO857UhQQ_9; colontmpD__4 = toHex__temp_u37(a1__temp_u54); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; T14_[1] = colontmpD__4; echoBinSafe(T14_, 2); { if (!!((a0__temp_u53 == a1__temp_u54))) goto LA17_; failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_11); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; } LA17_: ; { LA12_:; } { if (colontmpD__4.p && !(colontmpD__4.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD__4.p); } if (colontmpD__3.p && !(colontmpD__3.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD__3.p); } } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; } BeforeRet_: ; nimTestErrorFlag(); popFrame(); } } ```

Stats

  • Started 2023-12-22T01:59:38
  • Finished 2023-12-22T01:59:39
  • Duration

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( newIdentNode("strutils") ), nnkConstSection.newTree( nnkConstDef.newTree( newIdentNode("nim_v2"), newEmptyNode(), nnkInfix.newTree( newIdentNode(">"), nnkTupleConstr.newTree( newIdentNode("NimMajor"), newIdentNode("NimMinor") ), nnkTupleConstr.newTree( newLit(1), newLit(6) ) ) ), nnkConstDef.newTree( newIdentNode("noExplicitVarDeref"), newEmptyNode(), nnkInfix.newTree( newIdentNode("or"), nnkCall.newTree( newIdentNode("defined"), newIdentNode("cpp") ), newIdentNode("nim_v2") ) ) ), nnkFuncDef.newTree( newIdentNode("ccopy_x86_asm"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("ctl"), newIdentNode("uint64"), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), nnkVarTy.newTree( newIdentNode("uint64") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("y"), newIdentNode("uint64"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkWhenStmt.newTree( nnkElifBranch.newTree( newIdentNode("noExplicitVarDeref"), nnkStmtList.newTree( nnkAsmStmt.newTree( newEmptyNode(), newLit(" testq %[ctl], %[ctl]\n cmovnzq %[y], %[x]\n : [x] \"+r\" (`x`)\n : [ctl] \"r\" (`ctl`), [y] \"r\" (`y`)\n : \"cc\"\n ") ) ) ), nnkElse.newTree( nnkStmtList.newTree( nnkAsmStmt.newTree( newEmptyNode(), newLit(" testq %[ctl], %[ctl]\n cmovnzq %[y], %[x]\n : [x] \"+r\" (*`x`)\n : [ctl] \"r\" (`ctl`), [y] \"r\" (`y`)\n : \"cc\"\n ") ) ) ) ) ) ), nnkFuncDef.newTree( newIdentNode("ccopy_x86_emit"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("ctl"), newIdentNode("uint64"), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), nnkVarTy.newTree( newIdentNode("uint64") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("y"), newIdentNode("uint64"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkWhenStmt.newTree( nnkElifBranch.newTree( newIdentNode("noExplicitVarDeref"), nnkStmtList.newTree( nnkPragma.newTree( nnkExprColonExpr.newTree( newIdentNode("emit"), nnkBracket.newTree( newLit(" asm volatile(\n \"testq %[ctl], %[ctl]\\n\"\n \"cmovnzq %[y], %[x]\\n\"\n : [x] \"+r\" ("), newIdentNode("x"), newLit(")\n : [ctl] \"r\" ("), newIdentNode("ctl"), newLit("), [y] \"r\" ("), newIdentNode("y"), newLit(")\n : \"cc\"\n );") ) ) ) ) ), nnkElse.newTree( nnkStmtList.newTree( nnkPragma.newTree( nnkExprColonExpr.newTree( newIdentNode("emit"), nnkBracket.newTree( newLit(" asm volatile(\n \"testq %[ctl], %[ctl]\\n\"\n \"cmovnzq %[y], %[x]\\n\"\n : [x] \"+r\" (*"), newIdentNode("x"), newLit(")\n : [ctl] \"r\" ("), newIdentNode("ctl"), newLit("), [y] \"r\" ("), newIdentNode("y"), newLit(")\n : \"cc\"\n );") ) ) ) ) ) ) ) ), nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("x"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("y"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkBlockStmt.newTree( newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("ctl"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a0"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_asm") ), newIdentNode("a0"), newIdentNode("y") ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a1"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_emit") ), newIdentNode("a1"), newIdentNode("y") ), nnkCommand.newTree( newIdentNode("echo"), newLit("a0: "), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a0"), newIdentNode("toHex") ) ) ), nnkCommand.newTree( newIdentNode("echo"), newLit("a1: "), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a1"), newIdentNode("toHex") ) ) ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), newIdentNode("a0"), newIdentNode("a1") ) ) ) ), nnkBlockStmt.newTree( newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("ctl"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a0"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_asm") ), newIdentNode("a0"), newIdentNode("y") ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a1"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_emit") ), newIdentNode("a1"), newIdentNode("y") ), nnkCommand.newTree( newIdentNode("echo"), newLit("a0: "), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a0"), newIdentNode("toHex") ) ) ), nnkCommand.newTree( newIdentNode("echo"), newLit("a1: "), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a1"), newIdentNode("toHex") ) ) ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), newIdentNode("a0"), newIdentNode("a1") ) ) ) ) ) ```
stable :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/temp.nim temp /home/runner/.choosenim/toolchains/nim-2.0.2/lib/std/assertions.nim failedAssertImpl /home/runner/.choosenim/toolchains/nim-2.0.2/lib/std/assertions.nim raiseAssert /home/runner/.choosenim/toolchains/nim-2.0.2/lib/system/fatal.nim sysFatal Error: unhandled exception: /home/runner/work/Nim/Nim/temp.nim(53, 3) `a0 == a1` [AssertionDefect] Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp' assertions.nim(34) raiseAssert Error: unhandled exception: options.nim(681, 5) `false` errGenerated [AssertionDefect] ```

IR

Compiled filesize 97.06 Kb (99,392 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); #define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); #define nimln_(n) \ FR_.line = n; #define nimlf_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__Re75IspeoxXy2oCZHwcRrA[2]; N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_u24)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4621)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_u28)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2); N_LIB_PRIVATE N_NIMCALL(NimStringV2, toHex__temp_u37)(NU64 x_p0); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0); N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u310)(NimStringV2 msg_p0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); static const struct { NI cap; NIM_CHAR data[4+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 4 | NIM_STRLIT_FLAG, "a0: " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {4, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2}; static const struct { NI cap; NIM_CHAR data[4+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 4 | NIM_STRLIT_FLAG, "a1: " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {4, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; static const struct { NI cap; NIM_CHAR data[53+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_6 = { 53 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(53, 3) `a0 == a1` " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_7 = {53, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_6}; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_8 = {4, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2}; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_9 = {4, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; static const struct { NI cap; NIM_CHAR data[53+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_10 = { 53 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(62, 3) `a0 == a1` " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_11 = {53, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_10}; N_LIB_PRIVATE NIM_CONST NU64 x__temp_u32 = 17895697ULL; N_LIB_PRIVATE NIM_CONST NU64 y__temp_u33 = 268435455ULL; N_LIB_PRIVATE NIM_CONST NU64 ctl__temp_u34 = 1ULL; N_LIB_PRIVATE NU64 a0__temp_u35; extern NIM_THREADVAR TFrame* framePtr__system_u4020; N_LIB_PRIVATE NU64 a1__temp_u36; N_LIB_PRIVATE NIM_CONST NU64 ctl__temp_u52 = 0ULL; N_LIB_PRIVATE NU64 a0__temp_u53; N_LIB_PRIVATE NU64 a1__temp_u54; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4403; static N_INLINE(void, nimFrame)(TFrame* s_p0) { { if (!(framePtr__system_u4020 == ((TFrame*) NIM_NIL))) goto LA3_; (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { (*s_p0).calldepth = (NI16)((*framePtr__system_u4020).calldepth + ((NI16)1)); } LA1_: ; (*s_p0).prev = framePtr__system_u4020; framePtr__system_u4020 = s_p0; { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4621(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u4020 = (*framePtr__system_u4020).prev; } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_u24)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2) { nimfr_("ccopy_x86_asm", "/home/runner/work/Nim/Nim/temp.nim"); __asm__(" testq %[ctl], %[ctl]\n" " cmovnzq %[y], %[x]\n" : [x] "+r" (x_p1) : [ctl] "r" (ctl_p0), [y] "r" (y_p2) : "cc" ); popFrame(); } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_u28)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2) { nimfr_("ccopy_x86_emit", "/home/runner/work/Nim/Nim/temp.nim"); asm volatile( "testq %[ctl], %[ctl]\n" "cmovnzq %[y], %[x]\n" : [x] "+r" ((*x_p1)) : [ctl] "r" (ctl_p0), [y] "r" (y_p2) : "cc" ); popFrame(); } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (&nimInErrorMode__system_u4403); return result; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); nimErr_ = nimErrorFlag(); { NimStringV2 colontmpD_; NimStringV2 colontmpD__2; tyArray__Re75IspeoxXy2oCZHwcRrA T3_; tyArray__Re75IspeoxXy2oCZHwcRrA T4_; colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL; a0__temp_u35 = x__temp_u32; ccopy_x86_asm__temp_u24(ctl__temp_u34, (&a0__temp_u35), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; a1__temp_u36 = x__temp_u32; ccopy_x86_emit__temp_u28(ctl__temp_u34, (&a1__temp_u36), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; T3_[0] = TM__SRd76hP9cMfCzdUO857UhQQ_3; colontmpD_ = toHex__temp_u37(a0__temp_u35); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; T3_[1] = colontmpD_; echoBinSafe(T3_, 2); T4_[0] = TM__SRd76hP9cMfCzdUO857UhQQ_5; colontmpD__2 = toHex__temp_u37(a1__temp_u36); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; T4_[1] = colontmpD__2; echoBinSafe(T4_, 2); { if (!!((a0__temp_u35 == a1__temp_u36))) goto LA7_; failedAssertImpl__stdZassertions_u310(TM__SRd76hP9cMfCzdUO857UhQQ_7); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; } LA7_: ; { LA2_:; } { if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD__2.p); } if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p); } } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; } { NimStringV2 colontmpD__3; NimStringV2 colontmpD__4; tyArray__Re75IspeoxXy2oCZHwcRrA T13_; tyArray__Re75IspeoxXy2oCZHwcRrA T14_; colontmpD__3.len = 0; colontmpD__3.p = NIM_NIL; colontmpD__4.len = 0; colontmpD__4.p = NIM_NIL; a0__temp_u53 = x__temp_u32; ccopy_x86_asm__temp_u24(ctl__temp_u52, (&a0__temp_u53), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; a1__temp_u54 = x__temp_u32; ccopy_x86_emit__temp_u28(ctl__temp_u52, (&a1__temp_u54), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; T13_[0] = TM__SRd76hP9cMfCzdUO857UhQQ_8; colontmpD__3 = toHex__temp_u37(a0__temp_u53); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; T13_[1] = colontmpD__3; echoBinSafe(T13_, 2); T14_[0] = TM__SRd76hP9cMfCzdUO857UhQQ_9; colontmpD__4 = toHex__temp_u37(a1__temp_u54); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; T14_[1] = colontmpD__4; echoBinSafe(T14_, 2); { if (!!((a0__temp_u53 == a1__temp_u54))) goto LA17_; failedAssertImpl__stdZassertions_u310(TM__SRd76hP9cMfCzdUO857UhQQ_11); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; } LA17_: ; { LA12_:; } { if (colontmpD__4.p && !(colontmpD__4.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD__4.p); } if (colontmpD__3.p && !(colontmpD__3.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD__3.p); } } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; } BeforeRet_: ; nimTestErrorFlag(); popFrame(); } } ```

Stats

  • Started 2023-12-22T01:59:39
  • Finished 2023-12-22T01:59:40
  • Duration

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( newIdentNode("strutils") ), nnkConstSection.newTree( nnkConstDef.newTree( newIdentNode("nim_v2"), newEmptyNode(), nnkInfix.newTree( newIdentNode(">"), nnkTupleConstr.newTree( newIdentNode("NimMajor"), newIdentNode("NimMinor") ), nnkTupleConstr.newTree( newLit(1), newLit(6) ) ) ), nnkConstDef.newTree( newIdentNode("noExplicitVarDeref"), newEmptyNode(), nnkInfix.newTree( newIdentNode("or"), nnkCall.newTree( newIdentNode("defined"), newIdentNode("cpp") ), newIdentNode("nim_v2") ) ) ), nnkFuncDef.newTree( newIdentNode("ccopy_x86_asm"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("ctl"), newIdentNode("uint64"), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), nnkVarTy.newTree( newIdentNode("uint64") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("y"), newIdentNode("uint64"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkWhenStmt.newTree( nnkElifBranch.newTree( newIdentNode("noExplicitVarDeref"), nnkStmtList.newTree( nnkAsmStmt.newTree( newEmptyNode(), newLit(" testq %[ctl], %[ctl]\n cmovnzq %[y], %[x]\n : [x] \"+r\" (`x`)\n : [ctl] \"r\" (`ctl`), [y] \"r\" (`y`)\n : \"cc\"\n ") ) ) ), nnkElse.newTree( nnkStmtList.newTree( nnkAsmStmt.newTree( newEmptyNode(), newLit(" testq %[ctl], %[ctl]\n cmovnzq %[y], %[x]\n : [x] \"+r\" (*`x`)\n : [ctl] \"r\" (`ctl`), [y] \"r\" (`y`)\n : \"cc\"\n ") ) ) ) ) ) ), nnkFuncDef.newTree( newIdentNode("ccopy_x86_emit"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("ctl"), newIdentNode("uint64"), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), nnkVarTy.newTree( newIdentNode("uint64") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("y"), newIdentNode("uint64"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkWhenStmt.newTree( nnkElifBranch.newTree( newIdentNode("noExplicitVarDeref"), nnkStmtList.newTree( nnkPragma.newTree( nnkExprColonExpr.newTree( newIdentNode("emit"), nnkBracket.newTree( newLit(" asm volatile(\n \"testq %[ctl], %[ctl]\\n\"\n \"cmovnzq %[y], %[x]\\n\"\n : [x] \"+r\" ("), newIdentNode("x"), newLit(")\n : [ctl] \"r\" ("), newIdentNode("ctl"), newLit("), [y] \"r\" ("), newIdentNode("y"), newLit(")\n : \"cc\"\n );") ) ) ) ) ), nnkElse.newTree( nnkStmtList.newTree( nnkPragma.newTree( nnkExprColonExpr.newTree( newIdentNode("emit"), nnkBracket.newTree( newLit(" asm volatile(\n \"testq %[ctl], %[ctl]\\n\"\n \"cmovnzq %[y], %[x]\\n\"\n : [x] \"+r\" (*"), newIdentNode("x"), newLit(")\n : [ctl] \"r\" ("), newIdentNode("ctl"), newLit("), [y] \"r\" ("), newIdentNode("y"), newLit(")\n : \"cc\"\n );") ) ) ) ) ) ) ) ), nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("x"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("y"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkBlockStmt.newTree( newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("ctl"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a0"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_asm") ), newIdentNode("a0"), newIdentNode("y") ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a1"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_emit") ), newIdentNode("a1"), newIdentNode("y") ), nnkCommand.newTree( newIdentNode("echo"), newLit("a0: "), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a0"), newIdentNode("toHex") ) ) ), nnkCommand.newTree( newIdentNode("echo"), newLit("a1: "), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a1"), newIdentNode("toHex") ) ) ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), newIdentNode("a0"), newIdentNode("a1") ) ) ) ), nnkBlockStmt.newTree( newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("ctl"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a0"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_asm") ), newIdentNode("a0"), newIdentNode("y") ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a1"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_emit") ), newIdentNode("a1"), newIdentNode("y") ), nnkCommand.newTree( newIdentNode("echo"), newLit("a0: "), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a0"), newIdentNode("toHex") ) ) ), nnkCommand.newTree( newIdentNode("echo"), newLit("a1: "), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a1"), newIdentNode("toHex") ) ) ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), newIdentNode("a0"), newIdentNode("a1") ) ) ) ) ) ```
2.0.0 :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/temp.nim temp /home/runner/.choosenim/toolchains/nim-2.0.0/lib/std/assertions.nim failedAssertImpl /home/runner/.choosenim/toolchains/nim-2.0.0/lib/std/assertions.nim raiseAssert /home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/fatal.nim sysFatal Error: unhandled exception: /home/runner/work/Nim/Nim/temp.nim(53, 3) `a0 == a1` [AssertionDefect] Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp' assertions.nim(34) raiseAssert Error: unhandled exception: options.nim(664, 5) `false` errGenerated [AssertionDefect] ```

IR

Compiled filesize 97.06 Kb (99,392 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); #define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); #define nimln_(n) \ FR_.line = n; #define nimlf_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__Re75IspeoxXy2oCZHwcRrA[2]; N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_u24)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4607)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_u28)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2); N_LIB_PRIVATE N_NIMCALL(NimStringV2, toHex__temp_u37)(NU64 x_p0); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0); N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u310)(NimStringV2 msg_p0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); static const struct { NI cap; NIM_CHAR data[4+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 4 | NIM_STRLIT_FLAG, "a0: " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {4, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2}; static const struct { NI cap; NIM_CHAR data[4+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 4 | NIM_STRLIT_FLAG, "a1: " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {4, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; static const struct { NI cap; NIM_CHAR data[53+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_6 = { 53 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(53, 3) `a0 == a1` " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_7 = {53, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_6}; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_8 = {4, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2}; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_9 = {4, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; static const struct { NI cap; NIM_CHAR data[53+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_10 = { 53 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(62, 3) `a0 == a1` " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_11 = {53, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_10}; N_LIB_PRIVATE NIM_CONST NU64 x__temp_u32 = 17895697ULL; N_LIB_PRIVATE NIM_CONST NU64 y__temp_u33 = 268435455ULL; N_LIB_PRIVATE NIM_CONST NU64 ctl__temp_u34 = 1ULL; N_LIB_PRIVATE NU64 a0__temp_u35; extern NIM_THREADVAR TFrame* framePtr__system_u4006; N_LIB_PRIVATE NU64 a1__temp_u36; N_LIB_PRIVATE NIM_CONST NU64 ctl__temp_u52 = 0ULL; N_LIB_PRIVATE NU64 a0__temp_u53; N_LIB_PRIVATE NU64 a1__temp_u54; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4389; static N_INLINE(void, nimFrame)(TFrame* s_p0) { { if (!(framePtr__system_u4006 == ((TFrame*) NIM_NIL))) goto LA3_; (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { (*s_p0).calldepth = (NI16)((*framePtr__system_u4006).calldepth + ((NI16)1)); } LA1_: ; (*s_p0).prev = framePtr__system_u4006; framePtr__system_u4006 = s_p0; { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4607(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u4006 = (*framePtr__system_u4006).prev; } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_u24)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2) { nimfr_("ccopy_x86_asm", "/home/runner/work/Nim/Nim/temp.nim"); __asm__(" testq %[ctl], %[ctl]\n" " cmovnzq %[y], %[x]\n" : [x] "+r" (x_p1) : [ctl] "r" (ctl_p0), [y] "r" (y_p2) : "cc" ); popFrame(); } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_u28)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2) { nimfr_("ccopy_x86_emit", "/home/runner/work/Nim/Nim/temp.nim"); asm volatile( "testq %[ctl], %[ctl]\n" "cmovnzq %[y], %[x]\n" : [x] "+r" ((*x_p1)) : [ctl] "r" (ctl_p0), [y] "r" (y_p2) : "cc" ); popFrame(); } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (NIM_BOOL*)0; result = (&nimInErrorMode__system_u4389); return result; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); nimErr_ = nimErrorFlag(); { NimStringV2 colontmpD_; NimStringV2 colontmpD__2; tyArray__Re75IspeoxXy2oCZHwcRrA T3_; tyArray__Re75IspeoxXy2oCZHwcRrA T4_; colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL; a0__temp_u35 = x__temp_u32; ccopy_x86_asm__temp_u24(ctl__temp_u34, (&a0__temp_u35), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; a1__temp_u36 = x__temp_u32; ccopy_x86_emit__temp_u28(ctl__temp_u34, (&a1__temp_u36), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; T3_[0] = TM__SRd76hP9cMfCzdUO857UhQQ_3; colontmpD_ = toHex__temp_u37(a0__temp_u35); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; T3_[1] = colontmpD_; echoBinSafe(T3_, 2); T4_[0] = TM__SRd76hP9cMfCzdUO857UhQQ_5; colontmpD__2 = toHex__temp_u37(a1__temp_u36); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; T4_[1] = colontmpD__2; echoBinSafe(T4_, 2); { if (!!((a0__temp_u35 == a1__temp_u36))) goto LA7_; failedAssertImpl__stdZassertions_u310(TM__SRd76hP9cMfCzdUO857UhQQ_7); if (NIM_UNLIKELY(*nimErr_)) goto LA2_; } LA7_: ; { LA2_:; } { if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD__2.p); } if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p); } } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; } { NimStringV2 colontmpD__3; NimStringV2 colontmpD__4; tyArray__Re75IspeoxXy2oCZHwcRrA T13_; tyArray__Re75IspeoxXy2oCZHwcRrA T14_; colontmpD__3.len = 0; colontmpD__3.p = NIM_NIL; colontmpD__4.len = 0; colontmpD__4.p = NIM_NIL; a0__temp_u53 = x__temp_u32; ccopy_x86_asm__temp_u24(ctl__temp_u52, (&a0__temp_u53), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; a1__temp_u54 = x__temp_u32; ccopy_x86_emit__temp_u28(ctl__temp_u52, (&a1__temp_u54), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; T13_[0] = TM__SRd76hP9cMfCzdUO857UhQQ_8; colontmpD__3 = toHex__temp_u37(a0__temp_u53); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; T13_[1] = colontmpD__3; echoBinSafe(T13_, 2); T14_[0] = TM__SRd76hP9cMfCzdUO857UhQQ_9; colontmpD__4 = toHex__temp_u37(a1__temp_u54); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; T14_[1] = colontmpD__4; echoBinSafe(T14_, 2); { if (!!((a0__temp_u53 == a1__temp_u54))) goto LA17_; failedAssertImpl__stdZassertions_u310(TM__SRd76hP9cMfCzdUO857UhQQ_11); if (NIM_UNLIKELY(*nimErr_)) goto LA12_; } LA17_: ; { LA12_:; } { if (colontmpD__4.p && !(colontmpD__4.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD__4.p); } if (colontmpD__3.p && !(colontmpD__3.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD__3.p); } } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; } BeforeRet_: ; nimTestErrorFlag(); popFrame(); } } ```

Stats

  • Started 2023-12-22T01:59:43
  • Finished 2023-12-22T01:59:43
  • Duration

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( newIdentNode("strutils") ), nnkConstSection.newTree( nnkConstDef.newTree( newIdentNode("nim_v2"), newEmptyNode(), nnkInfix.newTree( newIdentNode(">"), nnkTupleConstr.newTree( newIdentNode("NimMajor"), newIdentNode("NimMinor") ), nnkTupleConstr.newTree( newLit(1), newLit(6) ) ) ), nnkConstDef.newTree( newIdentNode("noExplicitVarDeref"), newEmptyNode(), nnkInfix.newTree( newIdentNode("or"), nnkCall.newTree( newIdentNode("defined"), newIdentNode("cpp") ), newIdentNode("nim_v2") ) ) ), nnkFuncDef.newTree( newIdentNode("ccopy_x86_asm"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("ctl"), newIdentNode("uint64"), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), nnkVarTy.newTree( newIdentNode("uint64") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("y"), newIdentNode("uint64"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkWhenStmt.newTree( nnkElifBranch.newTree( newIdentNode("noExplicitVarDeref"), nnkStmtList.newTree( nnkAsmStmt.newTree( newEmptyNode(), newLit(" testq %[ctl], %[ctl]\n cmovnzq %[y], %[x]\n : [x] \"+r\" (`x`)\n : [ctl] \"r\" (`ctl`), [y] \"r\" (`y`)\n : \"cc\"\n ") ) ) ), nnkElse.newTree( nnkStmtList.newTree( nnkAsmStmt.newTree( newEmptyNode(), newLit(" testq %[ctl], %[ctl]\n cmovnzq %[y], %[x]\n : [x] \"+r\" (*`x`)\n : [ctl] \"r\" (`ctl`), [y] \"r\" (`y`)\n : \"cc\"\n ") ) ) ) ) ) ), nnkFuncDef.newTree( newIdentNode("ccopy_x86_emit"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("ctl"), newIdentNode("uint64"), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), nnkVarTy.newTree( newIdentNode("uint64") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("y"), newIdentNode("uint64"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkWhenStmt.newTree( nnkElifBranch.newTree( newIdentNode("noExplicitVarDeref"), nnkStmtList.newTree( nnkPragma.newTree( nnkExprColonExpr.newTree( newIdentNode("emit"), nnkBracket.newTree( newLit(" asm volatile(\n \"testq %[ctl], %[ctl]\\n\"\n \"cmovnzq %[y], %[x]\\n\"\n : [x] \"+r\" ("), newIdentNode("x"), newLit(")\n : [ctl] \"r\" ("), newIdentNode("ctl"), newLit("), [y] \"r\" ("), newIdentNode("y"), newLit(")\n : \"cc\"\n );") ) ) ) ) ), nnkElse.newTree( nnkStmtList.newTree( nnkPragma.newTree( nnkExprColonExpr.newTree( newIdentNode("emit"), nnkBracket.newTree( newLit(" asm volatile(\n \"testq %[ctl], %[ctl]\\n\"\n \"cmovnzq %[y], %[x]\\n\"\n : [x] \"+r\" (*"), newIdentNode("x"), newLit(")\n : [ctl] \"r\" ("), newIdentNode("ctl"), newLit("), [y] \"r\" ("), newIdentNode("y"), newLit(")\n : \"cc\"\n );") ) ) ) ) ) ) ) ), nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("x"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("y"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkBlockStmt.newTree( newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("ctl"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a0"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_asm") ), newIdentNode("a0"), newIdentNode("y") ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a1"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_emit") ), newIdentNode("a1"), newIdentNode("y") ), nnkCommand.newTree( newIdentNode("echo"), newLit("a0: "), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a0"), newIdentNode("toHex") ) ) ), nnkCommand.newTree( newIdentNode("echo"), newLit("a1: "), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a1"), newIdentNode("toHex") ) ) ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), newIdentNode("a0"), newIdentNode("a1") ) ) ) ), nnkBlockStmt.newTree( newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("ctl"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a0"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_asm") ), newIdentNode("a0"), newIdentNode("y") ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a1"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_emit") ), newIdentNode("a1"), newIdentNode("y") ), nnkCommand.newTree( newIdentNode("echo"), newLit("a0: "), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a0"), newIdentNode("toHex") ) ) ), nnkCommand.newTree( newIdentNode("echo"), newLit("a1: "), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a1"), newIdentNode("toHex") ) ) ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), newIdentNode("a0"), newIdentNode("a1") ) ) ) ) ) ```
1.6.14 :+1: OK

Output

``` a0: 000000000FFFFFFF a1: 000000000FFFFFFF a0: 0000000001111111 a1: 0000000001111111 ```

IR

Compiled filesize 105.05 Kb (107,576 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #include # define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); # define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); # define nimln_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct NimStringDesc NimStringDesc; typedef struct TGenericSeq TGenericSeq; struct TGenericSeq { NI len; NI reserved; }; struct NimStringDesc { TGenericSeq Sup; NIM_CHAR data[SEQ_DECL_SIZE]; }; typedef NimStringDesc* tyArray__Re75IspeoxXy2oCZHwcRrA[2]; N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_24)(NU64 ctl, NU64* x, NU64 y); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_2997)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_28)(NU64 ctl, NU64* x, NU64 y); static N_INLINE(void, nimZeroMem)(void* p, NI size); static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHex__temp_37)(NU64 x); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringDesc** args, NI argsLen_0); N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__systemZassertions_56)(NimStringDesc* msg); static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "a0: ", 4); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_3, "a1: ", 4); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_4, "/home/runner/work/Nim/Nim/temp.nim(53, 12) `a0 == a1` ", 54); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_5, "/home/runner/work/Nim/Nim/temp.nim(62, 12) `a0 == a1` ", 54); N_LIB_PRIVATE NIM_CONST NU64 x__temp_32 = 17895697ULL; N_LIB_PRIVATE NIM_CONST NU64 y__temp_33 = 268435455ULL; N_LIB_PRIVATE NIM_CONST NU64 ctl__temp_34 = 1ULL; N_LIB_PRIVATE NU64 a0__temp_35; extern TFrame* framePtr__system_2564; extern TFrame* framePtr__system_2564; extern TFrame* framePtr__system_2564; extern TFrame* framePtr__system_2564; extern TFrame* framePtr__system_2564; extern TFrame* framePtr__system_2564; N_LIB_PRIVATE NU64 a1__temp_36; N_LIB_PRIVATE NIM_CONST NU64 ctl__temp_52 = 0ULL; N_LIB_PRIVATE NU64 a0__temp_53; N_LIB_PRIVATE NU64 a1__temp_54; static N_INLINE(void, nimFrame)(TFrame* s) { { if (!(framePtr__system_2564 == ((TFrame*) NIM_NIL))) goto LA3_; (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { (*s).calldepth = (NI16)((*framePtr__system_2564).calldepth + ((NI16) 1)); } LA1_: ; (*s).prev = framePtr__system_2564; framePtr__system_2564 = s; { if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; callDepthLimitReached__system_2997(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_2564 = (*framePtr__system_2564).prev; } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_24)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_asm", "/home/runner/work/Nim/Nim/temp.nim"); asm(" testq %[ctl], %[ctl]\n" " cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_28)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_emit", "/home/runner/work/Nim/Nim/temp.nim"); asm volatile( "testq %[ctl], %[ctl]\n" "cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) { void* T1_; T1_ = (void*)0; T1_ = memset(a, v, ((size_t) (size))); } static N_INLINE(void, nimZeroMem)(void* p, NI size) { nimSetMem__systemZmemory_7(p, ((int) 0), size); } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000(); initStackBottomWith((void *)&inner); atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_Init000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); { tyArray__Re75IspeoxXy2oCZHwcRrA T2_; tyArray__Re75IspeoxXy2oCZHwcRrA T3_; a0__temp_35 = x__temp_32; ccopy_x86_asm__temp_24(ctl__temp_34, (&a0__temp_35), y__temp_33); a1__temp_36 = x__temp_32; ccopy_x86_emit__temp_28(ctl__temp_34, (&a1__temp_36), y__temp_33); nimZeroMem((void*)T2_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T2_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)); T2_[1] = toHex__temp_37(a0__temp_35); echoBinSafe(T2_, 2); nimZeroMem((void*)T3_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T3_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3)); T3_[1] = toHex__temp_37(a1__temp_36); echoBinSafe(T3_, 2); { if (!!((a0__temp_35 == a1__temp_36))) goto LA6_; failedAssertImpl__systemZassertions_56(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_4)); } LA6_: ; } { tyArray__Re75IspeoxXy2oCZHwcRrA T9_; tyArray__Re75IspeoxXy2oCZHwcRrA T10_; a0__temp_53 = x__temp_32; ccopy_x86_asm__temp_24(ctl__temp_52, (&a0__temp_53), y__temp_33); a1__temp_54 = x__temp_32; ccopy_x86_emit__temp_28(ctl__temp_52, (&a1__temp_54), y__temp_33); nimZeroMem((void*)T9_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T9_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)); T9_[1] = toHex__temp_37(a0__temp_53); echoBinSafe(T9_, 2); nimZeroMem((void*)T10_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T10_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3)); T10_[1] = toHex__temp_37(a1__temp_54); echoBinSafe(T10_, 2); { if (!!((a0__temp_53 == a1__temp_54))) goto LA13_; failedAssertImpl__systemZassertions_56(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_5)); } LA13_: ; } popFrame(); } } ```

Stats

  • Started 2023-12-22T01:59:46
  • Finished 2023-12-22T01:59:46
  • Duration
1.4.8 :+1: OK

Output

``` a0: 000000000FFFFFFF a1: 000000000FFFFFFF a0: 0000000001111111 a1: 0000000001111111 ```

IR

Compiled filesize 97.41 Kb (99,752 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #include # define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); # define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); # define nimln_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct NimStringDesc NimStringDesc; typedef struct TGenericSeq TGenericSeq; struct TGenericSeq { NI len; NI reserved; }; struct NimStringDesc { TGenericSeq Sup; NIM_CHAR data[SEQ_DECL_SIZE]; }; typedef NimStringDesc* tyArray__Re75IspeoxXy2oCZHwcRrA[2]; N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA)(NU64 ctl, NU64* x, NU64 y); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2)(NU64 ctl, NU64* x, NU64 y); static N_INLINE(void, nimZeroMem)(void* p, NI size); static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHex__ziyYRZOkaJBp9bZAA9cVEV2w)(NU64 x); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringDesc** args, NI argsLen_0); N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg); static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "a0: ", 4); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_3, "a1: ", 4); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_4, "/home/runner/work/Nim/Nim/temp.nim(53, 12) `a0 == a1` ", 54); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_5, "/home/runner/work/Nim/Nim/temp.nim(62, 12) `a0 == a1` ", 54); N_LIB_PRIVATE NIM_CONST NU64 x__FnxVSC5bS7DK6G1Il7xEdA = 17895697ULL; N_LIB_PRIVATE NIM_CONST NU64 y__rwOCXhIhi2LrRBPlMOIWhw = 268435455ULL; N_LIB_PRIVATE NIM_CONST NU64 ctl__NL0IzIt8we01iibZH8sP2g = 1ULL; N_LIB_PRIVATE NU64 a0__1IWVHqRwgtaDJCcYlJCS5g; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; N_LIB_PRIVATE NU64 a1__CwkjfgqjsBxJeTo1RhU0fw; N_LIB_PRIVATE NIM_CONST NU64 ctl__NL0IzIt8we01iibZH8sP2g_2 = 0ULL; N_LIB_PRIVATE NU64 a0__1IWVHqRwgtaDJCcYlJCS5g_2; N_LIB_PRIVATE NU64 a1__CwkjfgqjsBxJeTo1RhU0fw_2; static N_INLINE(void, nimFrame)(TFrame* s) { { if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == ((TFrame*) NIM_NIL))) goto LA3_; (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { (*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1)); } LA1_: ; (*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s; { if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev; } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_asm", "/home/runner/work/Nim/Nim/temp.nim"); asm(" testq %[ctl], %[ctl]\n" " cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_emit", "/home/runner/work/Nim/Nim/temp.nim"); asm volatile( "testq %[ctl], %[ctl]\n" "cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) { void* T1_; T1_ = (void*)0; T1_ = memset(a, v, ((size_t) (size))); } static N_INLINE(void, nimZeroMem)(void* p, NI size) { nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size); } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); { tyArray__Re75IspeoxXy2oCZHwcRrA T2_; tyArray__Re75IspeoxXy2oCZHwcRrA T3_; a0__1IWVHqRwgtaDJCcYlJCS5g = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA(ctl__NL0IzIt8we01iibZH8sP2g, (&a0__1IWVHqRwgtaDJCcYlJCS5g), y__rwOCXhIhi2LrRBPlMOIWhw); a1__CwkjfgqjsBxJeTo1RhU0fw = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2(ctl__NL0IzIt8we01iibZH8sP2g, (&a1__CwkjfgqjsBxJeTo1RhU0fw), y__rwOCXhIhi2LrRBPlMOIWhw); nimZeroMem((void*)T2_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T2_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)); T2_[1] = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a0__1IWVHqRwgtaDJCcYlJCS5g); echoBinSafe(T2_, 2); nimZeroMem((void*)T3_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T3_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3)); T3_[1] = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a1__CwkjfgqjsBxJeTo1RhU0fw); echoBinSafe(T3_, 2); { if (!!((a0__1IWVHqRwgtaDJCcYlJCS5g == a1__CwkjfgqjsBxJeTo1RhU0fw))) goto LA6_; failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_4)); } LA6_: ; } { tyArray__Re75IspeoxXy2oCZHwcRrA T9_; tyArray__Re75IspeoxXy2oCZHwcRrA T10_; a0__1IWVHqRwgtaDJCcYlJCS5g_2 = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA(ctl__NL0IzIt8we01iibZH8sP2g_2, (&a0__1IWVHqRwgtaDJCcYlJCS5g_2), y__rwOCXhIhi2LrRBPlMOIWhw); a1__CwkjfgqjsBxJeTo1RhU0fw_2 = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2(ctl__NL0IzIt8we01iibZH8sP2g_2, (&a1__CwkjfgqjsBxJeTo1RhU0fw_2), y__rwOCXhIhi2LrRBPlMOIWhw); nimZeroMem((void*)T9_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T9_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)); T9_[1] = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a0__1IWVHqRwgtaDJCcYlJCS5g_2); echoBinSafe(T9_, 2); nimZeroMem((void*)T10_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T10_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3)); T10_[1] = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a1__CwkjfgqjsBxJeTo1RhU0fw_2); echoBinSafe(T10_, 2); { if (!!((a0__1IWVHqRwgtaDJCcYlJCS5g_2 == a1__CwkjfgqjsBxJeTo1RhU0fw_2))) goto LA13_; failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_5)); } LA13_: ; } popFrame(); } } ```

Stats

  • Started 2023-12-22T01:59:48
  • Finished 2023-12-22T01:59:49
  • Duration
1.2.18 :+1: OK

Output

``` a0: 000000000FFFFFFF a1: 000000000FFFFFFF a0: 0000000001111111 a1: 0000000001111111 ```

IR

Compiled filesize 97.14 Kb (99,472 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #include # define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); # define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); # define nimln_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct NimStringDesc NimStringDesc; typedef struct TGenericSeq TGenericSeq; struct TGenericSeq { NI len; NI reserved; }; struct NimStringDesc { TGenericSeq Sup; NIM_CHAR data[SEQ_DECL_SIZE]; }; typedef NimStringDesc* tyArray__Re75IspeoxXy2oCZHwcRrA[2]; N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA)(NU64 ctl, NU64* x, NU64 y); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2)(NU64 ctl, NU64* x, NU64 y); static N_INLINE(void, nimZeroMem)(void* p, NI size); static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHex__ziyYRZOkaJBp9bZAA9cVEV2w)(NU64 x); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringDesc** args, NI argsLen_0); N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg); static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "a0: ", 4); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_3, "a1: ", 4); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_4, "/home/runner/work/Nim/Nim/temp.nim(53, 12) `a0 == a1` ", 54); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_5, "/home/runner/work/Nim/Nim/temp.nim(62, 12) `a0 == a1` ", 54); N_LIB_PRIVATE NIM_CONST NU64 x__FnxVSC5bS7DK6G1Il7xEdA = 17895697ULL; N_LIB_PRIVATE NIM_CONST NU64 y__rwOCXhIhi2LrRBPlMOIWhw = 268435455ULL; N_LIB_PRIVATE NIM_CONST NU64 ctl__NL0IzIt8we01iibZH8sP2g = 1ULL; N_LIB_PRIVATE NU64 a0__1IWVHqRwgtaDJCcYlJCS5g; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; N_LIB_PRIVATE NU64 a1__CwkjfgqjsBxJeTo1RhU0fw; N_LIB_PRIVATE NIM_CONST NU64 ctl__NL0IzIt8we01iibZH8sP2g_2 = 0ULL; N_LIB_PRIVATE NU64 a0__1IWVHqRwgtaDJCcYlJCS5g_2; N_LIB_PRIVATE NU64 a1__CwkjfgqjsBxJeTo1RhU0fw_2; static N_INLINE(void, nimFrame)(TFrame* s) { { if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_; (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { (*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1)); } LA1_: ; (*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s; { if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA8_; callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev; } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_asm", "/home/runner/work/Nim/Nim/temp.nim"); asm(" testq %[ctl], %[ctl]\n" " cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_emit", "/home/runner/work/Nim/Nim/temp.nim"); asm volatile( "testq %[ctl], %[ctl]\n" "cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) { void* T1_; T1_ = (void*)0; T1_ = memset(a, v, ((size_t) (size))); } static N_INLINE(void, nimZeroMem)(void* p, NI size) { nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size); } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); { tyArray__Re75IspeoxXy2oCZHwcRrA T2_; tyArray__Re75IspeoxXy2oCZHwcRrA T3_; a0__1IWVHqRwgtaDJCcYlJCS5g = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA(ctl__NL0IzIt8we01iibZH8sP2g, (&a0__1IWVHqRwgtaDJCcYlJCS5g), y__rwOCXhIhi2LrRBPlMOIWhw); a1__CwkjfgqjsBxJeTo1RhU0fw = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2(ctl__NL0IzIt8we01iibZH8sP2g, (&a1__CwkjfgqjsBxJeTo1RhU0fw), y__rwOCXhIhi2LrRBPlMOIWhw); nimZeroMem((void*)T2_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T2_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)); T2_[1] = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a0__1IWVHqRwgtaDJCcYlJCS5g); echoBinSafe(T2_, 2); nimZeroMem((void*)T3_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T3_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3)); T3_[1] = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a1__CwkjfgqjsBxJeTo1RhU0fw); echoBinSafe(T3_, 2); { if (!!((a0__1IWVHqRwgtaDJCcYlJCS5g == a1__CwkjfgqjsBxJeTo1RhU0fw))) goto LA6_; failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_4)); } LA6_: ; } { tyArray__Re75IspeoxXy2oCZHwcRrA T9_; tyArray__Re75IspeoxXy2oCZHwcRrA T10_; a0__1IWVHqRwgtaDJCcYlJCS5g_2 = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA(ctl__NL0IzIt8we01iibZH8sP2g_2, (&a0__1IWVHqRwgtaDJCcYlJCS5g_2), y__rwOCXhIhi2LrRBPlMOIWhw); a1__CwkjfgqjsBxJeTo1RhU0fw_2 = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2(ctl__NL0IzIt8we01iibZH8sP2g_2, (&a1__CwkjfgqjsBxJeTo1RhU0fw_2), y__rwOCXhIhi2LrRBPlMOIWhw); nimZeroMem((void*)T9_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T9_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)); T9_[1] = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a0__1IWVHqRwgtaDJCcYlJCS5g_2); echoBinSafe(T9_, 2); nimZeroMem((void*)T10_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T10_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3)); T10_[1] = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a1__CwkjfgqjsBxJeTo1RhU0fw_2); echoBinSafe(T10_, 2); { if (!!((a0__1IWVHqRwgtaDJCcYlJCS5g_2 == a1__CwkjfgqjsBxJeTo1RhU0fw_2))) goto LA13_; failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_5)); } LA13_: ; } popFrame(); } } ```

Stats

  • Started 2023-12-22T01:59:50
  • Finished 2023-12-22T01:59:51
  • Duration
1.0.10 :+1: OK

Output

``` a0: 000000000FFFFFFF a1: 000000000FFFFFFF a0: 0000000001111111 a1: 0000000001111111 ```

IR

Compiled filesize 92.63 Kb (94,848 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #include # define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); # define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); # define nimln_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct NimStringDesc NimStringDesc; typedef struct TGenericSeq TGenericSeq; struct TGenericSeq { NI len; NI reserved; }; struct NimStringDesc { TGenericSeq Sup; NIM_CHAR data[SEQ_DECL_SIZE]; }; typedef NimStringDesc* tyArray__Re75IspeoxXy2oCZHwcRrA[2]; N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA)(NU64 ctl, NU64* x, NU64 y); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2)(NU64 ctl, NU64* x, NU64 y); static N_INLINE(void, nimZeroMem)(void* p, NI size); static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size); N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHex__ziyYRZOkaJBp9bZAA9cVEV2w)(NU64 x); N_NIMCALL(void, echoBinSafe)(NimStringDesc** args, NI argsLen_0); N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg); static N_INLINE(void, initStackBottomWith)(void* locals); N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); NU64 x__FnxVSC5bS7DK6G1Il7xEdA; NU64 y__rwOCXhIhi2LrRBPlMOIWhw; NU64 ctl__NL0IzIt8we01iibZH8sP2g; NU64 a0__1IWVHqRwgtaDJCcYlJCS5g; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; NU64 a1__CwkjfgqjsBxJeTo1RhU0fw; NU64 ctl__NL0IzIt8we01iibZH8sP2g_2; NU64 a0__1IWVHqRwgtaDJCcYlJCS5g_2; NU64 a1__CwkjfgqjsBxJeTo1RhU0fw_2; STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "a0: ", 4); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_3, "a1: ", 4); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_4, "/home/runner/work/Nim/Nim/temp.nim(53, 12) `a0 == a1` ", 54); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_5, "/home/runner/work/Nim/Nim/temp.nim(62, 12) `a0 == a1` ", 54); static N_INLINE(void, nimFrame)(TFrame* s) { NI T1_; T1_ = (NI)0; { if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA4_; T1_ = ((NI) 0); } goto LA2_; LA4_: ; { T1_ = ((NI) ((NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1)))); } LA2_: ; (*s).calldepth = ((NI16) (T1_)); (*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s; { if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA9_; callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw(); } LA9_: ; } static N_INLINE(void, popFrame)(void) { framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev; } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_asm", "/home/runner/work/Nim/Nim/temp.nim"); asm(" testq %[ctl], %[ctl]\n" " cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_emit", "/home/runner/work/Nim/Nim/temp.nim"); asm volatile( "testq %[ctl], %[ctl]\n" "cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) { void* T1_; T1_ = (void*)0; T1_ = memset(a, v, ((size_t) (size))); } static N_INLINE(void, nimZeroMem)(void* p, NI size) { nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size); } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } void PreMainInner(void) { } int cmdCount; char** cmdLine; char** gEnv; void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); x__FnxVSC5bS7DK6G1Il7xEdA = 17895697ULL; y__rwOCXhIhi2LrRBPlMOIWhw = 268435455ULL; { tyArray__Re75IspeoxXy2oCZHwcRrA T2_; tyArray__Re75IspeoxXy2oCZHwcRrA T3_; ctl__NL0IzIt8we01iibZH8sP2g = 1ULL; a0__1IWVHqRwgtaDJCcYlJCS5g = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA(ctl__NL0IzIt8we01iibZH8sP2g, (&a0__1IWVHqRwgtaDJCcYlJCS5g), y__rwOCXhIhi2LrRBPlMOIWhw); a1__CwkjfgqjsBxJeTo1RhU0fw = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2(ctl__NL0IzIt8we01iibZH8sP2g, (&a1__CwkjfgqjsBxJeTo1RhU0fw), y__rwOCXhIhi2LrRBPlMOIWhw); nimZeroMem((void*)T2_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T2_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)); T2_[1] = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a0__1IWVHqRwgtaDJCcYlJCS5g); echoBinSafe(T2_, 2); nimZeroMem((void*)T3_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T3_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3)); T3_[1] = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a1__CwkjfgqjsBxJeTo1RhU0fw); echoBinSafe(T3_, 2); { if (!!((a0__1IWVHqRwgtaDJCcYlJCS5g == a1__CwkjfgqjsBxJeTo1RhU0fw))) goto LA6_; failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_4)); } LA6_: ; } { tyArray__Re75IspeoxXy2oCZHwcRrA T9_; tyArray__Re75IspeoxXy2oCZHwcRrA T10_; ctl__NL0IzIt8we01iibZH8sP2g_2 = 0ULL; a0__1IWVHqRwgtaDJCcYlJCS5g_2 = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA(ctl__NL0IzIt8we01iibZH8sP2g_2, (&a0__1IWVHqRwgtaDJCcYlJCS5g_2), y__rwOCXhIhi2LrRBPlMOIWhw); a1__CwkjfgqjsBxJeTo1RhU0fw_2 = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2(ctl__NL0IzIt8we01iibZH8sP2g_2, (&a1__CwkjfgqjsBxJeTo1RhU0fw_2), y__rwOCXhIhi2LrRBPlMOIWhw); nimZeroMem((void*)T9_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T9_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)); T9_[1] = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a0__1IWVHqRwgtaDJCcYlJCS5g_2); echoBinSafe(T9_, 2); nimZeroMem((void*)T10_, sizeof(tyArray__Re75IspeoxXy2oCZHwcRrA)); T10_[0] = copyString(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3)); T10_[1] = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a1__CwkjfgqjsBxJeTo1RhU0fw_2); echoBinSafe(T10_, 2); { if (!!((a0__1IWVHqRwgtaDJCcYlJCS5g_2 == a1__CwkjfgqjsBxJeTo1RhU0fw_2))) goto LA13_; failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_5)); } LA13_: ; } popFrame(); } } ```

Stats

  • Started 2023-12-22T01:59:53
  • Finished 2023-12-22T01:59:54
  • Duration
#70c575095 :arrow_right: :bug:

Diagnostics

ringabout introduced a bug at 2022-12-19 17:56:49 +0800 on commit #70c575095 with message: ``` add changelog for the new strict function checking algorithm (#21129) add changelog for the new strict function checking ``` The bug is in the files: ``` changelogs/changelog_2_0_0.md ``` The bug can be in the commits: (Diagnostics sometimes off-by-one).
Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 19.0
  • Created 2023-12-22T01:59:13Z
  • Comments 1
  • Commands nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim

:robot: Bug found in 48 minutes bisecting 2005 commits at 41 commits per second

metagn commented 10 months ago

The only commit the bisect mentions that touches the compiler is https://github.com/nim-lang/Nim/commit/d83f66a24?

ringabout commented 10 months ago

It's not. I have checked the commit and the commit before it. There are no differences between them.

ringabout commented 10 months ago

!nim c

import strutils

const
  nim_v2 = (NimMajor, NimMinor) > (1, 6)
  noExplicitVarDeref = defined(cpp) or nim_v2

func ccopy_x86_asm(ctl: uint64, x: var uint64, y: uint64) =
  when noExplicitVarDeref:
    asm """
      testq %[ctl], %[ctl]
      cmovnzq %[y], %[x]
      : [x] "+r" (`x`)
      : [ctl] "r" (`ctl`), [y] "r" (`y`)
      : "cc"
    """
  else:
    asm """
      testq %[ctl], %[ctl]
      cmovnzq %[y], %[x]
      : [x] "+r" (*`x`)
      : [ctl] "r" (`ctl`), [y] "r" (`y`)
      : "cc"
    """

func ccopy_x86_emit(ctl: uint64, x: var uint64, y: uint64) =
  when noExplicitVarDeref:
    {.emit:[
      """
      asm volatile(
        "testq %[ctl], %[ctl]\n"
        "cmovnzq %[y], %[x]\n"
        : [x] "+r" (""", x, """)
        : [ctl] "r" (""", ctl, """), [y] "r" (""", y, """)
        : "cc"
      );"""].}
  else:
    {.emit:[
      """
      asm volatile(
        "testq %[ctl], %[ctl]\n"
        "cmovnzq %[y], %[x]\n"
        : [x] "+r" (*""", x, """)
        : [ctl] "r" (""", ctl, """), [y] "r" (""", y, """)
        : "cc"
      );"""].}

let x = 0x1111111'u64
let y = 0xFFFFFFF'u64

block:
  let ctl = 1'u64
  var a0 = x
  ctl.ccopy_x86_asm(a0, y)

  var a1 = x
  ctl.ccopy_x86_emit(a1, y)

  doAssert a0.toHex() == "000000000FFFFFFF"
github-actions[bot] commented 10 months ago
:penguin: Linux bisect by @ringabout (member)
devel :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/temp.nim temp /home/runner/.choosenim/toolchains/nim-#devel/lib/std/assertions.nim failedAssertImpl /home/runner/.choosenim/toolchains/nim-#devel/lib/std/assertions.nim raiseAssert /home/runner/.choosenim/toolchains/nim-#devel/lib/system/fatal.nim sysFatal Error: unhandled exception: /home/runner/work/Nim/Nim/temp.nim(51, 3) `a0.toHex() == "000000000FFFFFFF"` [AssertionDefect] Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp' assertions.nim(34) raiseAssert Error: unhandled exception: errGenerated [AssertionDefect] ```

IR

Compiled filesize 99.98 Kb (102,376 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #include #define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); #define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); #define nimln_(n) \ FR_.line = n; #define nimlf_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_u24)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4666)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_u28)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2); N_LIB_PRIVATE N_NIMCALL(NimStringV2, toHex__temp_u37)(NU64 x_p0); static N_INLINE(NIM_BOOL, eqStrings)(NimStringV2 a_p0, NimStringV2 b_p1); static N_INLINE(NIM_BOOL, equalMem__system_u1733)(void* a_p0, void* b_p1, NI size_p2); static N_INLINE(int, nimCmpMem)(void* a_p0, void* b_p1, NI size_p2); N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u254)(NimStringV2 msg_p0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); static const struct { NI cap; NIM_CHAR data[16+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 16 | NIM_STRLIT_FLAG, "000000000FFFFFFF" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {16, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2}; static const struct { NI cap; NIM_CHAR data[77+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 77 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(51, 3) `a0.toHex() == \"000000000FFFFFFF\"` " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {77, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; N_LIB_PRIVATE NIM_CONST NU64 x__temp_u32 = 17895697ULL; N_LIB_PRIVATE NIM_CONST NU64 y__temp_u33 = 268435455ULL; N_LIB_PRIVATE NIM_CONST NU64 ctl__temp_u34 = 1ULL; N_LIB_PRIVATE NU64 a0__temp_u35; extern NIM_THREADVAR TFrame* framePtr__system_u4053; N_LIB_PRIVATE NU64 a1__temp_u36; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4450; static N_INLINE(void, nimFrame)(TFrame* s_p0) { { if (!(framePtr__system_u4053 == ((TFrame*) NIM_NIL))) goto LA3_; (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { (*s_p0).calldepth = (NI16)((*framePtr__system_u4053).calldepth + ((NI16)1)); } LA1_: ; (*s_p0).prev = framePtr__system_u4053; framePtr__system_u4053 = s_p0; { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4666(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u4053 = (*framePtr__system_u4053).prev; } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_u24)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2) { nimfr_("ccopy_x86_asm", "/home/runner/work/Nim/Nim/temp.nim"); __asm__(" testq %[ctl], %[ctl]\n" " cmovnzq %[y], %[x]\n" : [x] "+r" (x_p1) : [ctl] "r" (ctl_p0), [y] "r" (y_p2) : "cc" ); popFrame(); } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_u28)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2) { nimfr_("ccopy_x86_emit", "/home/runner/work/Nim/Nim/temp.nim"); asm volatile( "testq %[ctl], %[ctl]\n" "cmovnzq %[y], %[x]\n" : [x] "+r" ((*x_p1)) : [ctl] "r" (ctl_p0), [y] "r" (y_p2) : "cc" ); popFrame(); } static N_INLINE(int, nimCmpMem)(void* a_p0, void* b_p1, NI size_p2) { int result; result = memcmp(a_p0, b_p1, ((size_t) (size_p2))); return result; } static N_INLINE(NIM_BOOL, equalMem__system_u1733)(void* a_p0, void* b_p1, NI size_p2) { NIM_BOOL result; int T1_; T1_ = (int)0; T1_ = nimCmpMem(a_p0, b_p1, size_p2); result = (T1_ == ((NI32)0)); return result; } static N_INLINE(NIM_BOOL, eqStrings)(NimStringV2 a_p0, NimStringV2 b_p1) { NIM_BOOL result; NI alen; NI blen; nimfr_("eqStrings", "/home/runner/.choosenim/toolchains/nim-#devel/lib/system/strmantle.nim"); { result = (NIM_BOOL)0; alen = a_p0.len; blen = b_p1.len; { if (!(alen == blen)) goto LA3_; { if (!(alen == ((NI)0))) goto LA7_; result = NIM_TRUE; goto BeforeRet_; } LA7_: ; result = equalMem__system_u1733(((void*) ((&a_p0.p->data[((NI)0)]))), ((void*) ((&b_p1.p->data[((NI)0)]))), ((NI) (alen))); goto BeforeRet_; } LA3_: ; }BeforeRet_: ; popFrame(); return result; } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (&nimInErrorMode__system_u4450); return result; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); nimErr_ = nimErrorFlag(); { NimStringV2 colontmpD_; colontmpD_.len = 0; colontmpD_.p = NIM_NIL; a0__temp_u35 = x__temp_u32; ccopy_x86_asm__temp_u24(ctl__temp_u34, (&a0__temp_u35), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; a1__temp_u36 = x__temp_u32; ccopy_x86_emit__temp_u28(ctl__temp_u34, (&a1__temp_u36), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; { colontmpD_ = toHex__temp_u37(a0__temp_u35); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; if (!!(eqStrings(colontmpD_, TM__SRd76hP9cMfCzdUO857UhQQ_3))) goto LA4_; failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_5); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; } LA4_: ; if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p); } } BeforeRet_: ; nimTestErrorFlag(); popFrame(); } } ```

Stats

  • Started 2023-12-22T03:48:04
  • Finished 2023-12-22T03:48:05
  • Duration 1 minutes

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( newIdentNode("strutils") ), nnkConstSection.newTree( nnkConstDef.newTree( newIdentNode("nim_v2"), newEmptyNode(), nnkInfix.newTree( newIdentNode(">"), nnkTupleConstr.newTree( newIdentNode("NimMajor"), newIdentNode("NimMinor") ), nnkTupleConstr.newTree( newLit(1), newLit(6) ) ) ), nnkConstDef.newTree( newIdentNode("noExplicitVarDeref"), newEmptyNode(), nnkInfix.newTree( newIdentNode("or"), nnkCall.newTree( newIdentNode("defined"), newIdentNode("cpp") ), newIdentNode("nim_v2") ) ) ), nnkFuncDef.newTree( newIdentNode("ccopy_x86_asm"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("ctl"), newIdentNode("uint64"), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), nnkVarTy.newTree( newIdentNode("uint64") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("y"), newIdentNode("uint64"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkWhenStmt.newTree( nnkElifBranch.newTree( newIdentNode("noExplicitVarDeref"), nnkStmtList.newTree( nnkAsmStmt.newTree( newEmptyNode(), newLit(" testq %[ctl], %[ctl]\n cmovnzq %[y], %[x]\n : [x] \"+r\" (`x`)\n : [ctl] \"r\" (`ctl`), [y] \"r\" (`y`)\n : \"cc\"\n ") ) ) ), nnkElse.newTree( nnkStmtList.newTree( nnkAsmStmt.newTree( newEmptyNode(), newLit(" testq %[ctl], %[ctl]\n cmovnzq %[y], %[x]\n : [x] \"+r\" (*`x`)\n : [ctl] \"r\" (`ctl`), [y] \"r\" (`y`)\n : \"cc\"\n ") ) ) ) ) ) ), nnkFuncDef.newTree( newIdentNode("ccopy_x86_emit"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("ctl"), newIdentNode("uint64"), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), nnkVarTy.newTree( newIdentNode("uint64") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("y"), newIdentNode("uint64"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkWhenStmt.newTree( nnkElifBranch.newTree( newIdentNode("noExplicitVarDeref"), nnkStmtList.newTree( nnkPragma.newTree( nnkExprColonExpr.newTree( newIdentNode("emit"), nnkBracket.newTree( newLit(" asm volatile(\n \"testq %[ctl], %[ctl]\\n\"\n \"cmovnzq %[y], %[x]\\n\"\n : [x] \"+r\" ("), newIdentNode("x"), newLit(")\n : [ctl] \"r\" ("), newIdentNode("ctl"), newLit("), [y] \"r\" ("), newIdentNode("y"), newLit(")\n : \"cc\"\n );") ) ) ) ) ), nnkElse.newTree( nnkStmtList.newTree( nnkPragma.newTree( nnkExprColonExpr.newTree( newIdentNode("emit"), nnkBracket.newTree( newLit(" asm volatile(\n \"testq %[ctl], %[ctl]\\n\"\n \"cmovnzq %[y], %[x]\\n\"\n : [x] \"+r\" (*"), newIdentNode("x"), newLit(")\n : [ctl] \"r\" ("), newIdentNode("ctl"), newLit("), [y] \"r\" ("), newIdentNode("y"), newLit(")\n : \"cc\"\n );") ) ) ) ) ) ) ) ), nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("x"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("y"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkBlockStmt.newTree( newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("ctl"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a0"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_asm") ), newIdentNode("a0"), newIdentNode("y") ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a1"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_emit") ), newIdentNode("a1"), newIdentNode("y") ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a0"), newIdentNode("toHex") ) ), newLit("000000000FFFFFFF") ) ) ) ) ) ```
stable :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/temp.nim temp /home/runner/.choosenim/toolchains/nim-2.0.2/lib/std/assertions.nim failedAssertImpl /home/runner/.choosenim/toolchains/nim-2.0.2/lib/std/assertions.nim raiseAssert /home/runner/.choosenim/toolchains/nim-2.0.2/lib/system/fatal.nim sysFatal Error: unhandled exception: /home/runner/work/Nim/Nim/temp.nim(51, 3) `a0.toHex() == "000000000FFFFFFF"` [AssertionDefect] Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp' assertions.nim(34) raiseAssert Error: unhandled exception: options.nim(681, 5) `false` errGenerated [AssertionDefect] ```

IR

Compiled filesize 96.62 Kb (98,936 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #include #define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); #define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); #define nimln_(n) \ FR_.line = n; #define nimlf_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_u24)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4621)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_u28)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2); N_LIB_PRIVATE N_NIMCALL(NimStringV2, toHex__temp_u37)(NU64 x_p0); static N_INLINE(NIM_BOOL, eqStrings)(NimStringV2 a_p0, NimStringV2 b_p1); static N_INLINE(NIM_BOOL, equalMem__system_u1753)(void* a_p0, void* b_p1, NI size_p2); static N_INLINE(int, nimCmpMem)(void* a_p0, void* b_p1, NI size_p2); N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u310)(NimStringV2 msg_p0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); static const struct { NI cap; NIM_CHAR data[16+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 16 | NIM_STRLIT_FLAG, "000000000FFFFFFF" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {16, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2}; static const struct { NI cap; NIM_CHAR data[77+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 77 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(51, 3) `a0.toHex() == \"000000000FFFFFFF\"` " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {77, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; N_LIB_PRIVATE NIM_CONST NU64 x__temp_u32 = 17895697ULL; N_LIB_PRIVATE NIM_CONST NU64 y__temp_u33 = 268435455ULL; N_LIB_PRIVATE NIM_CONST NU64 ctl__temp_u34 = 1ULL; N_LIB_PRIVATE NU64 a0__temp_u35; extern NIM_THREADVAR TFrame* framePtr__system_u4020; N_LIB_PRIVATE NU64 a1__temp_u36; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4403; static N_INLINE(void, nimFrame)(TFrame* s_p0) { { if (!(framePtr__system_u4020 == ((TFrame*) NIM_NIL))) goto LA3_; (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { (*s_p0).calldepth = (NI16)((*framePtr__system_u4020).calldepth + ((NI16)1)); } LA1_: ; (*s_p0).prev = framePtr__system_u4020; framePtr__system_u4020 = s_p0; { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4621(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u4020 = (*framePtr__system_u4020).prev; } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_u24)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2) { nimfr_("ccopy_x86_asm", "/home/runner/work/Nim/Nim/temp.nim"); __asm__(" testq %[ctl], %[ctl]\n" " cmovnzq %[y], %[x]\n" : [x] "+r" (x_p1) : [ctl] "r" (ctl_p0), [y] "r" (y_p2) : "cc" ); popFrame(); } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_u28)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2) { nimfr_("ccopy_x86_emit", "/home/runner/work/Nim/Nim/temp.nim"); asm volatile( "testq %[ctl], %[ctl]\n" "cmovnzq %[y], %[x]\n" : [x] "+r" ((*x_p1)) : [ctl] "r" (ctl_p0), [y] "r" (y_p2) : "cc" ); popFrame(); } static N_INLINE(int, nimCmpMem)(void* a_p0, void* b_p1, NI size_p2) { int result; result = memcmp(a_p0, b_p1, ((size_t) (size_p2))); return result; } static N_INLINE(NIM_BOOL, equalMem__system_u1753)(void* a_p0, void* b_p1, NI size_p2) { NIM_BOOL result; int T1_; T1_ = (int)0; T1_ = nimCmpMem(a_p0, b_p1, size_p2); result = (T1_ == ((NI32)0)); return result; } static N_INLINE(NIM_BOOL, eqStrings)(NimStringV2 a_p0, NimStringV2 b_p1) { NIM_BOOL result; NI alen; NI blen; nimfr_("eqStrings", "/home/runner/.choosenim/toolchains/nim-2.0.2/lib/system/strmantle.nim"); { result = (NIM_BOOL)0; alen = a_p0.len; blen = b_p1.len; { if (!(alen == blen)) goto LA3_; { if (!(alen == ((NI)0))) goto LA7_; result = NIM_TRUE; goto BeforeRet_; } LA7_: ; result = equalMem__system_u1753(((void*) ((&a_p0.p->data[((NI)0)]))), ((void*) ((&b_p1.p->data[((NI)0)]))), ((NI) (alen))); goto BeforeRet_; } LA3_: ; }BeforeRet_: ; popFrame(); return result; } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (&nimInErrorMode__system_u4403); return result; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); nimErr_ = nimErrorFlag(); { NimStringV2 colontmpD_; colontmpD_.len = 0; colontmpD_.p = NIM_NIL; a0__temp_u35 = x__temp_u32; ccopy_x86_asm__temp_u24(ctl__temp_u34, (&a0__temp_u35), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; a1__temp_u36 = x__temp_u32; ccopy_x86_emit__temp_u28(ctl__temp_u34, (&a1__temp_u36), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; { colontmpD_ = toHex__temp_u37(a0__temp_u35); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; if (!!(eqStrings(colontmpD_, TM__SRd76hP9cMfCzdUO857UhQQ_3))) goto LA4_; failedAssertImpl__stdZassertions_u310(TM__SRd76hP9cMfCzdUO857UhQQ_5); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; } LA4_: ; if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p); } } BeforeRet_: ; nimTestErrorFlag(); popFrame(); } } ```

Stats

  • Started 2023-12-22T03:48:06
  • Finished 2023-12-22T03:48:06
  • Duration

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( newIdentNode("strutils") ), nnkConstSection.newTree( nnkConstDef.newTree( newIdentNode("nim_v2"), newEmptyNode(), nnkInfix.newTree( newIdentNode(">"), nnkTupleConstr.newTree( newIdentNode("NimMajor"), newIdentNode("NimMinor") ), nnkTupleConstr.newTree( newLit(1), newLit(6) ) ) ), nnkConstDef.newTree( newIdentNode("noExplicitVarDeref"), newEmptyNode(), nnkInfix.newTree( newIdentNode("or"), nnkCall.newTree( newIdentNode("defined"), newIdentNode("cpp") ), newIdentNode("nim_v2") ) ) ), nnkFuncDef.newTree( newIdentNode("ccopy_x86_asm"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("ctl"), newIdentNode("uint64"), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), nnkVarTy.newTree( newIdentNode("uint64") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("y"), newIdentNode("uint64"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkWhenStmt.newTree( nnkElifBranch.newTree( newIdentNode("noExplicitVarDeref"), nnkStmtList.newTree( nnkAsmStmt.newTree( newEmptyNode(), newLit(" testq %[ctl], %[ctl]\n cmovnzq %[y], %[x]\n : [x] \"+r\" (`x`)\n : [ctl] \"r\" (`ctl`), [y] \"r\" (`y`)\n : \"cc\"\n ") ) ) ), nnkElse.newTree( nnkStmtList.newTree( nnkAsmStmt.newTree( newEmptyNode(), newLit(" testq %[ctl], %[ctl]\n cmovnzq %[y], %[x]\n : [x] \"+r\" (*`x`)\n : [ctl] \"r\" (`ctl`), [y] \"r\" (`y`)\n : \"cc\"\n ") ) ) ) ) ) ), nnkFuncDef.newTree( newIdentNode("ccopy_x86_emit"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("ctl"), newIdentNode("uint64"), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), nnkVarTy.newTree( newIdentNode("uint64") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("y"), newIdentNode("uint64"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkWhenStmt.newTree( nnkElifBranch.newTree( newIdentNode("noExplicitVarDeref"), nnkStmtList.newTree( nnkPragma.newTree( nnkExprColonExpr.newTree( newIdentNode("emit"), nnkBracket.newTree( newLit(" asm volatile(\n \"testq %[ctl], %[ctl]\\n\"\n \"cmovnzq %[y], %[x]\\n\"\n : [x] \"+r\" ("), newIdentNode("x"), newLit(")\n : [ctl] \"r\" ("), newIdentNode("ctl"), newLit("), [y] \"r\" ("), newIdentNode("y"), newLit(")\n : \"cc\"\n );") ) ) ) ) ), nnkElse.newTree( nnkStmtList.newTree( nnkPragma.newTree( nnkExprColonExpr.newTree( newIdentNode("emit"), nnkBracket.newTree( newLit(" asm volatile(\n \"testq %[ctl], %[ctl]\\n\"\n \"cmovnzq %[y], %[x]\\n\"\n : [x] \"+r\" (*"), newIdentNode("x"), newLit(")\n : [ctl] \"r\" ("), newIdentNode("ctl"), newLit("), [y] \"r\" ("), newIdentNode("y"), newLit(")\n : \"cc\"\n );") ) ) ) ) ) ) ) ), nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("x"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("y"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkBlockStmt.newTree( newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("ctl"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a0"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_asm") ), newIdentNode("a0"), newIdentNode("y") ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a1"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_emit") ), newIdentNode("a1"), newIdentNode("y") ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a0"), newIdentNode("toHex") ) ), newLit("000000000FFFFFFF") ) ) ) ) ) ```
2.0.0 :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/temp.nim temp /home/runner/.choosenim/toolchains/nim-2.0.0/lib/std/assertions.nim failedAssertImpl /home/runner/.choosenim/toolchains/nim-2.0.0/lib/std/assertions.nim raiseAssert /home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/fatal.nim sysFatal Error: unhandled exception: /home/runner/work/Nim/Nim/temp.nim(51, 3) `a0.toHex() == "000000000FFFFFFF"` [AssertionDefect] Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp' assertions.nim(34) raiseAssert Error: unhandled exception: options.nim(664, 5) `false` errGenerated [AssertionDefect] ```

IR

Compiled filesize 96.62 Kb (98,936 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #include #define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); #define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); #define nimln_(n) \ FR_.line = n; #define nimlf_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_u24)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4607)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_u28)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2); N_LIB_PRIVATE N_NIMCALL(NimStringV2, toHex__temp_u37)(NU64 x_p0); static N_INLINE(NIM_BOOL, eqStrings)(NimStringV2 a_p0, NimStringV2 b_p1); static N_INLINE(NIM_BOOL, equalMem__system_u1753)(void* a_p0, void* b_p1, NI size_p2); static N_INLINE(int, nimCmpMem)(void* a_p0, void* b_p1, NI size_p2); N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u310)(NimStringV2 msg_p0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); static const struct { NI cap; NIM_CHAR data[16+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 16 | NIM_STRLIT_FLAG, "000000000FFFFFFF" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {16, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2}; static const struct { NI cap; NIM_CHAR data[77+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 77 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(51, 3) `a0.toHex() == \"000000000FFFFFFF\"` " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {77, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; N_LIB_PRIVATE NIM_CONST NU64 x__temp_u32 = 17895697ULL; N_LIB_PRIVATE NIM_CONST NU64 y__temp_u33 = 268435455ULL; N_LIB_PRIVATE NIM_CONST NU64 ctl__temp_u34 = 1ULL; N_LIB_PRIVATE NU64 a0__temp_u35; extern NIM_THREADVAR TFrame* framePtr__system_u4006; N_LIB_PRIVATE NU64 a1__temp_u36; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4389; static N_INLINE(void, nimFrame)(TFrame* s_p0) { { if (!(framePtr__system_u4006 == ((TFrame*) NIM_NIL))) goto LA3_; (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { (*s_p0).calldepth = (NI16)((*framePtr__system_u4006).calldepth + ((NI16)1)); } LA1_: ; (*s_p0).prev = framePtr__system_u4006; framePtr__system_u4006 = s_p0; { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4607(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u4006 = (*framePtr__system_u4006).prev; } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_u24)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2) { nimfr_("ccopy_x86_asm", "/home/runner/work/Nim/Nim/temp.nim"); __asm__(" testq %[ctl], %[ctl]\n" " cmovnzq %[y], %[x]\n" : [x] "+r" (x_p1) : [ctl] "r" (ctl_p0), [y] "r" (y_p2) : "cc" ); popFrame(); } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_u28)(NU64 ctl_p0, NU64* x_p1, NU64 y_p2) { nimfr_("ccopy_x86_emit", "/home/runner/work/Nim/Nim/temp.nim"); asm volatile( "testq %[ctl], %[ctl]\n" "cmovnzq %[y], %[x]\n" : [x] "+r" ((*x_p1)) : [ctl] "r" (ctl_p0), [y] "r" (y_p2) : "cc" ); popFrame(); } static N_INLINE(int, nimCmpMem)(void* a_p0, void* b_p1, NI size_p2) { int result; result = (int)0; result = memcmp(a_p0, b_p1, ((size_t) (size_p2))); return result; } static N_INLINE(NIM_BOOL, equalMem__system_u1753)(void* a_p0, void* b_p1, NI size_p2) { NIM_BOOL result; int T1_; result = (NIM_BOOL)0; T1_ = (int)0; T1_ = nimCmpMem(a_p0, b_p1, size_p2); result = (T1_ == ((NI32)0)); return result; } static N_INLINE(NIM_BOOL, eqStrings)(NimStringV2 a_p0, NimStringV2 b_p1) { NIM_BOOL result; NI alen; NI blen; nimfr_("eqStrings", "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/strmantle.nim"); { result = (NIM_BOOL)0; alen = a_p0.len; blen = b_p1.len; { if (!(alen == blen)) goto LA3_; { if (!(alen == ((NI)0))) goto LA7_; result = NIM_TRUE; goto BeforeRet_; } LA7_: ; result = equalMem__system_u1753(((void*) ((&a_p0.p->data[((NI)0)]))), ((void*) ((&b_p1.p->data[((NI)0)]))), ((NI) (alen))); goto BeforeRet_; } LA3_: ; }BeforeRet_: ; popFrame(); return result; } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (NIM_BOOL*)0; result = (&nimInErrorMode__system_u4389); return result; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); nimErr_ = nimErrorFlag(); { NimStringV2 colontmpD_; colontmpD_.len = 0; colontmpD_.p = NIM_NIL; a0__temp_u35 = x__temp_u32; ccopy_x86_asm__temp_u24(ctl__temp_u34, (&a0__temp_u35), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; a1__temp_u36 = x__temp_u32; ccopy_x86_emit__temp_u28(ctl__temp_u34, (&a1__temp_u36), y__temp_u33); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; { colontmpD_ = toHex__temp_u37(a0__temp_u35); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; if (!!(eqStrings(colontmpD_, TM__SRd76hP9cMfCzdUO857UhQQ_3))) goto LA4_; failedAssertImpl__stdZassertions_u310(TM__SRd76hP9cMfCzdUO857UhQQ_5); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; } LA4_: ; if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p); } } BeforeRet_: ; nimTestErrorFlag(); popFrame(); } } ```

Stats

  • Started 2023-12-22T03:48:10
  • Finished 2023-12-22T03:48:10
  • Duration

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( newIdentNode("strutils") ), nnkConstSection.newTree( nnkConstDef.newTree( newIdentNode("nim_v2"), newEmptyNode(), nnkInfix.newTree( newIdentNode(">"), nnkTupleConstr.newTree( newIdentNode("NimMajor"), newIdentNode("NimMinor") ), nnkTupleConstr.newTree( newLit(1), newLit(6) ) ) ), nnkConstDef.newTree( newIdentNode("noExplicitVarDeref"), newEmptyNode(), nnkInfix.newTree( newIdentNode("or"), nnkCall.newTree( newIdentNode("defined"), newIdentNode("cpp") ), newIdentNode("nim_v2") ) ) ), nnkFuncDef.newTree( newIdentNode("ccopy_x86_asm"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("ctl"), newIdentNode("uint64"), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), nnkVarTy.newTree( newIdentNode("uint64") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("y"), newIdentNode("uint64"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkWhenStmt.newTree( nnkElifBranch.newTree( newIdentNode("noExplicitVarDeref"), nnkStmtList.newTree( nnkAsmStmt.newTree( newEmptyNode(), newLit(" testq %[ctl], %[ctl]\n cmovnzq %[y], %[x]\n : [x] \"+r\" (`x`)\n : [ctl] \"r\" (`ctl`), [y] \"r\" (`y`)\n : \"cc\"\n ") ) ) ), nnkElse.newTree( nnkStmtList.newTree( nnkAsmStmt.newTree( newEmptyNode(), newLit(" testq %[ctl], %[ctl]\n cmovnzq %[y], %[x]\n : [x] \"+r\" (*`x`)\n : [ctl] \"r\" (`ctl`), [y] \"r\" (`y`)\n : \"cc\"\n ") ) ) ) ) ) ), nnkFuncDef.newTree( newIdentNode("ccopy_x86_emit"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("ctl"), newIdentNode("uint64"), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), nnkVarTy.newTree( newIdentNode("uint64") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("y"), newIdentNode("uint64"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkWhenStmt.newTree( nnkElifBranch.newTree( newIdentNode("noExplicitVarDeref"), nnkStmtList.newTree( nnkPragma.newTree( nnkExprColonExpr.newTree( newIdentNode("emit"), nnkBracket.newTree( newLit(" asm volatile(\n \"testq %[ctl], %[ctl]\\n\"\n \"cmovnzq %[y], %[x]\\n\"\n : [x] \"+r\" ("), newIdentNode("x"), newLit(")\n : [ctl] \"r\" ("), newIdentNode("ctl"), newLit("), [y] \"r\" ("), newIdentNode("y"), newLit(")\n : \"cc\"\n );") ) ) ) ) ), nnkElse.newTree( nnkStmtList.newTree( nnkPragma.newTree( nnkExprColonExpr.newTree( newIdentNode("emit"), nnkBracket.newTree( newLit(" asm volatile(\n \"testq %[ctl], %[ctl]\\n\"\n \"cmovnzq %[y], %[x]\\n\"\n : [x] \"+r\" (*"), newIdentNode("x"), newLit(")\n : [ctl] \"r\" ("), newIdentNode("ctl"), newLit("), [y] \"r\" ("), newIdentNode("y"), newLit(")\n : \"cc\"\n );") ) ) ) ) ) ) ) ), nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("x"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("y"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkBlockStmt.newTree( newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("ctl"), newEmptyNode(), nnkUInt64Lit.newTree( ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a0"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_asm") ), newIdentNode("a0"), newIdentNode("y") ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("a1"), newEmptyNode(), newIdentNode("x") ) ), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("ctl"), newIdentNode("ccopy_x86_emit") ), newIdentNode("a1"), newIdentNode("y") ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), nnkCall.newTree( nnkDotExpr.newTree( newIdentNode("a0"), newIdentNode("toHex") ) ), newLit("000000000FFFFFFF") ) ) ) ) ) ```
1.6.14 :+1: OK

Output

``` ```

IR

Compiled filesize 100.62 Kb (103,032 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #include # define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); # define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); # define nimln_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct NimStringDesc NimStringDesc; typedef struct TGenericSeq TGenericSeq; struct TGenericSeq { NI len; NI reserved; }; struct NimStringDesc { TGenericSeq Sup; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_24)(NU64 ctl, NU64* x, NU64 y); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_2997)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_28)(NU64 ctl, NU64* x, NU64 y); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHex__temp_37)(NU64 x); static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b); static N_INLINE(NIM_BOOL, equalMem__system_1741)(void* a, void* b, NI size); static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size); N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__systemZassertions_56)(NimStringDesc* msg); static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "000000000FFFFFFF", 16); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_3, "/home/runner/work/Nim/Nim/temp.nim(51, 12) `a0.toHex() == \"000000000FFFFFFF\"` ", 78); N_LIB_PRIVATE NIM_CONST NU64 x__temp_32 = 17895697ULL; N_LIB_PRIVATE NIM_CONST NU64 y__temp_33 = 268435455ULL; N_LIB_PRIVATE NIM_CONST NU64 ctl__temp_34 = 1ULL; N_LIB_PRIVATE NU64 a0__temp_35; extern TFrame* framePtr__system_2564; extern TFrame* framePtr__system_2564; extern TFrame* framePtr__system_2564; extern TFrame* framePtr__system_2564; extern TFrame* framePtr__system_2564; extern TFrame* framePtr__system_2564; N_LIB_PRIVATE NU64 a1__temp_36; static N_INLINE(void, nimFrame)(TFrame* s) { { if (!(framePtr__system_2564 == ((TFrame*) NIM_NIL))) goto LA3_; (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { (*s).calldepth = (NI16)((*framePtr__system_2564).calldepth + ((NI16) 1)); } LA1_: ; (*s).prev = framePtr__system_2564; framePtr__system_2564 = s; { if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; callDepthLimitReached__system_2997(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_2564 = (*framePtr__system_2564).prev; } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__temp_24)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_asm", "/home/runner/work/Nim/Nim/temp.nim"); asm(" testq %[ctl], %[ctl]\n" " cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__temp_28)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_emit", "/home/runner/work/Nim/Nim/temp.nim"); asm volatile( "testq %[ctl], %[ctl]\n" "cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size) { int result; result = (int)0; result = memcmp(a, b, ((size_t) (size))); return result; } static N_INLINE(NIM_BOOL, equalMem__system_1741)(void* a, void* b, NI size) { NIM_BOOL result; int T1_; result = (NIM_BOOL)0; T1_ = (int)0; T1_ = nimCmpMem(a, b, size); result = (T1_ == ((NI32) 0)); return result; } static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) { NIM_BOOL result; NI alen; NI blen; nimfr_("eqStrings", "/home/runner/.choosenim/toolchains/nim-1.6.14/lib/system/strmantle.nim"); { result = (NIM_BOOL)0; alen = (a ? a->Sup.len : 0); blen = (b ? b->Sup.len : 0); { if (!(alen == blen)) goto LA3_; { if (!(alen == ((NI) 0))) goto LA7_; result = NIM_TRUE; goto BeforeRet_; } LA7_: ; result = equalMem__system_1741(((void*) ((&a->data[((NI) 0)]))), ((void*) ((&b->data[((NI) 0)]))), ((NI) (alen))); goto BeforeRet_; } LA3_: ; }BeforeRet_: ; popFrame(); return result; } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000(); initStackBottomWith((void *)&inner); atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_Init000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); { a0__temp_35 = x__temp_32; ccopy_x86_asm__temp_24(ctl__temp_34, (&a0__temp_35), y__temp_33); a1__temp_36 = x__temp_32; ccopy_x86_emit__temp_28(ctl__temp_34, (&a1__temp_36), y__temp_33); { NimStringDesc* T4_; T4_ = NIM_NIL; T4_ = toHex__temp_37(a0__temp_35); if (!!(eqStrings(T4_, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)))) goto LA5_; failedAssertImpl__systemZassertions_56(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3)); } LA5_: ; } popFrame(); } } ```

Stats

  • Started 2023-12-22T03:48:14
  • Finished 2023-12-22T03:48:15
  • Duration
1.4.8 :+1: OK

Output

``` ```

IR

Compiled filesize 97.00 Kb (99,328 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #include # define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); # define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); # define nimln_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct NimStringDesc NimStringDesc; typedef struct TGenericSeq TGenericSeq; struct TGenericSeq { NI len; NI reserved; }; struct NimStringDesc { TGenericSeq Sup; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA)(NU64 ctl, NU64* x, NU64 y); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2)(NU64 ctl, NU64* x, NU64 y); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHex__ziyYRZOkaJBp9bZAA9cVEV2w)(NU64 x); static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b); static N_INLINE(NIM_BOOL, equalMem__9bGgqEk7RXXl6eqM9c1HdELAsystem)(void* a, void* b, NI size); static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size); N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg); static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "000000000FFFFFFF", 16); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_3, "/home/runner/work/Nim/Nim/temp.nim(51, 12) `a0.toHex() == \"0000" "00000FFFFFFF\"` ", 78); N_LIB_PRIVATE NIM_CONST NU64 x__FnxVSC5bS7DK6G1Il7xEdA = 17895697ULL; N_LIB_PRIVATE NIM_CONST NU64 y__rwOCXhIhi2LrRBPlMOIWhw = 268435455ULL; N_LIB_PRIVATE NIM_CONST NU64 ctl__NL0IzIt8we01iibZH8sP2g = 1ULL; N_LIB_PRIVATE NU64 a0__1IWVHqRwgtaDJCcYlJCS5g; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; N_LIB_PRIVATE NU64 a1__CwkjfgqjsBxJeTo1RhU0fw; static N_INLINE(void, nimFrame)(TFrame* s) { { if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == ((TFrame*) NIM_NIL))) goto LA3_; (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { (*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1)); } LA1_: ; (*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s; { if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev; } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_asm", "/home/runner/work/Nim/Nim/temp.nim"); asm(" testq %[ctl], %[ctl]\n" " cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_emit", "/home/runner/work/Nim/Nim/temp.nim"); asm volatile( "testq %[ctl], %[ctl]\n" "cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size) { int result; result = (int)0; result = memcmp(a, b, ((size_t) (size))); return result; } static N_INLINE(NIM_BOOL, equalMem__9bGgqEk7RXXl6eqM9c1HdELAsystem)(void* a, void* b, NI size) { NIM_BOOL result; int T1_; result = (NIM_BOOL)0; T1_ = (int)0; T1_ = nimCmpMem(a, b, size); result = (T1_ == ((NI32) 0)); return result; } static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) { NIM_BOOL result; NI alen; NI blen; nimfr_("eqStrings", "/home/runner/.choosenim/toolchains/nim-1.4.8/lib/system/strmant" "le.nim"); { result = (NIM_BOOL)0; alen = (a ? a->Sup.len : 0); blen = (b ? b->Sup.len : 0); { if (!(alen == blen)) goto LA3_; { if (!(alen == ((NI) 0))) goto LA7_; result = NIM_TRUE; goto BeforeRet_; } LA7_: ; result = equalMem__9bGgqEk7RXXl6eqM9c1HdELAsystem(((void*) ((&a->data[((NI) 0)]))), ((void*) ((&b->data[((NI) 0)]))), ((NI) (alen))); goto BeforeRet_; } LA3_: ; }BeforeRet_: ; popFrame(); return result; } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); { a0__1IWVHqRwgtaDJCcYlJCS5g = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA(ctl__NL0IzIt8we01iibZH8sP2g, (&a0__1IWVHqRwgtaDJCcYlJCS5g), y__rwOCXhIhi2LrRBPlMOIWhw); a1__CwkjfgqjsBxJeTo1RhU0fw = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2(ctl__NL0IzIt8we01iibZH8sP2g, (&a1__CwkjfgqjsBxJeTo1RhU0fw), y__rwOCXhIhi2LrRBPlMOIWhw); { NimStringDesc* T4_; T4_ = (NimStringDesc*)0; T4_ = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a0__1IWVHqRwgtaDJCcYlJCS5g); if (!!(eqStrings(T4_, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)))) goto LA5_; failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3)); } LA5_: ; } popFrame(); } } ```

Stats

  • Started 2023-12-22T03:48:17
  • Finished 2023-12-22T03:48:18
  • Duration
1.2.18 :+1: OK

Output

``` ```

IR

Compiled filesize 92.73 Kb (94,952 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #include # define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); # define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); # define nimln_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct NimStringDesc NimStringDesc; typedef struct TGenericSeq TGenericSeq; struct TGenericSeq { NI len; NI reserved; }; struct NimStringDesc { TGenericSeq Sup; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA)(NU64 ctl, NU64* x, NU64 y); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2)(NU64 ctl, NU64* x, NU64 y); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHex__ziyYRZOkaJBp9bZAA9cVEV2w)(NU64 x); static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b); static N_INLINE(NIM_BOOL, equalMem__9bGgqEk7RXXl6eqM9c1HdELAsystem)(void* a, void* b, NI size); static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size); N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg); static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "000000000FFFFFFF", 16); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_3, "/home/runner/work/Nim/Nim/temp.nim(51, 12) `a0.toHex() == \"0000" "00000FFFFFFF\"` ", 78); N_LIB_PRIVATE NIM_CONST NU64 x__FnxVSC5bS7DK6G1Il7xEdA = 17895697ULL; N_LIB_PRIVATE NIM_CONST NU64 y__rwOCXhIhi2LrRBPlMOIWhw = 268435455ULL; N_LIB_PRIVATE NIM_CONST NU64 ctl__NL0IzIt8we01iibZH8sP2g = 1ULL; N_LIB_PRIVATE NU64 a0__1IWVHqRwgtaDJCcYlJCS5g; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; N_LIB_PRIVATE NU64 a1__CwkjfgqjsBxJeTo1RhU0fw; static N_INLINE(void, nimFrame)(TFrame* s) { { if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_; (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { (*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1)); } LA1_: ; (*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s; { if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA8_; callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev; } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_asm", "/home/runner/work/Nim/Nim/temp.nim"); asm(" testq %[ctl], %[ctl]\n" " cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_emit", "/home/runner/work/Nim/Nim/temp.nim"); asm volatile( "testq %[ctl], %[ctl]\n" "cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size) { int result; result = (int)0; result = memcmp(a, b, ((size_t) (size))); return result; } static N_INLINE(NIM_BOOL, equalMem__9bGgqEk7RXXl6eqM9c1HdELAsystem)(void* a, void* b, NI size) { NIM_BOOL result; int T1_; result = (NIM_BOOL)0; T1_ = (int)0; T1_ = nimCmpMem(a, b, size); result = (T1_ == ((NI32) 0)); return result; } static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) { NIM_BOOL result; NI alen; NI blen; nimfr_("eqStrings", "/home/runner/.choosenim/toolchains/nim-1.2.18/lib/system/strman" "tle.nim"); { result = (NIM_BOOL)0; alen = (a ? a->Sup.len : 0); blen = (b ? b->Sup.len : 0); { if (!(alen == blen)) goto LA3_; { if (!(alen == ((NI) 0))) goto LA7_; result = NIM_TRUE; goto BeforeRet_; } LA7_: ; result = equalMem__9bGgqEk7RXXl6eqM9c1HdELAsystem(((void*) ((&a->data[((NI) 0)]))), ((void*) ((&b->data[((NI) 0)]))), ((NI) (alen))); goto BeforeRet_; } LA3_: ; }BeforeRet_: ; popFrame(); return result; } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); { a0__1IWVHqRwgtaDJCcYlJCS5g = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA(ctl__NL0IzIt8we01iibZH8sP2g, (&a0__1IWVHqRwgtaDJCcYlJCS5g), y__rwOCXhIhi2LrRBPlMOIWhw); a1__CwkjfgqjsBxJeTo1RhU0fw = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2(ctl__NL0IzIt8we01iibZH8sP2g, (&a1__CwkjfgqjsBxJeTo1RhU0fw), y__rwOCXhIhi2LrRBPlMOIWhw); { NimStringDesc* T4_; T4_ = NIM_NIL; T4_ = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a0__1IWVHqRwgtaDJCcYlJCS5g); if (!!(eqStrings(T4_, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)))) goto LA5_; failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3)); } LA5_: ; } popFrame(); } } ```

Stats

  • Started 2023-12-22T03:48:21
  • Finished 2023-12-22T03:48:22
  • Duration
1.0.10 :+1: OK

Output

``` ```

IR

Compiled filesize 92.19 Kb (94,400 bytes) ```cpp #define NIM_INTBITS 64 #include "nimbase.h" #include # define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); # define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); # define nimln_(n, file) \ FR_.line = n; FR_.filename = file; typedef struct NimStringDesc NimStringDesc; typedef struct TGenericSeq TGenericSeq; struct TGenericSeq { NI len; NI reserved; }; struct NimStringDesc { TGenericSeq Sup; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA)(NU64 ctl, NU64* x, NU64 y); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2)(NU64 ctl, NU64* x, NU64 y); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHex__ziyYRZOkaJBp9bZAA9cVEV2w)(NU64 x); static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b); static N_INLINE(NIM_BOOL, equalMem__9bGgqEk7RXXl6eqM9c1HdELAsystem)(void* a, void* b, NI size); static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size); N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg); static N_INLINE(void, initStackBottomWith)(void* locals); N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); NU64 x__FnxVSC5bS7DK6G1Il7xEdA; NU64 y__rwOCXhIhi2LrRBPlMOIWhw; NU64 ctl__NL0IzIt8we01iibZH8sP2g; NU64 a0__1IWVHqRwgtaDJCcYlJCS5g; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; NU64 a1__CwkjfgqjsBxJeTo1RhU0fw; STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "000000000FFFFFFF", 16); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_3, "/home/runner/work/Nim/Nim/temp.nim(51, 12) `a0.toHex() == \"0000" "00000FFFFFFF\"` ", 78); static N_INLINE(void, nimFrame)(TFrame* s) { NI T1_; T1_ = (NI)0; { if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA4_; T1_ = ((NI) 0); } goto LA2_; LA4_: ; { T1_ = ((NI) ((NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1)))); } LA2_: ; (*s).calldepth = ((NI16) (T1_)); (*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s; { if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA9_; callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw(); } LA9_: ; } static N_INLINE(void, popFrame)(void) { framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev; } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_asm", "/home/runner/work/Nim/Nim/temp.nim"); asm(" testq %[ctl], %[ctl]\n" " cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } N_LIB_PRIVATE N_NIMCALL(void, ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2)(NU64 ctl, NU64* x, NU64 y) { nimfr_("ccopy_x86_emit", "/home/runner/work/Nim/Nim/temp.nim"); asm volatile( "testq %[ctl], %[ctl]\n" "cmovnzq %[y], %[x]\n" : [x] "+r" (*x) : [ctl] "r" (ctl), [y] "r" (y) : "cc" ); popFrame(); } static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size) { int result; result = (int)0; result = memcmp(a, b, ((size_t) (size))); return result; } static N_INLINE(NIM_BOOL, equalMem__9bGgqEk7RXXl6eqM9c1HdELAsystem)(void* a, void* b, NI size) { NIM_BOOL result; int T1_; result = (NIM_BOOL)0; T1_ = (int)0; T1_ = nimCmpMem(a, b, size); result = (T1_ == ((NI32) 0)); return result; } static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) { NIM_BOOL result; NI alen; NI blen; nimfr_("eqStrings", "/home/runner/.choosenim/toolchains/nim-1.0.10/lib/system/strman" "tle.nim"); { result = (NIM_BOOL)0; alen = (a ? a->Sup.len : 0); blen = (b ? b->Sup.len : 0); { if (!(alen == blen)) goto LA3_; { if (!(alen == ((NI) 0))) goto LA7_; result = NIM_TRUE; goto BeforeRet_; } LA7_: ; result = equalMem__9bGgqEk7RXXl6eqM9c1HdELAsystem(((void*) ((&a->data[((NI) 0)]))), ((void*) ((&b->data[((NI) 0)]))), ((NI) (alen))); goto BeforeRet_; } LA3_: ; }BeforeRet_: ; popFrame(); return result; } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } void PreMainInner(void) { } int cmdCount; char** cmdLine; char** gEnv; void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); x__FnxVSC5bS7DK6G1Il7xEdA = 17895697ULL; y__rwOCXhIhi2LrRBPlMOIWhw = 268435455ULL; { ctl__NL0IzIt8we01iibZH8sP2g = 1ULL; a0__1IWVHqRwgtaDJCcYlJCS5g = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_asm__MLAfiwDNM5pdyAzOrkxksA(ctl__NL0IzIt8we01iibZH8sP2g, (&a0__1IWVHqRwgtaDJCcYlJCS5g), y__rwOCXhIhi2LrRBPlMOIWhw); a1__CwkjfgqjsBxJeTo1RhU0fw = x__FnxVSC5bS7DK6G1Il7xEdA; ccopy_x86_emit__MLAfiwDNM5pdyAzOrkxksA_2(ctl__NL0IzIt8we01iibZH8sP2g, (&a1__CwkjfgqjsBxJeTo1RhU0fw), y__rwOCXhIhi2LrRBPlMOIWhw); { NimStringDesc* T4_; T4_ = (NimStringDesc*)0; T4_ = toHex__ziyYRZOkaJBp9bZAA9cVEV2w(a0__1IWVHqRwgtaDJCcYlJCS5g); if (!!(eqStrings(T4_, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)))) goto LA5_; failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3)); } LA5_: ; } popFrame(); } } ```

Stats

  • Started 2023-12-22T03:48:24
  • Finished 2023-12-22T03:48:24
  • Duration
??? :arrow_right: :bug:

Diagnostics

The commit that introduced the bug can not be found, but the bug is in the commits: (Can not find the commit because Nim can not be re-built commit-by-commit to bisect).
Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 19.0
  • Created 2023-12-22T03:47:30Z
  • Comments 5
  • Commands nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim

:robot: Bug found in 22 minutes bisecting 2008 commits at 89 commits per second