From patchwork Mon Aug 1 04:41:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joern Rennecke X-Patchwork-Id: 107657 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 4104CB6F9F for ; Mon, 1 Aug 2011 14:41:33 +1000 (EST) Received: (qmail 15108 invoked by alias); 1 Aug 2011 04:41:31 -0000 Received: (qmail 15093 invoked by uid 22791); 1 Aug 2011 04:41:30 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, MIME_QP_LONG_LINE X-Spam-Check-By: sourceware.org Received: from c60.cesmail.net (HELO c60.cesmail.net) (216.154.195.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Aug 2011 04:41:05 +0000 Received: from unknown (HELO epsilon2) ([192.168.1.60]) by c60.cesmail.net with ESMTP; 01 Aug 2011 00:41:05 -0400 Received: from e178014025.adsl.alicedsl.de (e178014025.adsl.alicedsl.de [85.178.14.25]) by webmail.spamcop.net (Horde MIME library) with HTTP; Mon, 01 Aug 2011 00:41:04 -0400 Message-ID: <20110801004104.b0hudtn6io40wcgg-nzlynne@webmail.spamcop.net> Date: Mon, 01 Aug 2011 00:41:04 -0400 From: Joern Rennecke To: gcc-patches@gcc.gnu.org Subject: RFA: Testsuite fixes (1/3): builtin_apply MIME-Version: 1.0 User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) 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 I am working with a toolchain that is frugal with stack usage at startup, so an attempt to read dozens more bytes than have been pushed causes unmapped memory references. Fixed by adding an automatic variable that occupies sufficient space. Regression tested with x86_64-unknown-linux-gnu X sh-elf . No change there, as the default SH liker script places the stack at 3M, and the default simulator size is 16M. 2011-07-21 Joern Rennecke * gcc.dg/torture/stackalign/builtin-apply2.c: Make sure we don't read past the bottom of the stack. 2009-09-24 Joern Rennecke * gcc.dg/builtin-apply2.c: Make sure we don't read past the bottom of the stack. Index: gcc.dg/torture/stackalign/builtin-apply-2.c =================================================================== --- gcc.dg/torture/stackalign/builtin-apply-2.c (.../GNU/fsf-gcc/trunk/gcc/testsuite) (revision 2013) +++ gcc.dg/torture/stackalign/builtin-apply-2.c (.../Customer-Projects/X/branches/Y-20110628/toolchain/gcc-4.7.0-20110701/gcc/testsuite) (revision 2013) @@ -24,7 +24,10 @@ void bar(char *name, ...) int main(void) { - bar("eeee", 5.444567, 8.90765, 4.567789, INTEGER_ARG); + /* Make sure that there is some stack that can be legitimately read. */ + char dummy[64]; + + bar(dummy, 5.444567, 8.90765, 4.567789, INTEGER_ARG); return 0; } Index: gcc.dg/builtin-apply2.c =================================================================== --- gcc.dg/builtin-apply2.c (.../GNU/fsf-gcc/trunk/gcc/testsuite) (revision 2013) +++ gcc.dg/builtin-apply2.c (.../Customer-Projects/X/branches/Y-20110628/toolchain/gcc-4.7.0-20110701/gcc/testsuite) (revision 2013) @@ -36,6 +36,9 @@ void bar(char *name, ...) int main(void) { + /* Make sure that there is some stack that can be legitimately read. */ + char dummy[64]; + bar("eeee", 5.444567, 8.90765, 4.567789, INTEGER_ARG); return 0;