It should be noted, that adding the optimize switch will of course give you faster running code, but it also massivly increases the memory needs and the time needed for compiling.
Eg. I've once tried to compile source/qb64.bas with the -O2 switch in the hope that the IDE would then do its error checking and code formatting quicker on large code projects, but unfortunatly after running for a felt 10 minutes and massivly swapping out memory to the pagefile, it finally failed to compile due to lack of memory on my 4GB Win7 machine.
So keep this in mind, if you get C++ Complilation failures when compiling your programs, which formerly compiled error free, it might be the optimize switch.