From patchwork Thu Jun 26 13:43:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 364546 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 ABE6C14009B for ; Thu, 26 Jun 2014 23:43:51 +1000 (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:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; q=dns; s= default; b=IpfY9Mcne49Yj8JD6NiDmMFma5aIo6HBnaOBOui/tPk89K8LtfcSv k36fJdqLj8r5rudVoJeXajhpWHzMIniH9D8iLxX0FUsJmxRQO9341AUT++vUcmMM c0bfnNDHAgOuYtEKhUFTCQ+jUe/B6INzckuuQteKDy2ga3E1Gp+B3g= 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:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=default; bh=pZr3AXPePB6fFYQUXUEDQ0D7wUM=; b=KraYupl3MD/mXI1caOOzoJ75qNnG 7A2wMohprVzURndi7oDxjKXpeCOiSolRMvthxoMauKmvlp9zjRUZO/oS3h+w2GdZ S8oFK4u4l0aMkQrgvy5q9eWq0Q/ttxfOWAom54reWrefjU0b4FCnPpuTkaz4spoD Jp9cOqMvLl5gd4E= Received: (qmail 1608 invoked by alias); 26 Jun 2014 13:43:44 -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 1599 invoked by uid 89); 26 Jun 2014 13:43:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 26 Jun 2014 13:43:38 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id AB73B75014; Thu, 26 Jun 2014 13:43:35 +0000 (UTC) Message-ID: <53AC2386.3030309@suse.cz> Date: Thu, 26 Jun 2014 15:43:34 +0200 From: =?UTF-8?B?TWFydGluIExpxaFrYQ==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Richard Biener CC: GCC Patches , David Li Subject: Re: [PATCH] Devirtualization dump functions fix References: <53AC19A7.9020907@suse.cz> In-Reply-To: X-IsSubscribed: yes On 06/26/2014 03:20 PM, Richard Biener wrote: > On Thu, Jun 26, 2014 at 3:01 PM, Martin Liška wrote: >> Hello, >> I encountered similar issue to PR ipa/61462 where location_t locus = >> gimple_location (e->call_stmt) is called for e->call_stmt == NULL (Firefox >> with -flto -fdump-ipa-devirt). So that, I decided to introduce new function >> that is called for all potentially unsafe locations. I am wondering if a >> newly added function can be added in more seamless way (without playing with >> va_list and ATTRIBUTE_PRINTF stuff)? >> >> Bootstrapped and regtested on x86_64-unknown-linux-gnu. > Hmm, I don't like that very much - dump_printf_loc_for_stmt still implies > stmt is not NULL. So you could have "fixed" gimple_location as well. > I suppose dump_printf_loc already does sth sane with UNKNOWN_LOCATION. > > Richard. Hi, you are right that it is quite complex change. Do you mean this one line change can be sufficient ? I will double-check if it solves the problem ;) Martin > >> Thanks, >> Martin >> >> ChangeLog: >> >> 2014-06-26 Martin Liska >> >> * include/ansidecl.h: New collection of ATTRIBUTE_NULL_PRINTF_X_0 >> defined. >> >> gcc/ChangeLog: >> >> 2014-06-26 Martin Liska >> >> * dumpfile.h: New function dump_printf_loc_for_stmt. >> * dumpfile.c: Implementation added. >> (dump_vprintf): New function.i >> * cgraphunit.c: dump_printf_loc_for_stmt usage replaces >> dump_printf_loc. >> * gimple-fold.c: Likewise. >> * ipa-devirt.c: Likewise. >> * ipa-prop.c: Likewise. >> * ipa.c: Likewise. >> * tree-ssa-pre.c: Likewise. >> >> >> >> diff --git a/gcc/gimple.h b/gcc/gimple.h index ceefbc0..954195e 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -1498,7 +1498,7 @@ gimple_set_block (gimple g, tree block) static inline location_t gimple_location (const_gimple g) { - return g->location; + return g ? g->location : UNKNOWN_LOCATION; } /* Return pointer to location information for statement G. */