From patchwork Thu Jan 11 09:56:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 124180 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp450002qgn; Thu, 11 Jan 2018 01:56:28 -0800 (PST) X-Google-Smtp-Source: ACJfBos22mhk9InO4OQe6xHy4xDGRRaeye2plLR9DxOqr4wJIMZjy2f9oGT0TrlhKh+LNxN0hzme X-Received: by 10.159.247.12 with SMTP id d12mr22168446pls.277.1515664588739; Thu, 11 Jan 2018 01:56:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515664588; cv=none; d=google.com; s=arc-20160816; b=uo/dAbXyNdT5jOC/HfDJo3wVxRwkPqIBywfFQdlKnCEJ6dnRtkmFbVJ0AUyh1/1xXU 9he9WyIbk+P/5jlwvC9MUzwpeLWE1bVA4muJWGGK8twB4T61V/WOsOXDME5obJqTzqWM AeE6viOeHuZ+RZsTwxcU8+S3esuTzE2woVMmvNPZiCuap/IFC/HrCzV51XkzfE284N5z TiLbbRS1FmwL6BBCc8eR9nbkdyHwRapOVwC1kZt6dP5wrElkq0aNZ5U/ZVzQQiUP09pb EmI9Jby57b3ZDfD/lTh7ySCagFAqAogCSiU2CHGOZEWOi42iuDtTtCM0rdm0fSVK1r4f 5h9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:date:subject:mail-followup-to:to :from:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=C5mfAIGnZzjVV0wOZyr9TdAUgABMa1lGLtuRxQQ59sg=; b=v+06GWuLT0gEoENyy44kQRkHvoCmQGlJSLm8IdWRT6GH5FsTQN4cfIDZanNfn/An/R GVY8lJOd3VuKXDF2DAHokTz29GTR2ZP+nVwfU/9N68Ing+iWagzIFMsZrh18hrSsK1e8 RxZum0dlTdR34ZyVP37W6MUXVoBqVFKvXnbfuRZ+2pISDX5wRYX8Z9kZnFwKrH/tS3KN GlG8ITxhuLTKcSSMDESvkkcfmo9wXSCFz0vnjcIsruuAGHnvsDLwFMsmBRkW2Ibas74d fMHcS+c0wgE5IgLGuo1d41GtGyXk2uQKwVMRvd+axEzdrd98SsEcctJYUE5XVYcPU7VG M+sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=StUpA356; spf=pass (google.com: domain of gcc-patches-return-470814-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-470814-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y128si3755638pgb.55.2018.01.11.01.56.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jan 2018 01:56:28 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-470814-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 header.s=default header.b=StUpA356; spf=pass (google.com: domain of gcc-patches-return-470814-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-470814-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=aoiY0T4IUkgt8/ehqAspoaVxo4OMfzlLpV0pQCwLU8meEXAGmDb0U lKLodWCZ1nT8wlLESekXwmDeCwHidRzF0oJ9D3edSKCBhroPMpH+Wpp7ubHbZnYX UfWcofjeHSS191vajkUH7u9MrbH0yxTKLDE4cAmce0AGuKWvWJcpP0= 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=5p0OkEfWnmqkeOUoh1iGYGoGJRc=; b=StUpA356qMbNlnwALFJv fHmBZknPvVX9eEo2+0w2w4+KDC85rW8zVFVgODXdKgEf9wm22QBNK68mvdQy5wRu 482GtukiH1v0m/nNiTgq30gf6JPTjVx/H31OBGTF0l2ILCoZtVY2WBERy69/K0r0 gIw0l+w9T96huN+zjP3t3Tc= Received: (qmail 49448 invoked by alias); 11 Jan 2018 09:56:17 -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 49408 invoked by uid 89); 11 Jan 2018 09:56:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-12.0 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; Thu, 11 Jan 2018 09:56:14 +0000 Received: by mail-wm0-f44.google.com with SMTP id g1so4231355wmg.2 for ; Thu, 11 Jan 2018 01:56:14 -0800 (PST) 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=C5mfAIGnZzjVV0wOZyr9TdAUgABMa1lGLtuRxQQ59sg=; b=LcwhQQtVPBEn2ageDdbWkUN0d3KX1q3xL9COaAuR5NKMkRjFavI1xT5NLlE17MBpug Vln9Nd5jztUmgMMB8xCXSXCjQBZ3pSj3szSz5NAkw+Rl8m7VvoNLNsrAJDb4bm5Y+Ern hYvas54npqHwgdrvTI2rw8IR5KgGwKnbC74JaxEvUh63M9s1LXiIMpCXYKi2z20jTuKp vJjNxa1uHwIGaJ5reDd4NypXUBUseNcXBNaSvBk6DMu8fWSyacvdgkv+85gsC8EPeL8P lC8PBiQZ+Fj/Ze+7JHQBvLymkScy9B/EzKSa3dvHvr8DYB13KJWVE+myKzmMMoxeyuGB mAzQ== X-Gm-Message-State: AKwxyteqf3VtJrpct/YT73ul99GmPtX+HsoBtQqdtpzdJOjBRZf0keSG Oqt/T360iD1uAMvwm9apT2CdRWzNPGo= X-Received: by 10.28.143.204 with SMTP id r195mr656393wmd.51.1515664572258; Thu, 11 Jan 2018 01:56:12 -0800 (PST) Received: from localhost ([95.144.14.233]) by smtp.gmail.com with ESMTPSA id h2sm10924234wrf.54.2018.01.11.01.56.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jan 2018 01:56:11 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [committed] Fix mode_for_size units in caller-save.c (PR83761) Date: Thu, 11 Jan 2018 09:56:10 +0000 Message-ID: <87lgh4soqt.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 The new opt_mode asserts triggered for replace_reg_with_saved_mem because it was passing bytes rather than bits to mode_for_size. Previously we ended up with a BLKmode register instead, but presumably that didn't matter because this is "only" used for debug insns. Tested on bfin-elf (as far as possible); this code isn't used for LRA targets. Applied as obvious. Richard 2018-01-11 Richard Sandiford gcc/ PR rtl-optimization/83761 * caller-save.c (replace_reg_with_saved_mem): Pass bits rather than bytes to mode_for_size. Index: gcc/caller-save.c =================================================================== --- gcc/caller-save.c 2018-01-03 21:42:44.552647435 +0000 +++ gcc/caller-save.c 2018-01-11 09:49:29.873718858 +0000 @@ -1147,7 +1147,8 @@ replace_reg_with_saved_mem (rtx *loc, machine_mode smode = save_mode[regno]; gcc_assert (smode != VOIDmode); if (hard_regno_nregs (regno, smode) > 1) - smode = mode_for_size (exact_div (GET_MODE_SIZE (mode), nregs), + smode = mode_for_size (exact_div (GET_MODE_BITSIZE (mode), + nregs), GET_MODE_CLASS (mode), 0).require (); XVECEXP (mem, 0, i) = gen_rtx_REG (smode, regno + i); }