From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11233 invoked by alias); 12 Aug 2010 01:20:16 -0000 Received: (qmail 11056 invoked by uid 48); 12 Aug 2010 01:19:58 -0000 Date: Thu, 12 Aug 2010 01:20:00 -0000 Subject: [Bug c/45263] New: registers used in __do_global_ctors can get clobbered X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "gcc at d-silva dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-08/txt/msg00929.txt.bz2 In gcc/config/avr/libgcc.S, revision 143306, a change to __do_global_ctors & __do_global_dtors was made which makes use of register r20. This register can be used to pass parameters to the constructors, but it is not pushed/popped from the stack, so it will get clobbered if a constructor uses that register. I have currently worked around it by pushing/popping r20 around the call to __tablejump__, but I am not convinced that this is the correct fix (the constructors should probably push & pop r20 themselves). -- Summary: registers used in __do_global_ctors can get clobbered Product: gcc Version: 4.5.1 Status: UNCONFIRMED Severity: blocker Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: gcc at d-silva dot org GCC host triplet: i686-pc-mingw32 GCC target triplet: avr http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45263