From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27845 invoked by alias); 29 May 2010 14:47:56 -0000 Received: (qmail 27782 invoked by uid 48); 29 May 2010 14:47:45 -0000 Date: Sat, 29 May 2010 14:47:00 -0000 Message-ID: <20100529144745.27781.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/44290] [4.5 Regression] __naked attribute is broken In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "mikpe at it dot uu dot se" 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-05/txt/msg03216.txt.bz2 ------- Comment #17 from mikpe at it dot uu dot se 2010-05-29 14:47 ------- Created an attachment (id=20772) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20772&action=view) test case from copypage-xscale.c This is distilled from the kernel's copypage-xscale.c file and illustrates the issue. With gcc-4.4 the __naked__ function foo() is called with the standard call sequence register assignment, so the asm() body of foo() works. With gcc-4.5 foo() is cloned and gets its second parameter `to' in r0 (not r1 as expected), and the body of foo() is modified to set up the actual first parameter (&fie[0]) in r1 (not r0 as expected). Obviously the asm() then breaks. Compiling with -fno-ipa-cp avoids this problem, as does adding __noclone__ and __noinline__ to foo()'s function definition. I don't immediately see how to enforce __noclone__ and __noinline__ in the ARM backend when it sees __naked__. Any ideas? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290