July 25, 2010 Leave a comment
Fun little quiz on GCC optimizations:
See how well you know (or can anticipate) gcc’s optimizer. For each question, the left box contains some code, while the right box contains code that purports to do the same thing, but that illustrates a particular optimization. Will gcc apply that optimization? Put another way, will the code on the left be as fast as the code on the right, when compiled with an optimizing gcc?