3 ms·
Sort of a tangent, but you know what I'd love to see? A compiler that could emit comments with the code it generates. They wouldn't have to be brilliant, just w
by overgard 13y ago
Sort of a tangent, but you know what I'd love to see? A compiler that could emit comments with the code it generates. They wouldn't have to be brilliant, just whenever it decides to optimize some bit it emits a generic "why". It'd be even cooler if it was a website that hooked up to something like GCC, and you could feed it some C code and get a hypothetical "what would the compiler do here" sort of deal.
I realize that's kind of crazy, but it'd be an awesome teaching and debugging tool. I don't look at disassembly a lot, but when I do it's not always particularly obvious why the compiler generated a thing in a certain way.
- CUViper 13y agoIt's not exactly what you're asking for, but gcc with -fdump-rtl, -fdump-tree, and -fopt-info can show you quite a lot of what's going on.
- carterschonwald 13y agoClang does that when you have it emit Asm