https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114449
Xi Ruoyao <xry111 at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2024-03-24 --- Comment #4 from Xi Ruoyao <xry111 at gcc dot gnu.org> --- (In reply to Pali Rohár from comment #2) > Interesting... I was expecting that some -O3 or better -Ofast option tells > gcc to optimize the code as much as possible. Yes this is a bug. I'm only providing some clue about why this happens, not meaning we should rely on some #pragma to get the expected result. But generally unrolling loops too much pessimizes the code, so increase the default unrolling factor is a no-go. We need to invent some cleverer thing for this.