------- Comment #12 from westfw at yahoo dot com 2010-08-22 07:21 ------- See http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=736616 This is (IMO) a bug in the __do_global_ctors in gcc/config/avr/libgcc.S When support for 24-bit flash pointers was added in edit http://gcc.gnu.org/viewcvs?view=revision&revision=143306 R20 was used to hold the extra 8 bits of address. But R20 is NOT preserved by called functions according to the AVR C calling conventions, and indeed the class initialization code ends up using R20 if there are sufficient fields to initialize. The attached patch uses R15 instead, and appears to work, but I'm not sure of the implications...
I tried to change the summary, but of course it won't let me. I think this is a more serious problem than the initial problem indicates... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44617