From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25416 invoked by alias); 15 Jul 2004 10:30:15 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 25387 invoked by uid 48); 15 Jul 2004 10:30:10 -0000 Date: Thu, 15 Jul 2004 10:30:00 -0000 From: "baphomed at lycos dot de" To: gcc-bugs@gcc.gnu.org Message-ID: <20040715103001.16563.baphomed@lycos.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/16563] New: The compiler doesnt the necessary push/restore of r18/r19 X-Bugzilla-Reason: CC X-SW-Source: 2004-07/txt/msg01837.txt.bz2 List-Id: void testfunc32(unsigned long); void testfunc16(int); void testfunc8(char); void testfunc(unsigned int a,char b,char c,unsigned long d) { testfunc16(a); testfunc8(10); testfunc8(b); testfunc16(11); testfunc8(c); testfunc8(6); testfunc32(d); } void test() { testfunc(0xabcd,10,11,0xabacadae); } Compile the code with : avr-gcc -c -Os file.c Now we may look at the produced assembler directives. This is the call to testfunc32(): mov r25, r19 mov r24, r18 mov r23, r17 mov r22, r16 rcall testfunc32 All the other functions called before are free to change the content of r18/r19 wich contain the MSW of argument d. The possibly modified value of d ist passed to testfunc32(). The gcc is configured with: --prefix=/usr/local/ --target=avr --enable-languages=c,c++ --disable-nls -- Summary: The compiler doesnt the necessary push/restore of r18/r19 Product: gcc Version: 3.4.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: baphomed at lycos dot de CC: gcc-bugs at gcc dot gnu dot org GCC host triplet: i686-pc-linux GCC target triplet: avr http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16563