Quite a while ago, I went over the full GCC documentation of the --param settings, in an effort to try and find some magical setting to make a certain program go faster. I ended up with the ridiculous set you see below, recompiled the project and the speedup was a big fat zero percent.
Ricer settings indeed.
But at least in my case nothing broke, so here they are, mostly having a theme of letting the compiler use all the RAM and CPU time it wants.
Maybe there is some program out there, that would benefit from these, so if you are in a “why the hell not?” mood, you are welcome to try them.
using flags in GCC is like running around naked high on drugs in a minefield. The further you go from default, the less tested all of it is and the more subtle bugs you can expect to blow up in your face. Wouldn’t recommend lol
Yeah, for regular usage I use something like this: g++ -O3 -std=c++14 -march=<whatever> -flto -fno-exceptions -fno-rtti -fno-unwind-tables
Fairly standard, except the disablement of RTTI and exception handling.
Yeah, I looked up the inline ASM syntax for GCC once, recoiled in horror and nausea, and decided to never touch that. The AT&T style is garbage by itself, but nooo, they had to make it even worse.
You may get 1-2 percent if you’re lucky with ricer flags at the cost of throwing the well known behaviour of the code under “standard” settings out of the window.
The amount of time you spend fucking with ricer compiler flags will not net you anything.
Use the flags the developer put in their make file. They probably know what’s best for their code better than you do.
-Os is usually far worse than O2/O3, disables way too many things, there might be a couple rare cases where it it is faster due to being able to fit the entire hot code into the caches (L1i and µop), but by and large it is just for highly memory/storage constrained situations, like AVRs and tiny ARM SoCs