From patchwork Fri Aug 10 00:45:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 176303 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]) by ozlabs.org (Postfix) with SMTP id 7A7B52C00A7 for ; Fri, 10 Aug 2012 10:45:51 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1345164352; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:Message-Id:From:To:Subject:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=AWVNVu3YjzNuScZG2GwAav9N/94=; b=OqF0D3WhTee/BnZ++nbLZgnxWcjQZhlKSRCJzzoLflYu0DJw+F+ZGrwDonWn+C G4LUjbOF4nSAMWLQHbcSWY9m1i6B4acnfNh0Rz65JWm+Apwgl9gmRaMvLfOZ5sCX muGaBhXP6cIWm4yVcOShI+Awq+c19ztaa73nNdz6uRKok= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:Message-Id:From:To:Subject:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ImP9YPdawQRyId873TRmfEhS/01gAj5yxL4xeg+ftbykq283EMfx5zsh+iZgZk s67u5+0JnC0d2dOxqagUownT7p5X5tS5RIh5zlYmgfx+1zsALhoIwxieMa9lOe5p U0dMR+xCvcADgTUL8qwrmCMoDwyoH9dDDlQVTr6bXDPRk=; Received: (qmail 13973 invoked by alias); 10 Aug 2012 00:45:48 -0000 Received: (qmail 13964 invoked by uid 22791); 10 Aug 2012 00:45:48 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Aug 2012 00:45:34 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7A0jY4m018677 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 Aug 2012 20:45:34 -0400 Received: from greed.delorie.com (ovpn-113-35.phx2.redhat.com [10.3.113.35]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7A0jX6R027516 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 9 Aug 2012 20:45:33 -0400 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.14.4/8.14.4) with ESMTP id q7A0jWZE016706 for ; Thu, 9 Aug 2012 20:45:32 -0400 Received: (from dj@localhost) by greed.delorie.com (8.14.4/8.14.4/Submit) id q7A0jWm9016705; Thu, 9 Aug 2012 20:45:32 -0400 Date: Thu, 9 Aug 2012 20:45:32 -0400 Message-Id: <201208100045.q7A0jWm9016705@greed.delorie.com> From: DJ Delorie To: gcc-patches@gcc.gnu.org Subject: [rl78] add some checks X-IsSubscribed: yes 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 RTL checking pointed out a couple of cases where rl78.c was extracting info from rtx without checking the rtx type first. Applied. 2012-08-09 DJ Delorie * config/rl78/rl78.c (rl78_alloc_physical_registers): Check for SET before extracting SET_SRC. (rl78_remove_unused_sets): Check for REG before extractnig REGNO. Index: config/rl78/rl78.c =================================================================== --- config/rl78/rl78.c (revision 190277) +++ config/rl78/rl78.c (working copy) @@ -2217,7 +2217,8 @@ && GET_CODE (PATTERN (insn)) != CALL) continue; - if (GET_CODE (SET_SRC (PATTERN (insn))) == ASM_OPERANDS) + if (GET_CODE (PATTERN (insn)) == SET + && GET_CODE (SET_SRC (PATTERN (insn))) == ASM_OPERANDS) continue; valloc_method = get_attr_valloc (insn); @@ -2644,7 +2645,7 @@ dest = SET_DEST (insn); - if (REGNO (dest) > 23) + if (GET_CODE (dest) != REG || REGNO (dest) > 23) continue; if (find_regno_note (insn, REG_UNUSED, REGNO (dest)))