The bug referenced in workspace_tools/toolchains/gcc.py
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46762
has been fixed a long time ago (v 4.5.3) in ARM GCC.
Because of this, we should consider changing the optimization from -O2 to -Os
Also, latest versions of ARM GCC (4.8) have added the -Og option, which is described as "Optimize for debugging experience rather than speed or size"; this results in considerably smaller code than the current -O0 optimization when DEBUG is set.
Perhaps some way could be added to allow those of us who are debugging and using later ARM gcc versions to use -Og instead of -O0?