dcc is an optimizing compiler for the C language.

Project goals:

  • Fast build times.
  • Good code generation, without exploiting UB nonsense.
  • Customizable compilation pipeline.
  • Feature parity.
  • Alternative code generation library to LLVM.

Current status (11/2024)

Build times

Build times are ~10 times faster than gcc, so ~5-6 times faster than clang, without even trying to be fast. Projects in the order of <=100K LOC can be compiled instantly (<=1s) single-core on a 10 year old laptop.

Codegen quality

Code compiled with -O1 is ~30% slower than gcc/clang -O1, but currently the optimizer it's ultra conservative and a mere prototype. I am still experimenting on the IR design, thus I've only implemented the code transformations that are most demanding on the IR internal structures (e.g. inliner, mem2reg, CFG simplifications) to ensure that they can be done well, before committing a lot of time into making each optimization pass good.

Customization

Waiting for the C/C++ Standard Committee to design good features didn't work for the last 20+ years, thus you have to implement them yourself. That's why the compiler provides a plugin API for further customization. Currently only AST inspection is implemented, but the intent is to also allow AST modifications along with further options for tuning later compilation stages.

Features

Full C11 (with caveats) and partial C23 support is available, along with built-ins functions, attributes and commonly used language extensions.

Intel intrinsics up to AVX2 are available directly without the need of any header files.

dcc can already compile other C projects and itself with debug info.

Codegen library

No work have been done to expose the compiler as a library yet.

I plan to provide three interfaces:

  • Textual IR front-end,
  • Binary IR (you need it anyway for Link Time Optimizations),
  • Library C API.

Info

Please visit the project page for more information.

Project Page

Demo (06/05/2024)