https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114291
Bug ID: 114291
Summary: -fcompare-debug failure (length) with -fprofile-use at
-O0
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: acoplan at gcc dot gnu.org
Target Milestone: ---
The following is an -fcompare-debug failure that shows up with PGO (here on
aarch64-linux-gnu):
$ cat t.c
void foo() {}
int main(void) {}
$ gcc t.c -fprofile-generate
$ ./a.out
$ gcc t.c -fprofile-use -fcompare-debug
gcc: error: t.c: ‘-fcompare-debug’ failure (length)
The difference seems to be as follows:
$ gcc t.c -fprofile-use -fdump-final-insns=nodebug.final
$ gcc t.c -fprofile-use -g -fcompare-debug-second
-fdump-final-insns=debug.final
$ diff -u nodebug.final debug.final
--- nodebug.final 2024-03-09 12:00:43.875729773 +0000
+++ debug.final 2024-03-09 12:00:52.555650670 +0000
@@ -1,5 +1,6 @@
-;; Function foo (foo, funcdef_no=0, decl_uid=4426, cgraph_uid=1,
symbol_order=0) (unlikely executed)
+
+;; Function foo (foo, funcdef_no=0, cgraph_uid=1, symbol_order=0) (unlikely
executed)
(note # 0 0 NOTE_INSN_DELETED)
(note # 0 0 NOTE_INSN_PROLOGUE_END)
@@ -18,7 +19,10 @@
(barrier # 0 0)
(note # 0 0 NOTE_INSN_DELETED)
-;; Function main (main, funcdef_no=1, decl_uid=4429, cgraph_uid=2,
symbol_order=1)
+Declarations used by main, sorted by DECL_UID:
+0: void <L0>;
+
+;; Function main (main, funcdef_no=1, cgraph_uid=2, symbol_order=1)
(note # 0 0 NOTE_INSN_DELETED)
(note # 0 0 [bb 2] NOTE_INSN_BASIC_BLOCK)