From patchwork Tue Jul 7 12:37:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Lawrence X-Patchwork-Id: 492179 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 320E21402B8 for ; Tue, 7 Jul 2015 22:38:19 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=uiE6ky8R; 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 :message-id:date:from:mime-version:to:cc:subject:in-reply-to :content-type; q=dns; s=default; b=sJ7ydeG+1Xi80DyqDyEwBqEAh2dsB Iw6XACrOQ3TrKnLQy46m424PkfI4EWN3H/ibvVkGjyYD8yJN+IbBbwYulpYNlzE/ 7+DQv1luY4uPm9gNxla5jc5tQ8kiWJfH+QPnnKIgE8ywVy5rmL2eFeyoz8VXhW2Z vaQCWeL2mi8ono= 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:in-reply-to :content-type; s=default; bh=wolIeMvvoJb1ca9E/5Qxjo/l110=; b=uiE 6ky8RVojF1oXfEloxYE1r1GmZjj9MPG2Qn6cO23mWdnboWN+GfX6HrayUjpdxgEr nZ00w8F6xo7l25SomWsT19ALaj4Y2tJgYxZixtRNhC2+G/wsd7U3KC68Goo+yo7X CEQBP1OLdX1vgLVrtK1elxwK1w2JdvohP41BtUp8= Received: (qmail 113883 invoked by alias); 7 Jul 2015 12:37:38 -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 113816 invoked by uid 89); 7 Jul 2015 12:37:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Jul 2015 12:37:36 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-21-l3cH8CVESUyT9wb1d9uNDA-1 Received: from [10.2.207.65] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 7 Jul 2015 13:37:31 +0100 Message-ID: <559BC80B.4060608@arm.com> Date: Tue, 07 Jul 2015 13:37:31 +0100 From: Alan Lawrence User-Agent: Thunderbird 2.0.0.24 (X11/20101213) MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jakub Jelinek Subject: [PATCH 15/16][fold-const.c] Fix bigendian HFmode in native_interpret_real In-Reply-To: <559BC6EC.3000907@arm.com> X-MC-Unique: l3cH8CVESUyT9wb1d9uNDA-1 X-IsSubscribed: yes As per https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01346.html. Fixes FAIL of advsimd-intrinsics vcreate.c on aarch64_be-none-elf from previous patch. commit e2e7ca148960a82fc88128820f17e7cbd14173cb Author: Alan Lawrence Date: Thu Apr 9 10:54:40 2015 +0100 Fix native_interpret_real for HFmode floats on Bigendian with UNITS_PER_WORD>=4 (with missing space) diff --git a/gcc/fold-const.c b/gcc/fold-const.c index e61d946..15a10f0 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -7622,7 +7622,7 @@ native_interpret_real (tree type, const unsigned char *ptr, int len) offset += byte % UNITS_PER_WORD; } else - offset = BYTES_BIG_ENDIAN ? 3 - byte : byte; + offset = BYTES_BIG_ENDIAN ? MIN (3, total_bytes - 1) - byte : byte; value = ptr[offset + ((bitpos / BITS_PER_UNIT) & ~3)]; tmp[bitpos / 32] |= (unsigned long)value << (bitpos & 31);