On Aug 14, 2019, at 12:27 AM, Hick Gunter <h...@scigames.at> wrote:
> 
> But surely any compiler worth ist salt would optimize away all of that code 
> and just use the result of the expression given as argument in the call ;)

You joke, but the answer is “Maybe.”

   See https://godbolt.org/z/K9g-ai

In English, that assembly says “return the passed value.”

Take out the -O3 on that page and observe the change.

But now change the compiler to see whether your favorite compiler can do this 
optimization.  The latest version of Visual C++ won’t optimize this away, as 
the latest GCC will:

    https://godbolt.org/z/tnr9cT

There’s probably an optimization setting that will do this, but the point is, 
you can’t always count on the optimizer to do what you think it should.  Thus 
Compiler Explorer.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to