From patchwork Thu Oct 13 19:53:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 681937 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 3sw1cv2Dz2z9sCZ for ; Fri, 14 Oct 2016 06:53:34 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=CftNWysT; 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 :subject:from:to:content-type:date:mime-version :content-transfer-encoding:message-id; q=dns; s=default; b=BzUff jtJt8yDEcg+W6Aru2UJTTshiHBzrvi3q7/yPhYoQ4ZIMHxut77TJ9rZi1IMip4vd T2sfHXxD9ahwZEVvavcYJ6fIVR0rPpjBnzcVGjQqin/khrIMeaK364GwwXkXnlnP GeiA7wLYGpn1ECPpaptHoexd0OzFic29HOFYgk= 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 :subject:from:to:content-type:date:mime-version :content-transfer-encoding:message-id; s=default; bh=qMbvsqm9WMw T478tG5JvihHaIn0=; b=CftNWysTd4phB3CAdpuPSwTkIIq07ENJ12lv4Z7xmf2 1Tw0+UctnYZ+D3BjFNDbXnHdSyKVblGURtr7pX8MLkFbuJW4E5Vdj0jIMxWWBf7g +yMm6HpuPVc5fj5dO+Hxv/z8zIo21vjKAiByi1lNTULlgee0hjCKna7CbTeaZukU = Received: (qmail 93337 invoked by alias); 13 Oct 2016 19:53:25 -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 93311 invoked by uid 89); 13 Oct 2016 19:53:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RCVD_IN_SEMBACKSCATTER autolearn=no version=3.3.2 spammy=Hx-languages-length:1560, 1, 14, kindly X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Oct 2016 19:53:14 +0000 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9DJnCCD066078 for ; Thu, 13 Oct 2016 15:53:11 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0b-001b2d01.pphosted.com with ESMTP id 262a9fy07m-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 13 Oct 2016 15:53:11 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 13 Oct 2016 13:53:10 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 13 Oct 2016 13:53:08 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 5CD7F19D806C for ; Thu, 13 Oct 2016 13:52:34 -0600 (MDT) Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9DJr8Jj16187864 for ; Thu, 13 Oct 2016 12:53:08 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A143AC604F for ; Thu, 13 Oct 2016 13:53:07 -0600 (MDT) Received: from [9.10.86.199] (unknown [9.10.86.199]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id 7DBA2C604C for ; Thu, 13 Oct 2016 13:53:07 -0600 (MDT) Subject: [PATCH] Test cases for PR77937 From: Bill Schmidt To: gcc-patches@gcc.gnu.org Date: Thu, 13 Oct 2016 14:53:07 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16101319-8235-0000-0000-0000096486F4 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005905; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000186; SDB=6.00767970; UDB=6.00367531; IPR=6.00544125; BA=6.00004807; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012980; XFM=3.00000011; UTC=2016-10-13 19:53:09 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16101319-8236-0000-0000-0000359EC792 Message-Id: <1476388387.5711.8.camel@oc8801110288.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-13_12:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610130334 X-IsSubscribed: yes Here are torture test cases for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77937. Markus Trippelsdorf kindly provided the source for the tests and verified the correct dejagnu options on x86_64-pc-linux-gnu. Committed. Thanks, Bill 2016-10-13 Bill Schmidt PR tree-optimization/77937 * gcc.dg/torture/pr77937-1.c: New. * gcc.dg/torture/pr77937-2.c: New. Index: gcc/testsuite/gcc.dg/torture/pr77937-1.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr77937-1.c (revision 0) +++ gcc/testsuite/gcc.dg/torture/pr77937-1.c (working copy) @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-do options "-O3 -march=amdfam10" { target { x86_64-*-* } } } */ + +int *a; +int b, c, d; +void fn1(char *p1, int p2) { + int x; + while (1) { + x = 0; + for (; x < 8; x++) + p1[0] = -a[0] * d + p1[0] * c + 1 >> b >> 1; + p1 += p2; + } +} Index: gcc/testsuite/gcc.dg/torture/pr77937-2.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr77937-2.c (revision 0) +++ gcc/testsuite/gcc.dg/torture/pr77937-2.c (working copy) @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-do options "-O3 -march=amdfam10" { target { x86_64-*-* } } } */ + +extern int fn2(int); +extern int fn3(int); +int a, b, c; +void fn1(long p1) { + char *d; + for (;; d += p1) { + d[0] = fn2(1 >> a); + fn3(0); + fn3(c >> a); + d[1] = fn3(d[1] * b + c >> a); + d[4] = fn3(d[4] * b + c >> a); + d[5] = fn3(d[5] * b + c >> a); + } +}