https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102631
--- Comment #3 from Aldy Hernandez <aldyh at gcc dot gnu.org> --- (In reply to Aldy Hernandez from comment #2) > Created attachment 51562 [details] > similar problem on aarch64 bootstrap $ ./cc1plus calls-aarch64.ii -O2 -quiet -Wall In function ‘void mark_stack_region_used(poly_uint64, poly_uint64)’, inlined from ‘rtx_def* emit_library_call_value_1(int, rtx, rtx, libcall_type, machine_mode, int, rtx_mode_t*)’ at /home/aldyh/src/gcc/gcc/calls.c:4536:29: /home/aldyh/src/gcc/gcc/calls.c:206:26: warning: ‘const_upper’ may be used uninitialized in this function [-Wmaybe-uninitialized] 206 | stack_usage_map[i] = 1; | ~~~~~~~~~~~~~~~~~~~^~~ /home/aldyh/src/gcc/gcc/calls.c: In function ‘rtx_def* emit_library_call_value_1(int, rtx, rtx, libcall_type, machine_mode, int, rtx_mode_t*)’: /home/aldyh/src/gcc/gcc/calls.c:202:30: note: ‘const_upper’ was declared here 202 | unsigned HOST_WIDE_INT const_lower, const_upper; | ^~~~~~~~~~~ As I've described here: https://gcc.gnu.org/pipermail/gcc-patches/2021-October/581045.html If you take the calls.ii file from the aarch64 bootstrap and break on the warning, you can see that the uninitalized use is for const_upper_3934 here: <bb 102> [local count: 315357954]: # const_upper_3934 = PHI <const_upper_3937(D)(101), _6707(293)> if (_881 != 0) goto <bb 103>; [50.00%] else goto <bb 106>; [50.00%] <bb 103> [local count: 157678977]: if (const_upper_3934 > _6699) goto <bb 105>; [89.00%] else goto <bb 294>; [11.00%] <bb 294> [local count: 17344687]: <bb 104> [local count: 157678977]: goto <bb 107>; [100.00%] <bb 105> [local count: 140334290]: stack_usage_map.481_3930 = stack_usage_map; _6441 = const_upper_3934 - _6699; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PROBLEMATIC READ HERE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _4819 = stack_usage_map.481_3930 + _6699; __builtin_memset (_4819, 1, _6441); goto <bb 104>; [11.00%] const_upper_3934 could be undefined if it comes from BB101 (const_upper_3937(D)), but it only gets read for _881 != 0, so it shouldn't warn. This looks very similar. The source is here, which is obviously properly guarded: static void mark_stack_region_used (poly_uint64 lower_bound, poly_uint64 upper_bound) { unsigned HOST_WIDE_INT const_lower, const_upper; const_lower = constant_lower_bound (lower_bound); if (upper_bound.is_constant (&const_upper)) for (unsigned HOST_WIDE_INT i = const_lower; i < const_upper; ++i) stack_usage_map[i] = 1; else stack_usage_watermark = MIN (stack_usage_watermark, const_lower); }