From patchwork Thu Feb 11 09:33:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 581784 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 6DA481402A8 for ; Thu, 11 Feb 2016 20:34:01 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=aSQi9Oiy; 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:subject:from:to:date:content-type:mime-version; q= dns; s=default; b=cN4WOxAgZbI5vDFCZofMJgSkgqcin8m4vS8fDiGW4BRJ8H 0Kh0xkqdJO09mpd4JdAPMXqQWhSTL6cxEx8vf8RTy2rbdtHYcqewCu3/3+yhThik kbztYnnOVWcuyGGHjPetdbP6CnqaSfL/eC+60xdMKnaX4ZKTMT4BUxxhEWhOg= 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:subject:from:to:date:content-type:mime-version; s= default; bh=nWS2zZaHWw/+8VMGqAPFKSMmDqQ=; b=aSQi9OiyxoKt2WhrVaD4 K3IG+ExJd2ZMjj+b/SJewPZ9n6fY7K+7DcYJineebJ24vV7KrbrN7J5CCX97FmqC wpCOBiMVpO1xxmlYw+jgiSGeOMU1Ohx17QE6GR390iL8bTYbXJ8zsl+2JZ3GlFD0 BexkBuN9ojwiHEERrWNxxyE= Received: (qmail 119030 invoked by alias); 11 Feb 2016 09:33:54 -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 119007 invoked by uid 89); 11 Feb 2016 09:33:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.1 required=5.0 tests=AWL, BAYES_20, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*MI:217, H*M:217, H*M:online, H*MI:online X-HELO: mailout10.t-online.de Received: from mailout10.t-online.de (HELO mailout10.t-online.de) (194.25.134.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 11 Feb 2016 09:33:50 +0000 Received: from fwd09.aul.t-online.de (fwd09.aul.t-online.de [172.20.27.151]) by mailout10.t-online.de (Postfix) with SMTP id B45D74B3492 for ; Thu, 11 Feb 2016 10:33:44 +0100 (CET) Received: from [192.168.0.16] (TEv-VuZS8hBedTNuhlbRBV6TosoJ83irAF8qTRosWCBd-hZ6bMBtmvh-DDTHTUKwZp@[115.165.93.200]) by fwd09.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1aTnd8-1XifWC0; Thu, 11 Feb 2016 10:33:42 +0100 Message-ID: <1455183220.2124.217.camel@t-online.de> Subject: [SH][committed] Fix PR 69713 From: Oleg Endo To: gcc-patches Date: Thu, 11 Feb 2016 18:33:40 +0900 Mime-Version: 1.0 X-IsSubscribed: yes Hi, The attached patch fixes PR 69713. For details please see the comments in the PR. Tested on trunk and sh-elf with make -k check RUNTESTFLAGS="--target_board=sh-sim\{-m2/-ml,-m2/-mb, -m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}" Committed to trunk as r233324, 5 branch as r233326 and 4.9 branch as r233329. Cheers, Oleg gcc/ChangeLog PR target/69713 * config/sh/sh.md (casesi_worker_0): Add T_REG use. Index: gcc/config/sh/sh.md =================================================================== --- gcc/config/sh/sh.md (revision 233314) +++ gcc/config/sh/sh.md (working copy) @@ -11707,12 +11707,16 @@ ;; ??? reload might clobber r0 if we use it explicitly in the RTL before ;; reload; using a R0_REGS pseudo reg is likely to give poor code. ;; So we keep the use of r0 hidden in a R0_REGS clobber until after reload. +;; +;; The use on the T_REG in the casesi_worker* patterns links the bounds +;; checking insns and the table memory access. See also PR 69713. (define_insn "casesi_worker_0" [(set (match_operand:SI 0 "register_operand" "=r,r") (unspec:SI [(match_operand:SI 1 "register_operand" "0,r") (label_ref (match_operand 2 "" ""))] UNSPEC_CASESI)) (clobber (match_scratch:SI 3 "=X,1")) - (clobber (match_scratch:SI 4 "=&z,z"))] + (clobber (match_scratch:SI 4 "=&z,z")) + (use (reg:SI T_REG))] "TARGET_SH1" "#") @@ -11721,7 +11725,8 @@ (unspec:SI [(match_operand:SI 1 "register_operand" "") (label_ref (match_operand 2 "" ""))] UNSPEC_CASESI)) (clobber (match_scratch:SI 3 "")) - (clobber (match_scratch:SI 4 ""))] + (clobber (match_scratch:SI 4)) + (use (reg:SI T_REG))] "TARGET_SH1 && ! TARGET_SH2 && reload_completed" [(set (reg:SI R0_REG) (unspec:SI [(label_ref (match_dup 2))] UNSPEC_MOVA)) (parallel [(set (match_dup 0) @@ -11739,7 +11744,8 @@ (unspec:SI [(match_operand:SI 1 "register_operand" "") (label_ref (match_operand 2 "" ""))] UNSPEC_CASESI)) (clobber (match_scratch:SI 3 "")) - (clobber (match_scratch:SI 4 ""))] + (clobber (match_scratch:SI 4)) + (use (reg:SI T_REG))] "TARGET_SH2 && reload_completed" [(set (reg:SI R0_REG) (unspec:SI [(label_ref (match_dup 2))] UNSPEC_MOVA)) (parallel [(set (match_dup 0)