Advertisement · 728 × 90

Posts by Compiler Explorer

Preview
Compiler Explorer The official Compiler Explorer shop! Come show your support for CE and get cool gear!

Of course this series will demonstrate ways to use Compiler Explorer - and is part of a fund raiser too. shop.compiler-explorer.com and www.patreon.com/cw/mattgodbolt

4 months ago 8 2 0 0
Matt Godbolt’s blog

This December, I'll be posting an article & video each day until Christmas in the Advent of Compiler Optimisations! #AoCO2025
Each day we'll explore a fun optimisation in C or C++; some low-level, x86 or ARM-specific, some high-level. Hope you'll join me!
YT: youtube.com/mattgodbolt
Blog: xania.org

4 months ago 64 16 3 0

And we're back. A temporary misconfiguration - we have fixed it and all is well..sorry for the problem! -mg

5 months ago 8 2 0 0

Investigating why Windows compilers are down! Watch this space, and sorry for any inconvenience -mg

5 months ago 8 1 1 0
Compiler Explorer - C++ (x86-64 clang 21.1.0) // setup constexpr auto valid_chars = "0123456789abcdef"; bool is_valid_id(std::string_view maybe_id) { if (maybe_id.size() != 16) { return false; } if (maybe_id.find_first_not_of(valid_ch...

LLM-explanation is now live in @compiler-explorer.com - An example: compiler-explorer.com/z/rvvx7MxKq

* LLMs make mistakes and are overconfident
* We'll never force LLMs or AI on you, it's opt in (like clang-tidy, PVS Studio or other tools)
* It is *beta* quality

Initial results are promising(1/3)

6 months ago 34 5 5 2
CEFS: Finally Solving CE's Mount(ing) Problems — Matt Godbolt’s blog In which CE's boot times are finally brought under control

@compiler-explorer.com is now running with a completely new storage mechanism in the back end. It's taken me quite a long time to get to the point where I felt confident enough to switch over to it and it seems like it's gone without a hitch. Details:
xania.org/202509/cefs

6 months ago 30 6 1 0

Hey folks! @compiler-explorer.com is free & open for everyone, but if you're planning to use our API for bulk executions though, please ping us! CE is a shared resource and heavy use can slow things down for the whole community. DM me to chat - happy to help figure out what works for everyone! :)

7 months ago 34 6 1 0

Support friend of the site Jason by going to one of his excellent courses! Jason was instrumental in publicising CE in the early days and his courses are awesome too! -mg

7 months ago 1 1 0 0
Advertisement

CE relies on your support! How you can help:

* Submit PRs & report issues: github.com/compiler-exp...
* Become a Patron: patreon.com/mattgodbolt
* Sponsor us: github.com/sponsors/com...
* Buy CE swag: shop.compiler-explorer.com
* Join our Discord: discord.gg/B5WacA7

8 months ago 3 3 0 0

I've been getting more anecdotal reports that @compiler-explorer.com is slow. Seems to be folks' simple code taking a while, likely queued up behind a longer compile. We've done some digging and it seems to have gotten worse since December last year. Doesn't seem to be bot traffic. Have you noticed?

8 months ago 15 1 1 0

Huge news! AWS has approved Compiler Explorer for their Open Source Credits program, covering our infrastructure costs for the next year!
Thank you AWS for supporting open source! This means faster compiles, better queuing & more improvements coming. Exciting times ahead!

9 months ago 94 11 0 0
Compiler Explorer Cost Transparency — Matt Godbolt’s blog In which I try and show how we spend your kind Patreon donations

I'm frequently asked "how much does @compiler-explorer.com cost to run". I've done some digging and posted xania.org/202506/compi... which is a high-level breakdown of the costs (and revenue); and links to a more in depth report if you want all the gory details.

9 months ago 52 14 1 0

I'm half way through my career break, and taking stock. Plan was to do conf talks (check), work on @compiler-explorer.com (check), spend time with family (sort of) and even do some hobby code (also sort of). Higher level goal still is to get CE "on its feet" a bit...

9 months ago 40 2 1 1
Get More Out of Compiler-Explorer ('godbolt') :: Ofek Shilon
Get More Out of Compiler-Explorer ('godbolt') :: Ofek Shilon YouTube video by CoreCppIL

A fantastic walk through of some @compiler-explorer.com features by one of our core maintainers @ofekshilon.bsky.social . Thanks Ofek!

youtu.be/_9sGKcvT-TA

9 months ago 19 4 0 0
Preview
How Compiler Explorer Works in 2025 — Matt Godbolt’s blog How we handle 92 million compilations a year without everything catching fire

It's been a while since I've written about the innards of @compiler-explorer.com. xania.org/202506/how-c... has the details, some statistics and some fun war stories.

10 months ago 57 17 3 0
Compiler Explorer and the Promise of URLs That Last Forever — Matt Godbolt’s blog How we're preserving 12,000 legacy links as Google's URL shortener rides into the sunset

On @compiler-explorer.com URLs and another Google product sunsetting: xania.org/202505/compi...

10 months ago 85 24 3 2
Advertisement
A screenshot of Compiler Explorer showing an "AI Explain this" view. The source code is: 

bool isspc(char c) { 
    return c == '\n' || c == '\r' || c == '\t' || c == ' ';
}

The asm is:
isspc(char):
        mov     ecx, edi
        cmp     cl, 33
        setb    dl
        movabs  rax, 4294977024
        shr     rax, cl
        and     al, dl
        ret

Below is a "Claude Explain" window with:

The function isspc(char) is compiled to an efficient bit manipulation technique to check for whitespace characters. Let's break down the assembly instructions:

mov ecx, edi

