[Issue 12503] New: Bad optimization with scope(success) and return statement
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Apr 1 10:28:16 PDT 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12503
Summary: Bad optimization with scope(success) and return
statement
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: ice, wrong-code
Severity: critical
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: thecybershadow at gmail.com
--- Comment #0 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-04-01 20:28:04 EEST ---
//////////// test.d ///////////
void check(string a, string b)
{
assert(a != b);
}
void fun(string a)
{
auto b = a;
scope(success) check(a, b);
a = null;
return;
}
void main()
{
fun("foo");
}
///////////////////////////////
When compiled with -O, the assert fails. (a still has the same value as b).
When compiled with -m64, the compiler ICEs:
Internal error: ..\ztc\cgobj.c 1479
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list