From patchwork Fri Sep 15 10:45:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 814208 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-462218-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ffBcmzxL"; dkim-atps=neutral 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 3xtsWd2grqz9sxR for ; Fri, 15 Sep 2017 20:46:05 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=yWnhOqqbr5BNN3Zc0dLWTuAeddGQ+bjKXsn0RcLenxUd7YuSAwSAb YUyIBGFxDCM6XopWegrk6Dg7ko2gbyKZW0/rv593G+NW61qLC/xWiITiyCApNdha 3W7jju1pb3iCwKlbwvlcIiMEAoqjmC7L15EbiSQauqQw/pHFP8KqW0= 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:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=fG4CImiylK5Fd3oLq9rTeh5ErmM=; b=ffBcmzxL1dHHDBuNM4OI Y9dlyWvs6hkmpFzsj6/vg7Kq1L/zrnfELs3FRO4296Cm/FgYrhxqVbP6sBPbjaZJ 5/qg2PQzi4iXMqp2AVO8cSdcVN+sQ+70oM4a2T0O1iE5UIcZ+SdAQ3+T7frjfoLZ 7wbyv1AppvncbzadQXkTo4c= Received: (qmail 80030 invoked by alias); 15 Sep 2017 10:45:58 -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 80014 invoked by uid 89); 15 Sep 2017 10:45:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f44.google.com Received: from mail-wm0-f44.google.com (HELO mail-wm0-f44.google.com) (74.125.82.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Sep 2017 10:45:56 +0000 Received: by mail-wm0-f44.google.com with SMTP id e71so7198172wmg.4 for ; Fri, 15 Sep 2017 03:45:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:date:message-id :user-agent:mime-version; bh=47HdAK2rV+ukcubtZZAr8i2TOE/W00LDunj/6Xgqa8g=; b=RnMTcfmwUt/wv88p9h3PIdKe4JX21kjMv1O1PkcDJobLe9NRu5oc83mBtnS2b+axLY iVcPJTfSa3gBjd4seNDtbdXVne9FOdvHcynAOB1w9gWmc21lhq77+G/n9BZN2eGrq4JK 7if7TpQzIuvuSMNMHT/BzW3Q7vM7yI7tWhmuAcPrnjNAImziHb+kt72NXKYZDjxJNCHm JNeeGOo5S9pnL5LNrEir4Am6jDFznCUr+RvbvZRWs+YTRPHjcxnyFggIl1ki2PHT9Rvt 8QC3wlTNIr13N70IXU4x5X6qJWDI5aE/aVM/wG/e1AjvySy535ah04ga5wf51bDIdXXX PeRg== X-Gm-Message-State: AHPjjUiz3L6ltFTcm5vbDwH8C67+O7ORQvW1I6rLDc0NsYNNUjpLIx4Z zekT+Xf/j6AHNk915BMM3w== X-Google-Smtp-Source: AOwi7QCw1E4FSDfX+TQ/qb8VLKCbHbV4POak0SOGu8K/7JtIkVo+VBan6b5oE8pkGJt8cJkQVg3BQQ== X-Received: by 10.28.150.199 with SMTP id y190mr2535348wmd.51.1505472354674; Fri, 15 Sep 2017 03:45:54 -0700 (PDT) Received: from localhost (92.40.248.1.threembb.co.uk. [92.40.248.1]) by smtp.gmail.com with ESMTPSA id 69sm741387wmi.0.2017.09.15.03.45.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Sep 2017 03:45:54 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: Fix type of bitstart in vectorizable_live_operation Date: Fri, 15 Sep 2017 11:45:52 +0100 Message-ID: <87a81wnstb.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch changes the type of the multiplier applied by vectorizable_live_operation from unsigned_type_node to bitsizetype, which matches the type of TYPE_SIZE and is the type expected of a BIT_FIELD_REF bit position. This is shown by existing tests when SVE is added. Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu. OK to install? Richard 2017-09-15 Richard Sandiford Alan Hayward David Sherwood gcc/ * tree-vect-loop.c (vectorizable_live_operation): Fix type of bitstart. Index: gcc/tree-vect-loop.c =================================================================== --- gcc/tree-vect-loop.c 2017-09-15 11:37:45.639244036 +0100 +++ gcc/tree-vect-loop.c 2017-09-15 11:38:33.276424843 +0100 @@ -7090,7 +7090,7 @@ vectorizable_live_operation (gimple *stm vec_lhs = gimple_get_lhs (SLP_TREE_VEC_STMTS (slp_node)[vec_entry]); /* Get entry to use. */ - bitstart = build_int_cst (unsigned_type_node, vec_index); + bitstart = bitsize_int (vec_index); bitstart = int_const_binop (MULT_EXPR, bitsize, bitstart); } else