https://issues.dlang.org/show_bug.cgi?id=20363
ag0aep6g <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code CC| |[email protected] Blocks| |18750 --- Comment #1 from ag0aep6g <[email protected]> --- Seems to be (yet another) bug related to the `bt` instruction. Smaller test case: ---- ulong test(double d) { ulong u = * cast(ulong*) &d; return (u >> 1) & 1; } void main() { ulong u = 0b10; if (test(* cast(double*) &u) == 0) assert(false); /* fails with -O */ } ---- The generated code for `test`: ---- 0: 48 0f ba e0 01 bt rax,0x1 5: 19 c0 sbb eax,eax 7: f7 d8 neg eax 9: c3 ret ---- It misses code that fills `rax`. Referenced Issues: https://issues.dlang.org/show_bug.cgi?id=18750 [Issue 18750] [Tracker] everything wrong with code generation for bt instruction --
