From patchwork Fri Nov 19 02:04:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Koning X-Patchwork-Id: 72183 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 3B3FFB7198 for ; Fri, 19 Nov 2010 13:04:45 +1100 (EST) Received: (qmail 24736 invoked by alias); 19 Nov 2010 02:04:41 -0000 Received: (qmail 24725 invoked by uid 22791); 19 Nov 2010 02:04:40 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ausc60ps301.us.dell.com (HELO ausc60ps301.us.dell.com) (143.166.148.206) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 19 Nov 2010 02:04:36 +0000 X-Loopcount0: from 10.152.240.141 From: Paul Koning Subject: [PATCH] pdp11: Fix bad code for no frame pointer case Date: Thu, 18 Nov 2010 21:04:33 -0500 Message-Id: To: gcc-patches Mime-Version: 1.0 (Apple Message framework v1081) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org FIRST_PARM_OFFSET was set on the assumption that there is always a frame pointer saved in the stack frame, which is incorrect. This patch fixes that, which corrects testsuite failures caused by picking up function arguments at the wrong stack offset. Tested by built, check of the failing testcase (abs-1.c). Committed. paul ChangeLog: 2010-11-18 Paul Koning * config/pdp11/pdp11.h (FIRST_PARM_OFFSET): Fix case of no frame pointer. Index: config/pdp11/pdp11.h =================================================================== --- config/pdp11/pdp11.h (revision 166927) +++ config/pdp11/pdp11.h (working copy) @@ -372,11 +372,10 @@ /* Offset of first parameter from the argument pointer register value. For the pdp11, this is nonzero to account for the return address. 1 - return address - 2 - frame pointer (always saved, even when not used!!!!) - -- change some day !!!:q! + 2 - frame pointer, if needed */ -#define FIRST_PARM_OFFSET(FNDECL) 4 +#define FIRST_PARM_OFFSET(FNDECL) ((frame_pointer_needed) ? 4 : 2) /* Define how to find the value returned by a function. VALTYPE is the data type of the value (as a tree).