Copies the input character from the edi register (first function argument) to ecx
cl will contain the lowest 8 bits (the character)
cmp cl, 33

Compares the character against decimal 33
This is a preliminary check to quickly filter out non-whitespace characters
setb dl

Sets the dl register to 1 if the character is below 33 (space, tab, newline, etc.)
Uses a conditional set instruction
movabs rax, 4294977024

Loads a pre-computed 64-bit constant
This constant represents a bit mask for whitespace detection
shr rax, cl

Shifts the bit mask right by the character's value
This dynamically positions the mask based on the input character
and al, dl

Performs a bitwise AND between the shifted mask and the previous condition
Produces the final boolean result in al
ret

Returns the result (0 or 1) in al
This implementation is a highly optimized branchless method for checking whitespace characters, using bit manipulation instead of multiple comparisons. It avoids conditional jumps, which can be slower on modern CPUs.

The code checks for space (' '), newline ('\n'), carriage return ('\r'), and tab ('\t') in a single, efficient operation.

A screenshot of Compiler Explorer showing an "AI Explain this" view. The source code is: bool isspc(char c) { return c == '\n' || c == '\r' || c == '\t' || c == ' '; } The asm is: isspc(char): mov ecx, edi cmp cl, 33 setb dl movabs rax, 4294977024 shr rax, cl and al, dl ret Below is a "Claude Explain" window with: The function isspc(char) is compiled to an efficient bit manipulation technique to check for whitespace characters. Let's break down the assembly instructions: mov ecx, edi Copies the input character from the edi register (first function argument) to ecx cl will contain the lowest 8 bits (the character) cmp cl, 33 Compares the character against decimal 33 This is a preliminary check to quickly filter out non-whitespace characters setb dl Sets the dl register to 1 if the character is below 33 (space, tab, newline, etc.) Uses a conditional set instruction movabs rax, 4294977024 Loads a pre-computed 64-bit constant This constant represents a bit mask for whitespace detection shr rax, cl Shifts the bit mask right by the character's value This dynamically positions the mask based on the input character and al, dl Performs a bitwise AND between the shifted mask and the previous condition Produces the final boolean result in al ret Returns the result (0 or 1) in al This implementation is a highly optimized branchless method for checking whitespace characters, using bit manipulation instead of multiple comparisons. It avoids conditional jumps, which can be slower on modern CPUs. The code checks for space (' '), newline ('\n'), carriage return ('\r'), and tab ('\t') in a single, efficient operation.

Experimenting with something like this for @compiler-explorer.com - wondering what your thoughts are? AI is getting everywhere, and can be divisive. I'm hoping something like this - so long as I can get the output quality high enough - is a net benefit to help folks learn more about their code.

10 months ago 49 6 21 1

Thrilled to share that @compiler-explorer.com has received a $10K grant from NVIDIA's FOSS Fund! This support will help keep our GPU instances running and allow developers worldwide to experiment with CUDA code. Thank you NVIDIA AI Dev for supporting open source tools! #NVIDIAGrant

11 months ago 87 8 1 1
Bernie once again meme with

I am once again asking

you to remember that if turning on optimizations changes the behavior of your program, it is likely you are missing some undefined behavior

Bernie once again meme with I am once again asking you to remember that if turning on optimizations changes the behavior of your program, it is likely you are missing some undefined behavior

Once again

#programming

1 year ago 69 9 5 0

Does passing `-m32` to generate 32-bit code work? -mg

1 year ago 1 0 1 0
A screenshot of the site showing all the x86 gccs

A screenshot of the site showing all the x86 gccs

This is what I'm seeing anyway, as I'd expect. -mg

1 year ago 0 0 1 0

I see them; can you elaborate on what you're seeing?

1 year ago 1 0 1 0

First I've heard that it's not there

...taking a look -mg

1 year ago 0 0 0 0

We just blocked a TW-based IPv6 address from making many many back-to-back requests, most of which seemed to hit our caches (and thus were duplicates). If this affected you, please DM us or reply and we can help diagnose what went wrong. -mg

1 year ago 5 1 0 0
Preview
Compiler Explorer in 2024 | Matt Godbolt Get more from Matt Godbolt on Patreon

Compiler Explorer in 2024!

0.017 cents per compilation for 190M compilations. Tons of new features, Matt takes stock:

www.patreon.com/posts/compil...

1 year ago 19 4 1 1
Advertisement

Sent my first proper Patreon/GitHub sponsor update for @compiler-explorer.com work today. Surreal experience, I'm kinda giving my first update to my new boss(es) :-)

1 year ago 28 2 0 0
Preview
Compiler Explorer Compiler Explorer is an interactive online compiler which shows the assembly output of compiled C++, Rust, Go (and many more) code.

Godbolt now has Slang support!

godbolt.org
@compiler-explorer.com

1 year ago 41 13 0 1

So, after over 5 years at Aquatic, I made the tough call to leave and try something else. I had a wonderful time there, enjoyed the work and made some great friends. I'll be taking some time between jobs and will be working on @compiler-explorer.com and other OSS projects. I'm excited!

1 year ago 81 3 9 0
Preview
Compiler Explorer Support Compiler Explorer by buying awesome branded kit!

Only 2 days left 15% off stuff at the CE shop. I just uploaded a dark-friendly logo too! Get some stuff to show off your love of CE and know you're helping the site at the same time!
compiler-explorer.myspreadshop.com

1 year ago 10 2 0 0
A graph of "5xx errors" showing a recent peak for some time, followed by a drop even more recently.

A graph of "5xx errors" showing a recent peak for some time, followed by a drop even more recently.

Looks like it's worked:

1 year ago 2 0 0 0