From patchwork Tue Feb 9 13:18:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominik Vogt X-Patchwork-Id: 580846 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9BCC7140784 for ; Wed, 10 Feb 2016 00:18:42 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ImlB5zUL; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=WaMhoTQe7fquU/P2v cKLRaa25vClQBKVwTiHh6AL/MlUR25yjURhbllZiMzGlbkKUTxtMAVgqCWX0iOOC r1i88KNm/lRstrHnLiqhD8KhreOWsh8MQ1HDWaZ3/N5Hp10LFlrqLwYA89e74+AF FtdavVryVbwMbiMmKfTsV7qeCk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:references:mime-version :content-type:in-reply-to; s=default; bh=Qug6bZyY3bsu2n/OBddV20P i8Dc=; b=ImlB5zULNcvB6GC1GPz1ZqHOW+kKAC69YAWOZBlHcDHockDAr13zUGg l1DuVRLSTQKWGjcqMaTXAKUKpfJf0DImlKv4mOtGySw40PCnR95CSEtaPBe/kouZ w7JCBJRddVG8OaU1YhJleIq+idlZEelgri632AUARrRo/X/yPa58= Received: (qmail 45962 invoked by alias); 9 Feb 2016 13:18:34 -0000 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 Received: (qmail 45953 invoked by uid 89); 9 Feb 2016 13:18:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.6 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, UNWANTED_LANGUAGE_BODY autolearn=no version=3.3.2 spammy= X-HELO: e06smtp10.uk.ibm.com Received: from e06smtp10.uk.ibm.com (HELO e06smtp10.uk.ibm.com) (195.75.94.106) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 09 Feb 2016 13:18:32 +0000 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 9 Feb 2016 13:18:29 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 9 Feb 2016 13:18:27 -0000 X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: vogt@linux.vnet.ibm.com X-IBM-RcptTo: gcc-patches@gcc.gnu.org Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 5A0EF1B0804B for ; Tue, 9 Feb 2016 13:18:40 +0000 (GMT) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u19DIRoq15532070 for ; Tue, 9 Feb 2016 13:18:27 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u19DIQ0W014417 for ; Tue, 9 Feb 2016 06:18:26 -0700 Received: from bl3ahm9f.de.ibm.com (sig-9-84-140-211.evts.de.ibm.com [9.84.140.211]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u19DIQrE014389; Tue, 9 Feb 2016 06:18:26 -0700 Received: from dvogt by bl3ahm9f.de.ibm.com with local (Exim 4.76) (envelope-from ) id 1aT8BU-000212-O1; Tue, 09 Feb 2016 14:18:24 +0100 Date: Tue, 9 Feb 2016 14:18:23 +0100 From: Dominik Vogt To: gcc-patches@gcc.gnu.org Cc: Andreas Krebbel Subject: Re: [PATCH] S/390: PR 69625: Add test case Message-ID: <20160209131823.GA7564@linux.vnet.ibm.com> Reply-To: vogt@linux.vnet.ibm.com Mail-Followup-To: vogt@linux.vnet.ibm.com, gcc-patches@gcc.gnu.org, Andreas Krebbel References: <20160205160757.GA2128@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160205160757.GA2128@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16020913-0041-0000-0000-000007356F57 On Fri, Feb 05, 2016 at 05:07:57PM +0100, Dominik Vogt wrote: > The attached patch adds a testcase for PR 69625. Version 2 also runs with -m31. Ciao Dominik ^_^ ^_^ From 5c539cfea4292dc20bb5e7f854101997f11bc215 Mon Sep 17 00:00:00 2001 From: Dominik Vogt Date: Fri, 5 Feb 2016 15:13:08 +0100 Subject: [PATCH] S/390: PR 69625: Add test case. --- gcc/testsuite/gcc.target/s390/pr69625.c | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 gcc/testsuite/gcc.target/s390/pr69625.c diff --git a/gcc/testsuite/gcc.target/s390/pr69625.c b/gcc/testsuite/gcc.target/s390/pr69625.c new file mode 100644 index 0000000..f717183 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/pr69625.c @@ -0,0 +1,37 @@ +/* Test for PR 69625; make sure that a leaf vararg function does not overwrite + the caller's r6. */ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +extern void abort (void); + +__attribute__ ((noinline)) +int +foo (int x, ...) +{ + __builtin_va_list vl; + int i; + + __asm__ __volatile__ ("lhi %%r6,1" : : : "r6"); + __builtin_va_start(vl, x); + for (i = 2; i <= 6; i++) + x += __builtin_va_arg(vl, int); + __builtin_va_end (vl); + + return x; +} + +__attribute__ ((noinline)) +void +bar (int r2, int r3, int r4, int r5, int r6) +{ + foo (r2, r3, r4, r5, r6); + if (r6 != 6) + abort (); +} + +int +main (void) +{ + bar (2, 3, 4, 5, 6); +} -- 2.3.0