The only thing stopping gcc from becoming the desired boringcc is to find the people willing to do the work.

Implementing boringcc as a new flag of GCC

There are already several flags in gcc (-fno-strict-overflow, -fno-strict-aliasing, etc.) that prevent optimizations based on undefined behavior. Assuming that boringcc is technically possible at all, then a more general flag (-Oboring or -fboring) encompassing the existing ones plus any other undefined behavior should also be possible.

An incomplete list of features that -Oboring would need:

It is an open question whether -Oboring will generate significantly slower code. The Linux kernel already defaults to most of these options and they have not noticed any difference.

Disadvantages of creating a new compiler

  1. Building a modern C compiler supporting as many standards and targets as GCC seems much more work than modifying GCC.
  2. There is already a pool of GCC developers that, although they may not be interested in boringcc, they will help by keeping the other common parts working. That is, you'll need fewer developers interested in boringcc to achieve the same amount of work.
  3. Being a drop-in replacement of GCC would help users and simplify adoption since people are already used to GCC. This is much easier if boringcc is just gcc -Oboring.


None: boringcc (last edited 2017-08-03 13:22:31 by RichardGuenther)