https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97858
Bug ID: 97858 Summary: [11 regression] Bogus warnings about va_list during profiledbootstrap Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: hubicka at gcc dot gnu.org Target Milestone: --- During profiledbootstrap we get the following warnings: ../libcpp/../../libcpp/mkdeps.c: In function ‘munge.constprop’: ../libcpp/../../libcpp/mkdeps.c:176:13: warning: ‘MEM[(struct *)&args].reg_save_area’ may be used uninitialized [-Wmaybe-uninitialized] 176 | str = va_arg (args, const char *); | ^ ../libcpp/../../libcpp/mkdeps.c:120:11: note: ‘MEM[(struct *)&args].reg_save_area’ was declared here 120 | va_list args; | ^ ../libcpp/../../libcpp/mkdeps.c:176:13: warning: ‘MEM[(struct *)&args].overflow_arg_area’ may be used uninitialized in this function [-Wmaybe-uninitialized] 176 | str = va_arg (args, const char *); | ^ ../libcpp/../../libcpp/mkdeps.c:120:11: note: ‘MEM[(struct *)&args].overflow_arg_area’ was declared here 120 | va_list args; | ^ ../libcpp/../../libcpp/mkdeps.c:176:13: warning: ‘MEM[(struct *)&args].gp_offset’ may be used uninitialized in this function [-Wmaybe-uninitialized] 176 | str = va_arg (args, const char *); | ^ ../libcpp/../../libcpp/mkdeps.c:120:11: note: ‘MEM[(struct *)&args].gp_offset’ was declared here 120 | va_list args; | ^ This seems to be due to conditional initialization of va_list: static const char * munge (const char *str, const char *trail = NULL, ...) { static unsigned alloc; static char *buf; unsigned dst = 0; va_list args; if (trail) va_start (args, trail); but it does not make much sense to me to warn about internals of va_arg iplementation at first place. It is not user visible.