From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23630 invoked by alias); 12 May 2014 13:30:18 -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 Received: (qmail 23598 invoked by uid 48); 12 May 2014 13:30:14 -0000 From: "senthil_kumar.selvaraj at atmel dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/60300] [avr] Suboptimal stack pointer manipulation for frame setup Date: Mon, 12 May 2014 13:30:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: senthil_kumar.selvaraj at atmel dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-05/txt/msg01020.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60300 Senthil Kumar Selvaraj changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |senthil_kumar.selvaraj@atme | |l.com --- Comment #4 from Senthil Kumar Selvaraj --- It doesn't actually get to that - avr_sp_immediate_operand returns false if the operand is not IN_RANGE(-6,6). The comments are a bit misleading though - the shortest sequence only applies if the addend is within that range. Like Johann said, it must be a deliberate decision in favor of speed - the attached program with a stub implementation of bar and main calling foo clocks a couple of cycles lesser with DSIZE=7 than with DSIZE=6(as measured with avrtest), although the code is 6 bytes longer. If RCALLs and PUSH had been generated, the code would be 4 bytes shorter, but would need 4 more clock cycles.