From patchwork Tue Nov 12 21:36:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 290778 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0F2D62C00BB for ; Wed, 13 Nov 2013 08:36:32 +1100 (EST) 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:subject:content-type; q= dns; s=default; b=SaTz0619QwNBEuv38zyxBTdDecCCFNx/MQ1dqp6TpaURP0 RhFxDUMJt/swAd6mdrYfRNJ5Z4s5yETlVizN7qIhVYHLLeqLOW2AN7+JY2Q/XzqU G+4wIMyOQQfpMjWRZsKynyAqvyJyiE0XIPbLU/VuF9GmJ40Vsnsw3Q6Y8Nlpg= 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:subject:content-type; s= default; bh=i89NOEc7xNnY9gWvUPL5W9+kAwo=; b=SHQD95TaCuuuNMueQVVy 6t3hcV10x2fMK2NbTvUz1irZA29z74MhaS8Kk110q1B55wQaXBf11RkOs0r6m3wd gm+7QELY86dzq8b+Yr53C+M1O+tkzkkAL8tox6QhpVyY8n2tsSfEkmRsQ4niiVDW lVga2SmG+pRsLt5qZRl/zd8= Received: (qmail 7222 invoked by alias); 12 Nov 2013 21:36:14 -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 7186 invoked by uid 89); 12 Nov 2013 21:36:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL, BAYES_00, RDNS_NONE, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Nov 2013 21:36:12 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rACLa5IM020269 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 12 Nov 2013 16:36:05 -0500 Received: from topor.usersys.redhat.com ([10.15.16.142]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rACLa5ut024856 for ; Tue, 12 Nov 2013 16:36:05 -0500 Message-ID: <52829F45.1070106@redhat.com> Date: Tue, 12 Nov 2013 16:36:05 -0500 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: gcc-patches Subject: patch to fix PR58712 X-IsSubscribed: yes The following patch fixes usage of an uninitialized value in record_operand_costs: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58712 The single set insn might have less 2 operands, e.g. x86_fnstcw_1. Committed as rev. 204720. 2013-11-12 Vladimir Makarov PR other/58712 * ira-costs.c (record_operand_costs): Check operands number for the single set. Index: ira-costs.c =================================================================== --- ira-costs.c (revision 204594) +++ ira-costs.c (working copy) @@ -1224,6 +1224,9 @@ record_operand_costs (rtx insn, enum reg preferred class is very expensive as the source of a copy instruction. */ if ((set = single_set (insn)) != NULL_RTX + /* In rare cases the single set insn might have less 2 operands + as the source can be a fixed special reg. */ + && recog_data.n_operands > 1 && ops[0] == SET_DEST (set) && ops[1] == SET_SRC (set)) { int regno, other_regno;