Installing gcc-explorer and setting it up with gcc6809 and cmoc A recent version of node.js is needed so I recommend Ubuntu 16.04 sudo apt-get install nodejs npm git clone https://github.com/mattgodbolt/gcc-explorer.git cd gcc-explorer/ make (you can now test the stock installation in your browser) (stop it with ctrl-C) sudo add-apt-repository ppa:tormodvolden/m6809 echo "deb http://ppa.launchpad.net/tormodvolden/m6809/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/tormodvolden-ubuntu-m6809-xenial.list sudo apt-get update sudo apt-get install gcc6809 lwtools cmoc Create these two configuration files: $ cat etc/config/c.defaults.properties # Default settings for C compilers=/usr/bin/gcc defaultCompiler=/usr/bin/gcc compileFilename=example.c stubRe=\bmain\b stubText=int main(void){return 0;/*stub provided by Compiler Explorer*/} $ cat etc/config/c.local.properties compilers=gcc6809:cmoc:gcc compiler.gcc6809.exe=/usr/bin/m6809-unknown-gcc compiler.gcc6809.name=gcc6809 4.6.4lw compiler.cmoc.exe=./cmoc-wrapper compiler.cmoc.name=cmoc postProcess=sed -e '/^;\t.stab/d' -e '/^\* /d' Copy the cmoc-wrapper to the gcc-explorer folder and make it executable: chmod +x cmoc-wrapper make run LANG=C Example study 1) Paste the below test example into the source window, and see -Os simply lays out the array in the code while -O1 puts the whole array on the stack - because it can. 2) Make the testFunction() static See how -O1 now is smarter and much shorter (!) than -Os 3) Move the "a" array definition out of main () See how -O1 avoids the cycle-expensive tfr whereas -Os sticks to it. Sizes are similar. 4) Make also the "a" array static. Who's the champ now? /* test example */ int testFunction(int* input, int length) { int sum = 0; for (int i = 0; i < length; ++i) { sum += input[i]; } return sum; } int main (void) { int a[] = {11,22,33,46,55}; return testFunction(a, 5); } /* end test example */