Thread overview
[Issue 20143] ICE in optimizer on real 0/0 returned as double
Aug 19, 2019
Daniel Kozak
Aug 19, 2019
bachmeil@yahoo.com
Aug 20, 2019
FeepingCreature
Mar 21, 2021
Iain Buclaw
Jun 07, 2022
mhh
Jun 07, 2022
Dlang Bot
Jun 08, 2022
Dlang Bot
Jul 09, 2022
Dlang Bot
August 19, 2019
https://issues.dlang.org/show_bug.cgi?id=20143

Daniel Kozak <kozzi11@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kozzi11@gmail.com

--- Comment #1 from Daniel Kozak <kozzi11@gmail.com> ---
needs to be compiled with enabled inlineing (-inline) and it is not important that return type of `bug` function is double it could be int, but if we change fun tu return double it works as expected

--
August 19, 2019
https://issues.dlang.org/show_bug.cgi?id=20143

bachmeil@yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bachmeil@yahoo.com

--- Comment #2 from bachmeil@yahoo.com ---
(In reply to Daniel Kozak from comment #1)
> needs to be compiled with enabled inlineing (-inline) and it is not important that return type of `bug` function is double it could be int, but if we change fun tu return double it works as expected

It actually has to be compiled with the combination -O -inline. Works fine if compiling with either -O or -inline but not both.

--
August 20, 2019
https://issues.dlang.org/show_bug.cgi?id=20143

FeepingCreature <default_357-line@yahoo.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |default_357-line@yahoo.de

--- Comment #3 from FeepingCreature <default_357-line@yahoo.de> ---
This is one for Walter.

The proximate cause is that in elem.d, the "0" on the left side of 0 / fun(0) is converted from a long double constant to a double constant sight unseen. (elem.d: shrinkLongDoubleConstantIfPossible)  This leaves the operation post inlining standing as "double / long double", which is not a valid operation.

--
March 21, 2021
https://issues.dlang.org/show_bug.cgi?id=20143

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |backend
                 CC|                            |ibuclaw@gdcproject.org

--
June 07, 2022
https://issues.dlang.org/show_bug.cgi?id=20143

mhh <maxhaton@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxhaton@gmail.com
           Severity|enhancement                 |normal

--
June 07, 2022
https://issues.dlang.org/show_bug.cgi?id=20143

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
@maxhaton updated dlang/dmd pull request #14192 "Fix Issue 20143 - Backend constant folding did not support division b…" fixing this issue:

- Fix Issue 20143 - Backend constant folding did not support division by real.

  This involved simply adding the correct case to the grand olde switch
statement that does the evalu8tion

https://github.com/dlang/dmd/pull/14192

--
June 08, 2022
https://issues.dlang.org/show_bug.cgi?id=20143

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #14192 "Fix Issue 20143 - Backend constant folding did not support division b…" was merged into stable:

- 7e2ca1ba2f849ad4a1670ff351702a2806dfd89a by mhh:
  Fix Issue 20143 - Backend constant folding did not support division by real.

  This involved simply adding the correct case to the grand olde switch
statement that does the evalu8tion

https://github.com/dlang/dmd/pull/14192

--
July 09, 2022
https://issues.dlang.org/show_bug.cgi?id=20143

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #14280 "merge stable" was merged into master:

- 6d590f4c88d7ada0743e5bdb4223a7d044924322 by mhh:
  Fix Issue 20143 - Backend constant folding did not support division by real.

  This involved simply adding the correct case to the grand olde switch
statement that does the evalu8tion

https://github.com/dlang/dmd/pull/14280

--