4 ms·
GCC Explorer
Interactive tool to see what GCC is up to.
- gioele 14y agoHandy tool. It would be nice if it could show side-by-side diffs of the output coming from different GCC versions.
- sanxiyn 14y agoOr GCC vs LLVM, for that matter. If such link is permanent it could be linked from GCC or LLVM missed optimization bugs.
- franzb 14y agoVery cool. Thanks!
- Andys 14y agoGreat, but I was hoping for access to libc so I could see if the new string/popcnt/rand instructions are being used with -march=corei7
- pbrook 14y agoVery cool tool, I can easily see this becoming a standard tool for learning assembly!
- udp 14y agoFor bonus points, get a compiler building with Emscripten and compile the code locally in the browser.
- kevinburke 14y agoI remember one time during compilers class I tried to figure out the largest prime number in the denominator that GCC would replace with multiplication and bit shifts. I got up to a number in five digits and stopped counting. Just goes to show the amount of work that goes into compilers and the importance of speed for some program writers.
- jcromartie 14y agoThis is great. I often compile with gcc -S but then get swamped by the massive amount of included stdlib stuff and name manging, so it's hard to find my code.
- franzb 14y agoYet more bonus points if you implement a way to correlate (roughly) the assembly code with the corresponding C++ code. Like, when you select lines in the C++ code, it highlights the corresponding assembly instructions. Not trivial, especially at high optimization levels.
- ethereal 14y agoActually, it's not that difficult. Get GCC to generate DWARF [debugging] information, and then use that to provide the back-references. (Reference: DWARF 3.0 spec, available at http://dwarfstd.org/doc/Dwarf3.pdf http://dwarfstd.org/doc/Dwarf3.pdf. See page 92.) This is how GDB does the same. The output is a little weird (I've had it execute line 56 before line 55, for example) and you do have to be careful, as not all lines translate directly. But it would be at least be a nice starting point. There are even some nice libraries out there that parse this information! EDIT: Hmm, I just noticed that the source is on Github. If I get some time this weekend I'll try adding support for this.
- nuje 14y agoWhat's happening in the signed case? Signed division and modulo have been redefined in newer C/C++ standards. He talks about writing C but the syntax looks like C++ 11? at least i don't think he means the C "auto" here.
- BudVVeezer 14y agoAs a cross-platform developer, I would love to see clang and MSVC as compiler options so that I'm able to compare the various outputs when trying to track down undefined/implementation defined behaviors. As it stands though, this is a fantastic tool! It's right up there with ideone for me.
- bigfoot 14y agoNice. Please add more GCC versions (3.x and 4.0 through 4.3?) and the most recent clang/clang++ releases! Direct pastebin-style links would also be great.
- Someone 14y agohttp://llvm.org/demo/index.cgi http://llvm.org/demo/index.cgi is a similar tool for clang.
- nwmcsween 14y agoPlease use vanilla GCC as ubuntu (and other distros) stupidly edit system wide spec files to add things like fstack-protector.