[GSOC] LTO dump tool project

Prathamesh Kulkarni prathamesh.kulkarni@linaro.org
Fri Jun 8 21:01:00 GMT 2018


On 8 June 2018 at 22:46, Hrishikesh Kulkarni <hrishikeshparag@gmail.com> wrote:
> Hi,
>
> -fdump-lto-body=foo
> will dump gimple body of the function foo
>
> foo (int a, int b)
> {
>   <bb 2> [local count: 1073741825]:
>   _3 = a_1(D) + b_2(D);
>   return _3;
>
> }
>
> Please find the diff file attached herewith.
@@ -53,10 +55,14 @@ dump_list ()
     fprintf (stderr, "\t\tName \t\tType \t\tVisibility\n");
  FOR_EACH_SYMBOL (node)
  {
- fprintf (stderr, "\n%20s",(flag_lto_dump_demangle)
- ? node->name (): node->dump_asm_name ());
+    const char *x = strchr (node->asm_name (), '/');
+    if (flag_lto_dump_demangle)
+ fprintf (stderr, "\n%20s", node->name ());
+ else
+ fprintf (stderr, "\n%20s", node->asm_name (),
+ node->asm_name ()-x);
Shouldn't this be:
fprintf (stderr, "\n%20.*s", (int) (x - node->asm_name ()), node->asm_name ()) ?
Also better to put strchr within else block since that's the only
place you seem to be using it.

Thanks,
Prathamesh
>
> Regards,
> Hrishikesh
>
> On Fri, Jun 8, 2018 at 7:15 PM, Martin Liška <mliska@suse.cz> wrote:
>> On 06/08/2018 03:40 PM, Martin Liška wrote:
>>> There's wrong declaration of the function in header file. I'll fix it soon
>>> on trunk. Please carry on with following patch:
>>
>> Fixed in r261327.
>>
>> Martin



More information about the Gcc mailing list