From patchwork Sat Sep 14 15:15:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Rashish X-Patchwork-Id: 1162340 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-509005-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sdf.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="sFIfHyie"; 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 46Vx0D2cKvz9s7T for ; Sun, 15 Sep 2019 01:15:38 +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:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=ogT2eXQOgng5Z+NryaGPUJC2OVFkSTbQci4TW0wUXs1AohH5djTZT qkdGcpPN1YDb6SFWvfSn0Suj9qTVk9HmysrZ5bc1fvKw+g6zrVoNn24CdcHfeXou IjZsXA8c8t/oFQRMJOfS96/RpvJP1tX2ungfaBJcWmbualswarwcrM= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=lJWCKN43ZTs9BcdBUO2KxveuoVs=; b=sFIfHyiejnSxGDNbtZDD dwEd3YgonCC4E+pTMSPFJUvj2U/wdFYP54Ikepcbl6rpiH9e4+nolqx+SGJa1AkU uf2hZH+eblAeDXRQdOVvEBDxG7UC3kCjXkrJq+BNs3juhTBry+4n+zfsOOc4Xble RmTfrTkdt4snDZkgTzlIWUQ= Received: (qmail 112867 invoked by alias); 14 Sep 2019 15:15:18 -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 112832 invoked by uid 89); 14 Sep 2019 15:15:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=maya, Maya X-HELO: mx.sdf.org Received: from mx.sdf.org (HELO mx.sdf.org) (205.166.94.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 14 Sep 2019 15:15:15 +0000 Received: from sdf.org (IDENT:coypu@faeroes.freeshell.org [205.166.94.9]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id x8EFF5ve020435 (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits) verified NO) for ; Sat, 14 Sep 2019 15:15:05 GMT Received: (from coypu@localhost) by sdf.org (8.15.2/8.12.8/Submit) id x8EFF4qd023308 for gcc-patches@gcc.gnu.org; Sat, 14 Sep 2019 15:15:04 GMT Date: Sat, 14 Sep 2019 15:15:04 +0000 From: coypu@sdf.org To: gcc-patches@gcc.gnu.org Subject: [PR target/85401] initialize the move cost table before using it Message-ID: <20190914151504.GA21805@SDF.ORG> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.12.1 (2019-06-15) This seems to be the way the rest of ira-color.c does it. I hope it's OK. It does fix the segfault. 2019-09-10 Maya Rashish PR target/85401 * ira-color.c: (allocno_copy_cost_saving) Call ira_init_register_move_cost_if_necessary diff --git a/gcc/ira-color.c b/gcc/ira-color.c index 99236994d64..5d721102e19 100644 --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -2828,6 +2828,7 @@ allocno_copy_cost_saving (ira_allocno_t allocno, int hard_regno) } else gcc_unreachable (); + ira_init_register_move_cost_if_necessary(allocno_mode); cost += cp->freq * ira_register_move_cost[allocno_mode][rclass][rclass]; } return cost;