www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20739] New: SIGFPE in optimized compile of long.min/-1L

https://issues.dlang.org/show_bug.cgi?id=20739

          Issue ID: 20739
           Summary: SIGFPE in optimized compile of long.min/-1L
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: kdevel vogtner.de

$ dmd --version
DMD64 D Compiler v2.090.1
Copyright (C) 1999-2019 by The D Language Foundation, All Rights Reserved
written by Walter Bright


```minbyminusone.d
void main ()
{
   version (X86_64) {
      auto a = long.min;
      auto b = -1;
      auto c = a / b;
   }
   else {
      pragma (msg, "untested processor/os");
   }
}
```


$ gdb [...]dmd
[...]
(gdb) r -O minbyminusone
Starting program: [...]dmd -O minbyminusone
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGFPE, Arithmetic exception.
0x00000000008b2c2e in evalu8(elem*, unsigned int) ()
(gdb) bt


























--
Apr 15