User talk:Kim Bruning/Compiler metaprogramming example
I'd originally intended to see what would happen if I tried -funroll-loops (and no I wouldn't have put all of *THAT* expected result into wikipedia), but to my surprise, there was no difference in the output of g++. Apparently there are still some things I don't undestand about gcc, can anyone help?
Turns out that by default GCC doesn't unroll loops that are too large (have too many iterations). This is actually logical/useful, since otherwise such an unrolled loop might not fit into the processor-cache of the specific target processor.(Loop unrolling is supposed to be an Optimisation )) . At some point it might be interesting to get gcc to work like that, and modify the example page.
So every time I write a c++ program and compile it I'm doing compiler metaprogramming? Josh Cherry 03:18, 15 Jun 2004 (UTC)