[Issue 22372] Loop index incorrectly optimised out for -release -O
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Oct 9 22:10:33 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22372
Iain Buclaw <ibuclaw at gdcproject.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ibuclaw at gdcproject.org
--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to Teodor Dutu from comment #1)
> However, I came across this bug when working on this PR:
> https://github.com/dlang/dmd/pull/13116. And when analysing the CI outputs,
> I noticed that all 3 of DMD, LDC and GDC are failing the same test, which
> I've also been able to reproduce myself:
> - LDC: https://cirrus-ci.com/task/6291197929979904?logs=test_druntime#L1449
> - DMD: https://cirrus-ci.com/task/5728247976558592?logs=test_druntime#L1390
> - GDC: https://cirrus-ci.com/task/4883823046426624?logs=test_druntime#L1411
>
> The failure of this test is caused by the issue I mentioned above and the
> code with which I reproduced the bug is based on it.
There is no bug in GDC or LDC.
$ gdc -O2 -frelease pr22372.d && ./a.out
Exception: i = 1; n = 1
$ ldc2 -O -release pr22372.d && ./pr22732
Exception: i = 1; n = 1
$ dmd -O -release pr22372.d && ./pr22732
Exception: i = 0; n = 1
--
More information about the Digitalmars-d-bugs
mailing list