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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
                 CC|                            |jakub at gcc dot gnu.org
           Assignee|marxin at gcc dot gnu.org          |unassigned at gcc dot 
gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
It has something to do with end location of function:

$ cat hash.c
void fn1()
{
}
void fn2()
{
  ;
}

$ ./xg++ -B. -g hash.c -c -O1 -fno-tree-dce -fipa-icf -fno-tree-forwprop
-fdump-rtl-cmpelim=/dev/stdout
...
(note 2 3 5 2 NOTE_INSN_FUNCTION_BEG)
(debug_insn 5 2 8 2 (debug_marker) "hash.c":6:3 -1
     (nil))

$ ./xg++ -B. -g hash.c -c -O1 -fno-tree-dce -fipa-icf -fno-tree-forwprop
-fdump-rtl-pro_and_epilogue=/dev/stdout
...
(note 2 9 5 2 NOTE_INSN_FUNCTION_BEG)
(debug_insn 5 2 10 2 (debug_marker) "hash.c":6:3 -1
     (nil))
(note 10 5 11 2 NOTE_INSN_EPILOGUE_BEG)
(jump_insn 11 10 12 2 (simple_return) "hash.c":7:1 -1
     (nil)
 -> simple_return)

$ ./xg++ -B. -g hash.c -c -O1 -fno-tree-dce -fipa-icf -fno-tree-forwprop
-fdump-rtl-pro_and_epilogue=/dev/stdout -g0
...
(note 9 2 10 2 NOTE_INSN_EPILOGUE_BEG)
(jump_insn 10 9 11 2 (simple_return) "hash.c":4:6 -1
     (nil)
 -> simple_return)

So hash.c:4:6 is DECL_SOURCE_LOCATION while hash.c:7:1 is function_end_locus.
So maybe a bad source_location or maybe screwed by IPA ICF.

Anyway, leaving for now..

Reply via email to