On Mar 7, 2012, at 9:06 PM, David Relson wrote:

> On the other hand, after changing the "int main(void)" statement to "int
> test(void)", compile, and disassemble then the expected "ret"
> statements appear.  It seems that the "main" function gets special
> handling.

Hmm.  There was a very similar issue that I ran into recently with the AVR gcc 
compiler, having to do with "naked" functions not having a proper epilogue, 
resulting in bad code when jump reordering was done.  Or something like that.

PR42240: http://gcc.gnu.org/ml/gcc-patches/2011-02/msg01441.html
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42240

It looks like the non-hosted main() in msp430-gcc is similar to "naked", so the 
problem could be similar.

I don't much like their patch, since it disables optimizations that could be 
important in a function of any particular size.  avr-gcc also has attribute 
((OS_Main)) which is similar and apparently didn't have the bug.

BillW


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to