From patchwork Mon Oct 21 23:00:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Belinassi X-Patchwork-Id: 1180914 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-511464-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=usp.br Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="LETOsPmh"; dkim=pass (2048-bit key; unprotected) header.d=usp-br.20150623.gappssmtp.com header.i=@usp-br.20150623.gappssmtp.com header.b="0fhQshiN"; 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 46xsYn5R6sz9sP3 for ; Tue, 22 Oct 2019 10:00:43 +1100 (AEDT) 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=OMYqjuAFibuofYRPEKW14c/KoRSmc64C17xuaNIC3yv4s+AagISPY tbPAZTxaxcyRRs9KQR9IJ9qOO2T705y4y5wB0JimvwdmxZLwzFxQ2ZDHDMyb76WT f+NLlilQVEGomD9meBO2lsicl82bFij5mk3/1a65e2v6dhGRChCR3o= 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=0n5/ChI67Rk3PJiHFjkUHa8DawY=; b=LETOsPmhYj/diacLFv9s rt0DBxijHGDxaJS3vG1zyHTgARFdP0G4G+rxgwu41aYIELFRYj1GVmb+SvbeGAT9 d+4lbprsO31duLUyFdmopHsVpIWqkksiSOr3S2YIpYlRAti8hPPWywjk1TWbRgyH f6vwlbVwrGZEP5J1v/TiU3M= Received: (qmail 15519 invoked by alias); 21 Oct 2019 23:00:35 -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 15451 invoked by uid 89); 21 Oct 2019 23:00:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=H*p:D*br, H*F:D*br, H*M:smtp X-HELO: mail-qk1-f169.google.com Received: from mail-qk1-f169.google.com (HELO mail-qk1-f169.google.com) (209.85.222.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Oct 2019 23:00:27 +0000 Received: by mail-qk1-f169.google.com with SMTP id u22so14419600qkk.11 for ; Mon, 21 Oct 2019 16:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=usp-br.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=Bp2tE5A5XPbWmqBCH6wp6KIioptJgFVmy5nlNmLRL0Q=; b=0fhQshiNZv068qZkw3jC5M/gMQsv1IrJVaZPPIwpI0Oj2mnqj4wz1+xWTOPG/br1EB TX/+3RWFZpuBnkhJDzT6RkH2W3UI+Lkhp8550qGTZmG5/nrqCFeo80j8n72F3vn8twMm 8dONjP/abp9U2RFYab9r0CjrrkETHuBlVKxvDPoMG8GXgE+C7k+uTbC2eFfUku+mucZY gAywo+tOHl/fVMz98dU5LUqNbg20BWsdix8zLJo6seW5XqsZ5s3HnW7k/MCbARacXaCx kUIMiEkH92L92ubhGXDlY1X5VIz/omVVw8WYAyfC1evButUFT3xjByxgCKDvUYUMGxCG 2SrA== Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id j22sm3669291qtn.78.2019.10.21.16.00.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 16:00:23 -0700 (PDT) Date: Mon, 21 Oct 2019 20:00:20 -0300 From: Giuliano Belinassi To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix incorrect merge of conflictant names in `dump_graphviz` Message-ID: <20191021230020.7jv4duuonpz5vb2y@smtp.gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20180716 X-IsSubscribed: yes Hi, When using lto-dump -callgraph with two or more .o files containing distinct functions with the same name, dump_graphviz incorrectly merged those functions into a single node. This patch fixes this issue by calling `dump_name` instead of `name`, therefore concat'ing the function name with the node's id. To understeand what was the issue, let's say you have two files: a.c: static void foo (void) { do_something (); } b.c: static void foo (void) { do_something_else (); } There are distinct functions and should be represented as distinct nodes in the callgraph dump. Is it ok for me to commit it in trunk as trivial? And is there something special that I should know before doing a commit into trunk? gcc/ChangeLog: 2019-07-22 Giuliano Belinassi * cgraph.c (dump_graphviz): Change name to dump_name Giuliano. diff --git gcc/cgraph.c gcc/cgraph.c index 8b752d83809..671306db5ca 100644 --- gcc/cgraph.c +++ gcc/cgraph.c @@ -2155,7 +2155,7 @@ cgraph_node::dump_graphviz (FILE *f) { cgraph_node *callee = edge->callee; - fprintf (f, "\t\"%s\" -> \"%s\"\n", name (), callee->name ()); + fprintf (f, "\t\"%s\" -> \"%s\"\n", dump_name (), callee->dump_name ()); } }