| Thread overview | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
May 15, 2015 [Issue 14587] DMD 2.067.1 generating crashing binary on OSX | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14587 Steven Schveighoffer <schveiguy@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |schveiguy@yahoo.com --- Comment #1 from Steven Schveighoffer <schveiguy@yahoo.com> --- A reduced version: struct Card { int value; int suit; } void foo(Card card) { switch(card.value) { case 4: case 5: case 6: case 11: break; default: } } void main() { auto card = Card(11, 1); foo(card); } Changing anything at this point seems to make it run properly. -- | ||||
May 15, 2015 [Issue 14587] DMD 2.067.1 generating crashing binary on OSX | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14587 --- Comment #2 from Rob Pieké <robpieke@mail.com> --- Thanks for reducing it Steven! I also did a bit more leg-work. It could be coincidence, but the code seems to work in DMD 2.063.2 and below and fails in 2.064 and above. Not only OSX. Linux (64-bit) at a minimum as well. -- | ||||
May 15, 2015 [Issue 14587] DMD 2.067.1 generating crashing binary on OSX | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14587 Marc Schütz <schuetzm@gmx.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |schuetzm@gmx.net --- Comment #3 from Marc Schütz <schuetzm@gmx.net> --- FWIW, I can reproduce it with DMD master on Linux x86_64. Interestingly, compiling with debug info makes the SEGV go away. -- | ||||
May 15, 2015 [Issue 14587] DMD 2.067.1 generating crashing binary on OSX | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14587 Marc Schütz <schuetzm@gmx.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code OS|Mac OS X |All --- Comment #4 from Marc Schütz <schuetzm@gmx.net> --- It crashes upon entering the jump table: (gdb) disas Dump of assembler code for function _D2xx3fooFS2xx4CardZv: 0x000000000041c7b0 <+0>: push %rbp 0x000000000041c7b1 <+1>: mov %rsp,%rbp 0x000000000041c7b4 <+4>: sub $0x10,%rsp 0x000000000041c7b8 <+8>: mov %rdi,-0x8(%rbp) 0x000000000041c7bc <+12>: cmp $0xb,%edi 0x000000000041c7bf <+15>: ja 0x41c7c8 <_D2xx3fooFS2xx4CardZv+24> => 0x000000000041c7c1 <+17>: jmpq *0x4374f8(,%rdi,8) 0x000000000041c7c8 <+24>: leaveq 0x000000000041c7c9 <+25>: retq (gdb) print $edi $1 = 11 (gdb) print $rdi $2 = 4294967307 As you can see, %edi contains the correct offset, but it uses %rdi as an index. Most likely a bug in the code generator. -- | ||||
May 15, 2015 [Issue 14587] DMD 2.067.1 generating crashing binary on OSX | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14587 Steven Schveighoffer <schveiguy@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |regression -- | ||||
May 17, 2015 [Issue 14587] DMD 2.067.1 generating crashing binary on OSX | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14587 Vladimir Panteleev <thecybershadow@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |thecybershadow@gmail.com --- Comment #5 from Vladimir Panteleev <thecybershadow@gmail.com> --- Introduced in https://github.com/D-Programming-Language/dmd/pull/2315 -- | ||||
May 18, 2015 [Issue 14587] DMD 2.067.1 generating crashing binary on OSX | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14587 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@digitalmars.com Version|unspecified |D1 & D2 --- Comment #6 from Walter Bright <bugzilla@digitalmars.com> --- Great job, everyone, in tracking this one down. You guys have nailed it. It's critical. I'll work on a fix. -- | ||||
May 18, 2015 [Issue 14587] generated 64 bit code for switch jump tables is wrong | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14587 --- Comment #7 from Walter Bright <bugzilla@digitalmars.com> --- https://github.com/D-Programming-Language/dmd/pull/4666 -- | ||||
May 18, 2015 [Issue 14587] generated 64 bit code for switch jump tables is wrong | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14587 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|DMD 2.067.1 generating |generated 64 bit code for |crashing binary on OSX |switch jump tables is wrong -- | ||||
May 18, 2015 [Issue 14587] generated 64 bit code for switch jump tables is wrong | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14587 --- Comment #8 from github-bugzilla@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/4f779561f89e12ff45e30996ad3c8217eb7522e2 fix Issue 14587 - DMD 2.067.1 generating crashing binary on OSX https://github.com/D-Programming-Language/dmd/commit/a7d1edb3c17282994c53fdc797dc3d15f3919d68 Merge pull request #4666 from WalterBright/fix14587 fix Issue 14587 - generated 64 bit code for switch jump tables is wrong -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply