[{"id":1771635,"web_url":"http://patchwork.ozlabs.org/comment/1771635/","msgid":"<c8a25c5f-c3cc-fe67-3314-b3df8a45c2e9@suse.cz>","list_archive_url":null,"date":"2017-09-20T06:59:34","subject":"Re: [RFC][PATCH] ipa: fix dumping with deleted multiversioning nodes","submitter":{"id":62010,"url":"http://patchwork.ozlabs.org/api/people/62010/","name":"Martin Liška","email":"mliska@suse.cz"},"content":"On 09/18/2017 11:08 AM, Evgeny Kudryashov wrote:\n> Hello,\n> \n> The code below causes an internal compiler error in cc1plus (trunk on x86-64) if it is compiled with -fdump-ipa-cgraph.\n> \n> int foo () __attribute__ ((target (\"default\")));\n> int foo () __attribute__ ((target (\"sse4.2\")));\n> \n> __attribute__ ((target (\"sse4.2\")))\n> int foo ()\n> {\n>   return 1;\n> }\n> \n> The error occurs in cgraph_node::dump (gcc/cgraph.c:2065), particularly, in the following fragment:\n> \n> cgraph_function_version_info *vi = function_version ();\n> if (vi != NULL)\n>   {\n>     fprintf (f, \"  Version info: \");\n>     if (vi->prev != NULL)\n>       {\n>         fprintf (f, \"prev: \");\n>         fprintf (f, \"%s \", vi->prev->this_node->dump_asm_name ());\n>       }\n>     if (vi->next != NULL)\n>       {\n>         fprintf (f, \"next: \");\n>         fprintf (f, \"%s \", vi->next->this_node->dump_asm_name ());\n>       }\n>     if (vi->dispatcher_resolver != NULL_TREE)\n>       fprintf (f, \"dispatcher: %s\",\n>                lang_hooks.decl_printable_name (vi->dispatcher_resolver, 2));\n> \n>     fprintf (f, \"\\n\");\n>   }\n> \n> \n> The expression \"vi->{prev,next}->this_node\" can be null if it is a version of an unused symbol that was removed.\n> \n> Is it intentional that removing a cgraph node does not also remove versions?\n> \n> As a solution I suggest to delete the version of the node too during node removal.\n\nHi.\n\nAfter reading and testing your patch, I think it's proper fix. Note that I'm not reviewer, but I'm adding Honza\nwho is.\n\nThanks,\nMartin\n\n> \n> Regards,\n> Evgeny.\n> \n>     * cgraph.c (delete_function_version): New, broken out from...\n>     (cgraph_node::delete_function_version): ...here.  Rename to\n>     cgraph_node::delete_function_version_by_decl.  Update all uses.\n>     (cgraph_node::remove): Call delete_function_version.","headers":{"Return-Path":"<gcc-patches-return-462558-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462558-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"ZfnLK7Ic\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xxrGC5zHcz9s7h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 16:59:47 +1000 (AEST)","(qmail 71608 invoked by alias); 20 Sep 2017 06:59:40 -0000","(qmail 71574 invoked by uid 89); 20 Sep 2017 06:59:39 -0000","from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tWed, 20 Sep 2017 06:59:38 +0000","from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])\tby\n\tmx1.suse.de (Postfix) with ESMTP id C5D7CAE56;\n\tWed, 20 Sep 2017 06:59:35 +0000 (UTC)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:references:cc:from:message-id:date:mime-version\n\t:in-reply-to:content-type:content-transfer-encoding; q=dns; s=\n\tdefault; b=bM4+FpURN+Kwj4qmBrjXHi9s/50CGSLtTBmEzQpuNS1KAAMuOWQfG\n\tB+rhsiXFsDcchcCo3nw4QqB0ILvuDEnCv95cCV52CqnECFKuQmCTwzd5MwcSwE3H\n\tv18zV55iBoWhOvGcTIsUaILY5V+2cm4hMNkYNRyOuLba81gGh+3uWo=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:references:cc:from:message-id:date:mime-version\n\t:in-reply-to:content-type:content-transfer-encoding; s=default;\n\tbh=2nalfTfqqRDSWRrGvgUjJGd3eOY=; b=ZfnLK7IcjtPnhAce7lMEVx5neN4Q\n\tmJjbHWVQiHrAh/75OAdNauOlMvi4DU3DfLaLBhOuUl9rbA/FJXUraFCDfE4Pi2h0\n\txK5h9vXQ5RrQDo2qqlyBWjXpSi9TrMkoE7EdYaj5klNFFuSm3cafADqO8xJkDINg\n\tovxyj7wYMfwGp80=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-1.9 required=5.0 tests=BAYES_00,\n\tSPF_PASS autolearn=ham version=3.3.2\n\tspammy=Hx-languages-length:1751,\n\tHContent-Transfer-Encoding:8bit","X-HELO":"mx1.suse.de","Subject":"Re: [RFC][PATCH] ipa: fix dumping with deleted multiversioning nodes","To":"Evgeny Kudryashov <kudryashov@ispras.ru>, gcc-patches@gcc.gnu.org","References":"<3690602f9779a8e66f5744ff22eb2bbd@ispras.ru>","Cc":"Jan Hubicka <hubicka@ucw.cz>","From":"=?utf-8?q?Martin_Li=C5=A1ka?= <mliska@suse.cz>","Message-ID":"<c8a25c5f-c3cc-fe67-3314-b3df8a45c2e9@suse.cz>","Date":"Wed, 20 Sep 2017 08:59:34 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:52.0) Gecko/20100101 Thunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<3690602f9779a8e66f5744ff22eb2bbd@ispras.ru>","Content-Type":"text/plain; charset=windows-1252","Content-Transfer-Encoding":"8bit","X-IsSubscribed":"yes"}},{"id":1771797,"web_url":"http://patchwork.ozlabs.org/comment/1771797/","msgid":"<20170920122932.GB15477@kam.mff.cuni.cz>","list_archive_url":null,"date":"2017-09-20T12:29:32","subject":"Re: [RFC][PATCH] ipa: fix dumping with deleted multiversioning nodes","submitter":{"id":4327,"url":"http://patchwork.ozlabs.org/api/people/4327/","name":"Jan Hubicka","email":"hubicka@ucw.cz"},"content":"> On 09/18/2017 11:08 AM, Evgeny Kudryashov wrote:\n> > Hello,\n> > \n> > The code below causes an internal compiler error in cc1plus (trunk on x86-64) if it is compiled with -fdump-ipa-cgraph.\n> > \n> > int foo () __attribute__ ((target (\"default\")));\n> > int foo () __attribute__ ((target (\"sse4.2\")));\n> > \n> > __attribute__ ((target (\"sse4.2\")))\n> > int foo ()\n> > {\n> >   return 1;\n> > }\n> > \n> > The error occurs in cgraph_node::dump (gcc/cgraph.c:2065), particularly, in the following fragment:\n> > \n> > cgraph_function_version_info *vi = function_version ();\n> > if (vi != NULL)\n> >   {\n> >     fprintf (f, \"  Version info: \");\n> >     if (vi->prev != NULL)\n> >       {\n> >         fprintf (f, \"prev: \");\n> >         fprintf (f, \"%s \", vi->prev->this_node->dump_asm_name ());\n> >       }\n> >     if (vi->next != NULL)\n> >       {\n> >         fprintf (f, \"next: \");\n> >         fprintf (f, \"%s \", vi->next->this_node->dump_asm_name ());\n> >       }\n> >     if (vi->dispatcher_resolver != NULL_TREE)\n> >       fprintf (f, \"dispatcher: %s\",\n> >                lang_hooks.decl_printable_name (vi->dispatcher_resolver, 2));\n> > \n> >     fprintf (f, \"\\n\");\n> >   }\n> > \n> > \n> > The expression \"vi->{prev,next}->this_node\" can be null if it is a version of an unused symbol that was removed.\n> > \n> > Is it intentional that removing a cgraph node does not also remove versions?\n> > \n> > As a solution I suggest to delete the version of the node too during node removal.\n> \n> Hi.\n> \n> After reading and testing your patch, I think it's proper fix. Note that I'm not reviewer, but I'm adding Honza\n> who is.\n\nOK,,\nthanks!\nHonza\n> \n> Thanks,\n> Martin\n> \n> > \n> > Regards,\n> > Evgeny.\n> > \n> >     * cgraph.c (delete_function_version): New, broken out from...\n> >     (cgraph_node::delete_function_version): ...here.  Rename to\n> >     cgraph_node::delete_function_version_by_decl.  Update all uses.\n> >     (cgraph_node::remove): Call delete_function_version.","headers":{"Return-Path":"<gcc-patches-return-462585-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462585-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"fG23/K91\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xxzZy0rRbz9t2Q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 22:29:45 +1000 (AEST)","(qmail 69864 invoked by alias); 20 Sep 2017 12:29:38 -0000","(qmail 69854 invoked by uid 89); 20 Sep 2017 12:29:37 -0000","from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz)\n\t(195.113.20.16) by sourceware.org\n\t(qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tWed, 20 Sep 2017 12:29:35 +0000","by nikam.ms.mff.cuni.cz (Postfix, from userid 16202)\tid\n\t154B0549F2B; Wed, 20 Sep 2017 14:29:32 +0200 (CEST)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:date\n\t:from:to:cc:subject:message-id:references:mime-version\n\t:content-type:content-transfer-encoding:in-reply-to; q=dns; s=\n\tdefault; b=HP3qPzMdqmBeXNlrf4sIoUJLBgEvup5eHU7gQBAaanrc0JSwe7NEp\n\t8hunitAMpktpf9xwXiiRqVWVRLQtEyeujaf7bo+omJoRATxyG2x+kaynsWHfCcAM\n\tN2AfnBlR1h3v3nF7ZsdKWdn7lnJAEwX3m+/K+nUKdKjpgH+4OPob8g=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:date\n\t:from:to:cc:subject:message-id:references:mime-version\n\t:content-type:content-transfer-encoding:in-reply-to; s=default;\n\tbh=IelLVBsroZQyaHA9nluBBTNDuPE=; b=fG23/K91LPLg9giF4mw7fpa9qckp\n\tEfWyYCzDWcSatkHAw31LnfRKDOdLnY0zvcaxheDCz4QMyxc3mtCDPB8LvAdM8ztd\n\t8rDWzKh3wGKiHUsti4gOED7Sx+c8ls8T25woNrDK3c3/CtoW7TQ2ZuzQ6vmojugv\n\tEHXk4IaFgIoXbjE=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-1.3 required=5.0 tests=AWL, BAYES_00,\n\tKAM_LAZY_DOMAIN_SECURITY,\n\tRP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*M:mff,\n\tHContent-Transfer-Encoding:8bit","X-HELO":"nikam.ms.mff.cuni.cz","Date":"Wed, 20 Sep 2017 14:29:32 +0200","From":"Jan Hubicka <hubicka@ucw.cz>","To":"Martin =?iso-8859-2?q?Li=B9ka?= <mliska@suse.cz>","Cc":"Evgeny Kudryashov <kudryashov@ispras.ru>, gcc-patches@gcc.gnu.org","Subject":"Re: [RFC][PATCH] ipa: fix dumping with deleted multiversioning nodes","Message-ID":"<20170920122932.GB15477@kam.mff.cuni.cz>","References":"<3690602f9779a8e66f5744ff22eb2bbd@ispras.ru>\n\t<c8a25c5f-c3cc-fe67-3314-b3df8a45c2e9@suse.cz>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-2","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<c8a25c5f-c3cc-fe67-3314-b3df8a45c2e9@suse.cz>","User-Agent":"Mutt/1.5.23 (2014-03-12)"}}]