https://gcc.gnu.org/g:04aefdc47fd6baeff572f5087d6c30f5d7c2a575
commit r17-4839-g04aefdc47fd6baeff572f5087d6c30f5d7c2a575 Author: Tamar Christina <[email protected]> Date: Fri Oct 2 15:01:52 2026 +0100 simplify-rtx: avoid a false positive -Wuninitialized on profiled bootstraps [PR127635] When doing profiledbootstrap the compiler fails with -Wuninitialized false positive in stageprofile-bubble This is a false positive as the analyzer seems unable to see that if is_a <.., &foo> passes that foo will be initialized. There didn't seem to be a good "initial" value here that wouldn't be confusing so instead I rewrote the check to avoid the out parameter. gcc/ChangeLog: PR bootstrap/127635 * simplify-rtx.cc (simplify_context::simplify_subreg): Avoid is_a<..> with ref param. Diff: --- gcc/simplify-rtx.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc index 285826a3feda..90c37cff088e 100644 --- a/gcc/simplify-rtx.cc +++ b/gcc/simplify-rtx.cc @@ -8959,10 +8959,15 @@ simplify_context::simplify_subreg (machine_mode outermode, rtx op, break; } - if (is_a <scalar_int_mode> (outermode, &int_outermode) - && is_a <scalar_int_mode> (innermode, &int_innermode) - && known_eq (byte, subreg_lowpart_offset (int_outermode, int_innermode))) + if (is_a <scalar_int_mode> (outermode) + && is_a <scalar_int_mode> (innermode) + && known_eq (byte, + subreg_lowpart_offset (as_a <scalar_int_mode> (outermode), + as_a <scalar_int_mode> (innermode)))) { + scalar_int_mode int_outermode = as_a <scalar_int_mode> (outermode); + scalar_int_mode int_innermode = as_a <scalar_int_mode> (innermode); + /* Handle polynomial integers. The upper bits of a paradoxical subreg are undefined, so this is safe regardless of whether we're truncating or extending. */
