Skip generating DWARF info for dead code (#3498)
When encountering a subprogram that is dead code (as indicated by the dead code proposal https://dwarfstd.org/ShowIssue.php?issue=200609.1), don't generate debug output for the subprogram or any of its children.
This commit is contained in:
committed by
GitHub
parent
2053e972b7
commit
12bfbdfaca
19
tests/all/debug/testsuite/dead_code.c
Normal file
19
tests/all/debug/testsuite/dead_code.c
Normal file
@@ -0,0 +1,19 @@
|
||||
int bar(int a)
|
||||
{
|
||||
int b[50];
|
||||
b[0] = a;
|
||||
b[29] = a;
|
||||
return a;
|
||||
}
|
||||
|
||||
int baz(int a);
|
||||
|
||||
__attribute__((export_name("foo"))) int foo()
|
||||
{
|
||||
return baz(10);
|
||||
}
|
||||
|
||||
__attribute__((noinline)) int baz(int a)
|
||||
{
|
||||
return a + 5;
|
||||
}
|
||||
Reference in New Issue
Block a user