Odd optimizer behavior with FP arithmetic

Konstantin Shegunov kshegunov@gmail.com
Thu Sep 26 17:38:00 GMT 2019


On Thu, Sep 26, 2019 at 8:11 PM Alexander Monakov <amonakov@ispras.ru>
wrote:

> The 'add' function is inlined into main, and floating-point operations that
> would compute result.c are eliminated as dead code because result.c is
> never
> used.
>
> (and because the compiler doesn't attempt to preserve floating-point
> exceptions
> that those eliminated instructions might raise)

...

In this case inlining does not happen due to flags being different between
> 'main' and 'add'.
>
> In the first case inlining also does not happen for the same reason.
>

Well, ain't I a dummy.

Thanks a lot!
Konstantin.



More information about the Gcc-help mailing list