From patchwork Thu Mar 17 00:03:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 598861 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 3qQT8Q1wSnz9ssP for ; Thu, 17 Mar 2016 11:03:16 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=q42YqVeU; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=tYp4zIHVlWRnibTiGbijq5KGMQqbC4IRyTp6iwdcq8qXnjyRyY 5g7APfUMTJUErVwREWB9M5ZZALTPH8Ize5QZnj3gl2ZnsaC/8WO58/aw8bKo09om rirJ2FNaWB8vM03TqQUEzA0lH8UCC8Jm00wiVm2dn+n3JlDmUiEZXQWWI= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=ZkaNu+OqpMulcuPZCWsjdZ5YRFk=; b=q42YqVeUacP4Q+YLPC+L 3/9c1iDzk2YCXO4buUa+h0A6sOfToKn3AlayuMcQiMSXY/p6YFhzWB2fR9WCTsEH bocraqThNMKmnVzWIT3on6rxygdrlHpG1qnyZKDdDVMY7sYMG2vogwAV9hcEg9xd DaIKDtq8GHX18mYyxbDi3VM= Received: (qmail 126616 invoked by alias); 17 Mar 2016 00:03:08 -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 126595 invoked by uid 89); 17 Mar 2016 00:03:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 spammy=MIN, 1, 26, 1469, keeps X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 17 Mar 2016 00:03:06 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 398167F080 for ; Thu, 17 Mar 2016 00:03:05 +0000 (UTC) Received: from bigtime.twiddle.net (ovpn-113-67.phx2.redhat.com [10.3.113.67]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2H0347B029102 for ; Wed, 16 Mar 2016 20:03:04 -0400 To: gcc-patches@gcc.gnu.org From: Richard Henderson Subject: [COMMITTED] Fix 70240 Message-ID: <56E9F437.7010607@redhat.com> Date: Wed, 16 Mar 2016 17:03:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 X-IsSubscribed: yes As discussed in the PR, the fix for 68215 was a bit too aggressive and caused this one. There's a simple alternate fix, first suggested by Richi in 68714, that cures both. Thus I apply one patch and revert another, in order, so that nothing breaks in between yet keeps the two commits separate. Tested on i686 and x86_64 linux. Committed as approved in the PR, r~ PR middle-end/70240 * gcc.c-torture/compile/pr70240.c: New. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr70240.c b/gcc/testsuite/gcc.c-torture/compile/pr70240.c new file mode 100644 index 0000000..830d4dd --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr70240.c @@ -0,0 +1,26 @@ +typedef short v16hi __attribute__ ((vector_size (32))); +typedef int v8si __attribute__ ((vector_size (32))); +typedef long long v4di __attribute__ ((vector_size (32))); + +int +foo(int u16_0, int u32_0, int u64_0, int u16_1, int u32_1, int u64_1, v16hi v32u16_0, v8si v32u32_0, v4di v32u64_0, v16hi v32u16_1, v8si v32u32_1, v4di v32u64_1) +{ + do { + v32u16_1 += (v16hi){ v32u32_1[7], ~v32u32_1[3], 0, v32u64_0[0]}; + u32_0 = (u32_0 << 31) | (u32_0 >> ~v32u32_0[1]); + u64_0 += 1; + v32u64_0[2] <<= v32u64_0[2] & 63; + u16_1 = (u16_1 >> (v32u16_0[11] & 15)) | (u16_1 << (-v32u16_0[11] & 15)); + v32u16_0 -= ~v32u16_1; + v32u32_1[5] += u32_1; + if (v32u32_1[3] >= 0) { + u64_1 -= ~v32u64_1[1]; + v32u16_1 += (v16hi){ -u64_1, ~u32_0, ~u16_1, v32u32_1[1], 0, ~v32u16_1[2], ~v32u64_1[2], ~v32u32_0[7]}; + } + v32u64_1 += (v4di){0, 0, ~v32u32_0[5]}; + v32u32_1 *= (v8si){0, ~v32u32_1[6]}; + v32u64_0[3] &= 0x1234; + v32u64_0 += (v4di){v32u32_1[6]}; + } while (u16_0 < 0x1234); + return u64_0 + u16_1; +} -- 2.1.0