Bug 6997 – 64bit optimizer bug

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2011-11-23T13:21:00Z
Last change time
2011-11-24T13:58:08Z
Keywords
wrong-code
Assigned to
nobody
Creator
timon.gehr

Comments

Comment #0 by timon.gehr — 2011-11-23T13:21:40Z
long fun(long a,long b,long c){ return a<b?a<c?a:b<c?b:c:b; } long baz(long a, long b){ bool s=(a<0)!=(b<0); a = a>0?a:-a; return s ? a : a; } struct R{ ulong bar, qux; bool c; R foo(){ if(!c){ long a = baz(bar, 0), b = baz(bar, 0), c = baz(bar, 0); return R(fun(a,b,c), fun(a,b,c)); } return R(); } } void main(){auto x=R().foo();} when compiled with dmd -O -release -inline (64bit), the program fails with a segfault during runtime on my machine. Removing any of the flags makes it run through.
Comment #1 by code — 2011-11-23T19:12:29Z
Comment #2 by bugzilla — 2011-11-24T13:58:08Z