Monday, 28 April 2014

gcc .. In the beginning

In the beginning, gcc set out to outdo the native Unix C compilers.
It did that pretty well. One of the key features of gcc was that:


$ gcc -g ..
and
$ gcc -O ..


were not complimentary options. You could do optimise and debug at the
same time, and it worked nicely.

Nowadays with todays advanced optimisation selections, this is broken.
If you compile with -O and -g, you get stuff like this:


2386 int n1 = MIN(sizeof tbuf - addr - addr1, len);
(gdb) p/x w0
$2 = <optimized out>


What use is that? I want to see the value of w0, but now I resort to my
trusty friend "printf".

What went wrong?


Post created by CRiSP v11.0.31a-b6726


No comments:

Post a Comment