Page MenuHomeFreeBSD

Switch to -O3 flags
AbandonedPublic

Authored by gfunni234_gmail.com on Aug 24 2021, 6:18 PM.

Details

Reviewers
imp
jrtc27
dim
Summary

-O2 is good, but I don't see why -O3 is not supported, especially since all tests pass now on -O3.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

Because:

  • -O3 often bloats code
  • Much of -O3's advantage, at least with GCC, is from autovectorisation, which is useless in the kernel as we turn off vectors due to the high context-switch overhead
  • -O3 is underused and historically has come with more compiler bugs

Unless you're writing HPC code -O3 is a bad project-wide default