I missed that and so far thought this is hardly possible, but, for your note,
you can set per-function optimization levels with
Function Specific Option Pragmas
#pragma GCC push_options #pragma GCC optimize ("O2")
code #pragma GCC pop_options
OTOH, of course, you can split the source code into several files and compile
each with specific optimization options. Anyway.