From patchwork Fri Jun 10 01:10:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 99822 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 D2E08B6FE4 for ; Fri, 10 Jun 2011 11:10:38 +1000 (EST) Received: (qmail 21674 invoked by alias); 10 Jun 2011 01:10:36 -0000 Received: (qmail 21659 invoked by uid 22791); 10 Jun 2011 01:10:35 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from dair.pair.com (HELO dair.pair.com) (209.68.1.49) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Fri, 10 Jun 2011 01:10:19 +0000 Received: (qmail 69867 invoked by uid 20157); 10 Jun 2011 01:10:18 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 10 Jun 2011 01:10:18 -0000 Date: Thu, 9 Jun 2011 21:10:18 -0400 (EDT) From: Hans-Peter Nilsson To: "H.J. Lu" cc: vmakarov@redhat.com, gcc-patches@gcc.gnu.org Subject: Re: Fix PR49154-related SEGV in IRA. And ping. In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 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 On Thu, 9 Jun 2011, H.J. Lu wrote: > >        PR rtl-optimization/49154 > >        * ira-costs.c (setup_regno_cost_classes_by_mode): If there > >        already is a matching slot in the hashtable, assign it to > >        classes_ptr. > > > > This caused: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49354 Fixed. Cross-builds apparently don't include -Werror, meh. Tested by observing warning without, no warning with, committed as obvious. Thanks for keeping me honest. I'm just going to rant a little and say it's weird that we have to cast a "void *" to another pointer type, but such is C++ or whatever we're writing now. PR bootstrap/49354 * ira-costs.c (setup_regno_cost_classes_by_mode): Add missing cast to last assignment. brgds, H-P Index: ira-costs.c =================================================================== --- ira-costs.c (revision 174868) +++ ira-costs.c (working copy) @@ -300,7 +300,7 @@ setup_regno_cost_classes_by_mode (int re *slot = classes_ptr; } else - classes_ptr = *slot; + classes_ptr = (cost_classes_t) *slot; cost_classes_mode_cache[mode] = (cost_classes_t) *slot; } regno_cost_classes[regno] = classes_ptr;