I have some problems with O2 optimization flags compiling a commercial software. It works with O1, but gives some errors with O2. I would like to try to add O2 flags one-by-one to see which one fails, but in the documentation I could not find the list of flags contained in O2. Or it cannot be reduced to a number of specific flags?
Optimization levels cannot be reduced to a set of flags. There are some optimizations that can be turned off with flags, but I'd say most cannot.