GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc

Fix -fvar-tracking-uninit option interactions

Corrected the behavior of -fvar-tracking-uninit to properly imply -fvar-tracking, resolving issues with uninitialized variable tracking.

A recent change that removed AUTODETECT_VALUE broke the interaction of the -fvar-tracking-uninit option. Previously, -fvar-tracking-uninit explicitly implied -fvar-tracking, and the option defaulted to enabled for optimization levels of 1 and above. The change restored the implication that -fvar-tracking-uninit enables -fvar-tracking, ensuring correct behavior for tracking uninitialized variables. It also re-establishes default behaviors that were inadvertently lost.

In Details

The patch restores two behaviors lost in the r12-4397 commit that removed AUTODETECT_VALUE. First, it re-establishes that -fvar-tracking-uninit when explicitly specified on the command line now implies -fvar-tracking. Second, it ensures that flag_var_tracking_uninit defaults to flag_var_tracking's value if not explicitly set by the user. This corrects an issue where the default behavior of enabling -fvar-tracking for -O1 and above, and the implication of -fvar-tracking-uninit on -fvar-tracking, were broken by the prior refactoring.

For Context
-fvar-tracking-uninit
A GCC compiler option that enables tracking of uninitialized variables. When enabled, the compiler attempts to detect and report uses of variables that have not been assigned a value.
-fvar-tracking
A GCC compiler option that enables variable tracking, which can be used for debugging and optimization purposes. It tracks the state of variables throughout the program.
AUTODETECT_VALUE
A flag value that previously indicated automatic detection or defaulting of an option's behavior, now removed.
Darwin
Refers to macOS and related Apple operating systems.
Filed Under: gccdebuggingcompiler-optionsbugfix