From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23360 invoked by alias); 2 Aug 2011 21:14:28 -0000 Received: (qmail 23352 invoked by uid 22791); 2 Aug 2011 21:14:28 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Aug 2011 21:14:12 +0000 From: "rth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/34888] Stack patterns for AVR not optimal X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: minor X-Bugzilla-Who: rth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 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 Date: Tue, 02 Aug 2011 21:14:00 -0000 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: 2011-08/txt/msg00285.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34888 --- Comment #4 from Richard Henderson 2011-08-02 21:10:51 UTC --- Created attachment 24897 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24897 Optimize pop-all The proposed patch for PR49864 introduces REG_ARGS_SIZE. This records a (normally) non-negative number of bytes that have been pushed for arguments. Post-reload, if we see a (mov sp reg) insn that says that it's resetting the stack height, under a (common) set of conditions we can transform that to (mov sp fp) and let the previous (mov reg sp) (add reg N) insns be deleted as dead code. This reduces that common case to 4 insns instead of 9.