From patchwork Wed Nov 2 15:13:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrill Tkachov X-Patchwork-Id: 80491 Delivered-To: patch@linaro.org Received: by 10.80.170.210 with SMTP id r18csp165623edc; Wed, 2 Nov 2016 08:14:02 -0700 (PDT) X-Received: by 10.98.38.199 with SMTP id m190mr7830641pfm.45.1478099642753; Wed, 02 Nov 2016 08:14:02 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id zs7si3003604pac.45.2016.11.02.08.14.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Nov 2016 08:14:02 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-440206-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-440206-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-440206-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=IR21a4JCnq8QfOZzcAVeNWmKV89gYEYfcBPx5Tis9Yk HFngubZTKl/g4sAITiPK3odQVQgYJIJsdtbFDFjby2CrzLBTQzTYOF7IPSD38M34 qnGJ2YvSZiL2qjpkTul4gIWjn/xkfuNOZQXKpSSs/QW5WtUykm02huTWbCetryc8 = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=7j8osTI799ZYNHOZFzqrFHnolM0=; b=tDSLCbAO2oU8YIR13 lDyJKVDpAS/B63sb7P5wiXXqpRPSGnoT1wONpJ8yuMsCYn9Smtx61Wwm1wNp8/La n5nPP3akcbpoYREwP62/2FbI9PYRpRJfDVeRJfblETcwpL5KkyRvVb6X16CHl6Hw lQu7aXuzXqm6ywuOKF8DtDiSoI= Received: (qmail 83964 invoked by alias); 2 Nov 2016 15:13:45 -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 83374 invoked by uid 89); 2 Nov 2016 15:13:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=4307 X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 Nov 2016 15:13:35 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 967C428; Wed, 2 Nov 2016 08:13:32 -0700 (PDT) Received: from [10.2.207.77] (e100706-lin.cambridge.arm.com [10.2.207.77]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ED4393F41F; Wed, 2 Nov 2016 08:13:31 -0700 (PDT) Message-ID: <581A029A.6010401@foss.arm.com> Date: Wed, 02 Nov 2016 15:13:30 +0000 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: GCC Patches CC: Richard Biener , David Edelsohn Subject: [PATCH] Fix for big-endian gcc.c-torture/execute/pr55750.c Hi all, I noticed that my patch for PR tree-optimization/78170 broke execute.exp=pr55750.c on big-endian. The problem with that patch is that we should not forget to clear the padding bits in the temporary buffer when merging values even when they are less than a byte. Tested on aarch64_be-none-elf (the test failure goes away) Bootstrap and test on x86_64 ongoing. Ok for trunk if successful? David, does this patch allow AIX bootstrap to proceed by any chance? Thanks, Kyrill 2016-11-02 Kyrylo Tkachov * gimple-ssa-store-merging.c (encode_tree_to_bitpos): Don't forget to clear padding bits even when they're less than a byte. diff --git a/gcc/gimple-ssa-store-merging.c b/gcc/gimple-ssa-store-merging.c index 081620e50f603e2de8ed962aec6c619890ce1e33..db3c3c14a5b8938024db8bed80145c77d29396ac 100644 --- a/gcc/gimple-ssa-store-merging.c +++ b/gcc/gimple-ssa-store-merging.c @@ -430,7 +430,8 @@ encode_tree_to_bitpos (tree expr, unsigned char *ptr, int bitlen, int bitpos, contain a sign bit due to sign-extension). */ unsigned int padding = byte_size - ROUND_UP (bitlen, BITS_PER_UNIT) / BITS_PER_UNIT - 1; - if (padding != 0) + if (padding != 0 + || bitlen % BITS_PER_UNIT != 0) { /* On big-endian the padding is at the 'front' so just skip the initial bytes. */