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

            Bug ID: 89613
           Summary: ICF disambuigation doesn't work
           Product: gcc
           Version: 7.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jmuizelaar at mozilla dot com
  Target Milestone: ---

Compiling the following with gcc-7.3 -flto -O2 -gdwarf-5

__attribute__((noinline)) int a() {
        return 5;
}

__attribute__((noinline)) int b() {
        return 5;
}


int main() {
        return a() + b();
}

gives:

< 1><0x0000002a>    DW_TAG_subprogram
                      DW_AT_name                  a
                      DW_AT_decl_file             0x00000001
/home/jrmuizel/tools/icf-disambiguation/test.c
                      DW_AT_decl_line             0x00000001
                      DW_AT_type                  <0x00000045>
                      DW_AT_low_pc                0x00000630
                      DW_AT_high_pc               <offset-from-lowpc>6
                      DW_AT_frame_base            len 0x0001: 9c:
DW_OP_call_frame_cfa
                      DW_AT_call_all_calls        yes(1)
< 1><0x00000045>    DW_TAG_base_type
                      DW_AT_byte_size             0x00000004
                      DW_AT_encoding              DW_ATE_signed
                      DW_AT_name                  int
< 1><0x0000004c>    DW_TAG_subprogram
                      DW_AT_external              yes(1)
                      DW_AT_name                  main
                      DW_AT_decl_file             0x00000001
/home/jrmuizel/tools/icf-disambiguation/test.c
                      DW_AT_decl_line             0x0000000a
                      DW_AT_type                  <0x00000045>
                      DW_AT_low_pc                0x00000500
                      DW_AT_high_pc               <offset-from-lowpc>19
                      DW_AT_frame_base            len 0x0001: 9c:
DW_OP_call_frame_cfa
                      DW_AT_call_all_calls        yes(1)
< 2><0x00000069>      DW_TAG_call_site
                        DW_AT_call_return_pc        0x00000507
                        DW_AT_call_origin           <0x0000002a>
< 2><0x00000076>      DW_TAG_call_site
                        DW_AT_call_return_pc        0x00000510

which doesn't have a DW_AT_call_origin for the second call to 'a'

Reply via email to