https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86395

            Bug ID: 86395
           Summary: add support of -fopt-info-inline in early inliner
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: qinzhao at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

currently, -fopt-info-inline does not report any info from early inliner.
for example:


[qinzhao@localhost inline_report]$ cat inline_1.c
static int foo (int a)
{
 return a + 10;
}

static int bar (int b)
{
 return b - 20;
}

static int boo (int a, int b)
{
 return foo (a) + bar (b);
}

extern int v_a, v_b;
extern int result;

int compute ()
{
 result = boo (v_a, v_b);
 return result; 
}

[qinzhao@localhost inline_report]$ /home/qinzhao/Install/latest/bin/gcc -O3
-fopt-info-inline-optimized-missed=inline.txt inline_1.c -S
[qinzhao@localhost inline_report]$ ls -l inline.txt
-rw-rw-r--. 1 qinzhao qinzhao 0 Jul  3 11:25 inline.txt
[qinzhao@localhost inline_report]$ cat inline_1.s
        .file   "inline_1.c"
        .text
        .p2align 4,,15
        .globl  compute
        .type   compute, @function
compute:
.LFB3:
        .cfi_startproc
        movl    v_a(%rip), %edx
        movl    v_b(%rip), %eax
        leal    -10(%rdx,%rax), %eax
        movl    %eax, result(%rip)
        ret
        .cfi_endproc
.LFE3:
        .size   compute, .-compute
        .ident  "GCC: (GNU) 9.0.0 20180702 (experimental)"
        .section        .note.GNU-stack,"",@progbits

From the above, we can see:
1. the call chains to —>“boo”->”foo”, “bar” in the routine “compute” are
completely inlined by early inliner into “compute”;
2. However, there is NO any inline information is dumped into “inline.txt”.

This PR is to request -fopt-info-inline support for early inliner

Reply via email to