GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
codeview

codeview: Handle functions inlined by optimizer

Fixes CodeView debug info generation for functions inlined by the optimizer.

This change corrects an issue in CodeView debug information generation where functions inlined by the optimizer were not properly handled if they weren’t explicitly declared inline. This led to an Internal Compiler Error (ICE) when the compiler attempted to access a null inlinee_lines_htab. The fix involves recording all abstract inlined functions and adding a check to guard the annotation lookup when the hash table is unavailable.

In Details

The codeview_abstract_function routine in dwarf2codeview.cc previously failed to record functions that were inlined by the optimizer unless they were explicitly marked as inline. This caused inlinee_lines_htab to remain null for such inlined functions. Consequently, write_binary_annotations would trigger an ICE when it tried to access this null table. The corrected code now records all inlined functions, regardless of their declaration, and adds a safeguard in write_binary_annotations to return early if inlinee_lines_htab is null.

For Context
CodeView
A proprietary debug information format developed by Microsoft, commonly used with Windows executables. GCC supports generating CodeView debug information.
inlined function
A function whose code is directly expanded at the call site by the compiler, rather than being called through a standard function call mechanism. This can improve performance by reducing call overhead.
Internal Compiler Error (ICE)
An error that occurs when the compiler encounters a situation it cannot handle, typically due to a bug within the compiler itself.
hash table
A data structure that stores key-value pairs and uses a hash function to compute an index into an array of buckets or slots, from which the desired value can be found.
Filed Under: codeviewdebug informationICEoptimization