http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60247
Georg-Johann Lay <gjl at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target|ATxmega processor |avr Status|UNCONFIRMED |WAITING Last reconfirmed| |2014-03-31 CC| |gjl at gcc dot gnu.org Component|libgcc |target Ever confirmed|0 |1 Build|avr-gcc port under FreeBSD |x86_64 --- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> --- Are you sure this is not already fixed by PR45263? Or in version 4.7 and newer? 4.7 is the oldest supported release series. 4.5 is no more supported. What do you man by "does not preserve registers before calling constructors"? The only registers that must be saved are the call-clobbered registers, because the ABI requires that the callee (constructor) is saving / restoring the call-saved registers. If you clobber an SFR like RAMP* or EIND, you must restore them by hand. EIND must not be changes after .init1 and RAMP* is only saved / restored in ISRs, cf.notes in the respective manual section: http://gcc.gnu.org/onlinedocs/gcc/AVR-Options.html __do_global_dtors uses R16, R17, R28, R29 across constructor calls, all of which are callee-saved. And before the constructor is called, RAMPZ is reset to 0. I don't see anything that's wrong there.