GCC

GCC Compiler Optimisation Levels

Date Published:
Last Modified:

Fancy Optimisations

One aspect of GCC optimisation that still amazes me is it's ability to convert specific repetitive operations into highly-efficient mathematical sequence equations.

One example is that GCC can convert an function in where you sum all the integers up to the number specified as an input variable using a for loop, into the equation x * (x + 1) / 2.

This is covered in more detail at http://blog.xebia.com/gcc-compiler-optimizations-dissection-of-a-benchmark/.


Like this page? Upvote with shurikens!

Related Content:

Tags:

comments powered by Disqus