[Bug 207] _d_throw is not treated as `noreturn`.

Artur Skawina via D.gnu d.gnu at puremagic.com
Sat Jan 9 10:23:09 PST 2016


On 01/09/16 16:09,  via D.gnu wrote:
>  Iain Buclaw <mailto:ibuclaw at gdcproject.org>  changed bug 207 <http://bugzilla.gdcproject.org/show_bug.cgi?id=207>
> What 	Removed 	Added
> Status 	NEW 	RESOLVED
> Resolution 	--- 	FIXED
> 
> *Comment # 8 <http://bugzilla.gdcproject.org/show_bug.cgi?id=207#c8> on bug 207 <http://bugzilla.gdcproject.org/show_bug.cgi?id=207> from Iain Buclaw <mailto:ibuclaw at gdcproject.org> *
> 
> Should be fixed here:
> https://github.com/D-Programming-GDC/GDC/commit/7244b1c2a2c8b0bc137755b56be2cea93f7ec922

Confirmed. The initial testcase looked like this morning:

0000000000403e40 <_Dmain>:
  403e40:       53                      push   %rbx
  403e41:       89 fb                   mov    %edi,%ebx
  403e43:       01 fb                   add    %edi,%ebx
  403e45:       70 14                   jo     403e5b <_Dmain+0x1b>
  403e47:       81 eb 00 00 00 80       sub    $0x80000000,%ebx
  403e4d:       0f 90 c0                seto   %al
  403e50:       0f b6 d0                movzbl %al,%edx
  403e53:       85 d2                   test   %edx,%edx
  403e55:       75 29                   jne    403e80 <_Dmain+0x40>
  403e57:       89 d8                   mov    %ebx,%eax
  403e59:       5b                      pop    %rbx
  403e5a:       c3                      retq   
  403e5b:       bf a0 39 45 00          mov    $0x4539a0,%edi
  403e60:       e8 9b e5 00 00          callq  412400 <_d_throw>
  403e65:       89 d9                   mov    %ebx,%ecx
  403e67:       31 f6                   xor    %esi,%esi
  403e69:       81 e9 00 00 00 80       sub    $0x80000000,%ecx
  403e6f:       40 0f 90 c6             seto   %sil
  403e73:       89 cb                   mov    %ecx,%ebx
  403e75:       85 f6                   test   %esi,%esi
  403e77:       74 11                   je     403e8a <_Dmain+0x4a>
  403e79:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)
  403e80:       bf a0 39 45 00          mov    $0x4539a0,%edi
  403e85:       e8 76 e5 00 00          callq  412400 <_d_throw>
  403e8a:       89 d8                   mov    %ebx,%eax
  403e8c:       5b                      pop    %rbx
  403e8d:       c3                      retq   

and now, with the only difference being a new gdc build w/ that commit
(cherry-picked onto gcc5 branch), has changed to this:

0000000000413530 <_Dmain>:
  413530:       48 83 ec 08             sub    $0x8,%rsp
  413534:       01 ff                   add    %edi,%edi
  413536:       70 0e                   jo     413546 <_Dmain+0x16>
  413538:       89 f8                   mov    %edi,%eax
  41353a:       2d 00 00 00 80          sub    $0x80000000,%eax
  41353f:       70 05                   jo     413546 <_Dmain+0x16>
  413541:       48 83 c4 08             add    $0x8,%rsp
  413545:       c3                      retq   
  413546:       bf e0 f7 44 00          mov    $0x44f7e0,%edi
  41354b:       e8 60 de 00 00          callq  4213b0 <_d_throw>

[Which is the same code as w/ the trailing __builtin_unreachable().]


Thanks.

artur


More information about the D.gnu mailing list