When using C++ modules with g++ (with flags like: -O1, -O3, etc...), Do optimization flags affect the .gcm intermediate file, or only affect the .o object files?
Compiler directly uses optimization flags, how aggressively it will optimize the code for .o
files.
Compiler's influence on .gcm
file is indirect. If it's created with '-fprofile-generate' flag, then compiler can influence the aggression of the program. Data created in .gcda
file, will create .gcm
file. In other words, compiler can optimize data in .gcda
, that creates .gcm
file.