From patchwork Tue Aug 27 09:26:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 270069 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "www.sourceware.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 581B62C00A6 for ; Tue, 27 Aug 2013 19:26:43 +1000 (EST) 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:subject:message-id:reply-to:mime-version:content-type; q=dns; s=default; b=WRAI/hQD7quoK+W+VxLUGrXVjm/gKX64+9nXjWHkWmZ SW3btQjMWYP1uKpqvjDzFmJ3ZIhu8wTxrSztkdFgBc+pXogzcJXZFrz1Bk6t5cm0 5YLLiTg8anYnHGctLrDrTHbHh/x7/7OdweSXnOYk/9NoTFr5wt//Uz6ULsfx9JDk = 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:subject:message-id:reply-to:mime-version:content-type; s=default; bh=oF9CRQe1F+rmKBgzu2ki1TlJknU=; b=ehoZdCTh+fk6QUNsR cb1C55yfbQi1/VCNCaK7TE5Vsm9bLWMRbu1cqEtqqPjvkuQQM5JofeKn6Z1XM4W1 atNP0VWqBTbZ7ffMCiPIK1ZM2rpiuNeovhKD8+Hen4NrFA9ekoujgHTePQQTStS7 RSaFP4LE1CUgCpohWSMo7Lt9G8= Received: (qmail 5702 invoked by alias); 27 Aug 2013 09:26:36 -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 5684 invoked by uid 89); 27 Aug 2013 09:26:36 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Aug 2013 09:26:36 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7R9QXUj027088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 27 Aug 2013 05:26:33 -0400 Received: from tucnak.zalov.cz (vpn1-5-63.ams2.redhat.com [10.36.5.63]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r7R9QVno006757 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 27 Aug 2013 05:26:33 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.7/8.14.7) with ESMTP id r7R9QVcg031221 for ; Tue, 27 Aug 2013 11:26:31 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.7/8.14.7/Submit) id r7R9QVoU031220 for gcc-patches@gcc.gnu.org; Tue, 27 Aug 2013 11:26:31 +0200 Date: Tue, 27 Aug 2013 11:26:30 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] Add testcases from PR578{60,61,75,76,77} Message-ID: <20130827092630.GG21876@tucnak.zalov.cz> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Hi! These issues were caused by the LRA optional reloads support that got reverted later on, but the testcases look to be useful for the testsuite, so I went ahead and checked them all in. 2013-08-27 Jakub Jelinek PR rtl-optimization/57860 PR rtl-optimization/57861 PR rtl-optimization/57875 PR rtl-optimization/57876 PR rtl-optimization/57877 * gcc.c-torture/execute/pr57860.c: New test. * gcc.c-torture/execute/pr57861.c: New test. * gcc.c-torture/execute/pr57875.c: New test. * gcc.c-torture/execute/pr57876.c: New test. * gcc.c-torture/execute/pr57877.c: New test. Jakub --- gcc/testsuite/gcc.c-torture/execute/pr57860.c.jj 2013-08-27 11:16:33.262457070 +0200 +++ gcc/testsuite/gcc.c-torture/execute/pr57860.c 2013-08-27 11:15:19.000000000 +0200 @@ -0,0 +1,25 @@ +/* PR rtl-optimization/57860 */ + +extern void abort (void); +int a, *b = &a, c, d, e, *f = &e, g, *h = &d, k[1] = { 1 }; + +int +foo (int p) +{ + for (;; g++) + { + for (; c; c--); + *f = *h = p > ((0x1FFFFFFFFLL ^ a) & *b); + if (k[g]) + return 0; + } +} + +int +main () +{ + foo (1); + if (d != 1) + abort (); + return 0; +} --- gcc/testsuite/gcc.c-torture/execute/pr57861.c.jj 2013-08-27 11:12:46.882684096 +0200 +++ gcc/testsuite/gcc.c-torture/execute/pr57861.c 2013-08-27 11:12:07.000000000 +0200 @@ -0,0 +1,33 @@ +/* PR rtl-optimization/57861 */ + +extern void abort (void); +short a = 1, f; +int b, c, d, *g = &b, h, i, j; +unsigned int e; + +static int +foo (char p) +{ + int k; + for (c = 0; c < 2; c++) + { + i = (j = 0) || p; + k = i * p; + if (e < k) + { + short *l = &f; + a = d && h; + *l = 0; + } + } + return 0; +} + +int +main () +{ + *g = foo (a); + if (a != 0) + abort (); + return 0; +} --- gcc/testsuite/gcc.c-torture/execute/pr57875.c.jj 2013-08-27 11:06:09.256786405 +0200 +++ gcc/testsuite/gcc.c-torture/execute/pr57875.c 2013-08-27 11:04:58.000000000 +0200 @@ -0,0 +1,21 @@ +/* PR rtl-optimization/57875 */ + +extern void abort (void); +int a[1], b, c, d, f, i; +char e[1]; + +int +main () +{ + for (; i < 1; i++) + if (!d) + { + if (!c) + f = 2; + e[0] &= f ^= 0; + } + b = a[e[0] >> 1 & 1]; + if (b != 0) + abort (); + return 0; +} --- gcc/testsuite/gcc.c-torture/execute/pr57876.c.jj 2013-08-27 11:06:12.224775684 +0200 +++ gcc/testsuite/gcc.c-torture/execute/pr57876.c 2013-08-27 11:04:20.000000000 +0200 @@ -0,0 +1,27 @@ +/* PR rtl-optimization/57876 */ + +extern void abort (void); +int a, b = 1, c, *d = &c, f, *g, h, j; +static int e; + +int +main () +{ + int i; + for (i = 0; i < 2; i++) + { + long long k = b; + int l; + for (f = 0; f < 8; f++) + { + int *m = &e; + j = *d; + h = a * j - 1; + *m = (h == 0) < k; + g = &l; + } + } + if (e != 1) + abort (); + return 0; +} --- gcc/testsuite/gcc.c-torture/execute/pr57877.c.jj 2013-08-27 11:06:15.310759088 +0200 +++ gcc/testsuite/gcc.c-torture/execute/pr57877.c 2013-08-27 11:03:56.000000000 +0200 @@ -0,0 +1,28 @@ +/* PR rtl-optimization/57877 */ + +extern void abort (void); +int a, b, *c = &b, e, f = 6, g, h; +short d; + +static unsigned char +foo (unsigned long long p1, int *p2) +{ + for (; g <= 0; g++) + { + short *i = &d; + int *j = &e; + h = *c; + *i = h; + *j = (*i == *p2) < p1; + } + return 0; +} + +int +main () +{ + foo (f, &a); + if (e != 1) + abort (); + return 0; +}