From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26360 invoked by alias); 21 Dec 2012 03:32:34 -0000 Received: (qmail 26289 invoked by uid 48); 21 Dec 2012 03:32:21 -0000 From: "joey.ye at arm dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/55757] Suboptimal interrupt prologue/epilogue for ARMv7-M (Cortex-M3) Date: Fri, 21 Dec 2012 03:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: joey.ye at arm dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P5 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-12/txt/msg02067.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55757 --- Comment #5 from Joey Ye 2012-12-21 03:32:21 UTC --- However, there is room to improve both performance and stack consumption in case of Os: extern void bar(int *); void foo() { int a; bar(&a); } Built with -mcpu=cortex-m3 -Os: push {r0, r1, r2, lr} add r0, sp, #4 bl bar pop {r1, r2, r3, pc} Apparently it should be optimized to save 8 bytes of stack consumption and two stores: push {r0, lr} mov r0, sp bl bar pop {r1, pc}