On 23 November 2015 at 13:02, staticx <mohamedboussaa3@xxxxxxxxx> wrote: > OK. You are right, my question was not so clear. I provide an example to > better explain : > > -giving a random sequence (among On options controllable through compiler > switches): -foption1 -fno-option2 -foption3 > -I call this sequence sample_sequence > > -I note by FNO-O1: the list of optimizations of O1 that are controllable > through compiler switches. I turn off all of them. > FNO-O2 = -fno-O1Option1 -fno-O1Option2 -fno-O1Option3 ... -fno-O1OptionN > > -I note by FNO-O2: the list of optimizations of O1 that are controllable > through compiler switches. I turn off all of them. > FNO-O2 = -fno-O2Option1 -fno-O2Option2 -fno-O2Option3 ... -fno-O2OptionN > > TEST 1: > > -O1 + FNO-O1 (disable O1 optimizations that are controllable through > compiler switches) + sample_sequence* IS IT EQUAL TO* -O2 + FNO-O2 (disable > O2 optimizations that are controllable through compiler switches) + > sample_sequence > > I would like to know of default optimizations in O1 = O2. The same question > for O3, OS and Ofast. Does Os for example introduce more default > optimizations than O1 (of course by considering that all optimizations that > are controllable through compiler switches, are disabled ) > > Hope that it is more clear. Yes, thanks. I don't know what answers you will find, but the method looks reasonable to me. If you want complete confirmation of your results I suspect you'll need to look at the GCC source to see what happens at each optimization level.