https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111254
Bug ID: 111254 Summary: Dodgy variable name (*_11 = PHI <_1(25), _25(23)>.CargoPacket::Pool...) in -Wmaybe-uninitialized Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: sjames at gcc dot gnu.org Target Milestone: --- Created attachment 55824 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55824&action=edit cargopacket.cpp.ii.xz With gcc (Gentoo 14.0.0 p, commit d0b55776a4e1d2f293db5ba0e4a04aefed055ec4) 14.0.0 20230830 (experimental) c121afc3b6c96a1f229ba0c4a4de6bd4b6be9a53: ``` $ g++ -c cargopacket.cpp.ii -O2 -Wmaybe-uninitialized [...] In file included from /var/tmp/portage/games-simulation/openttd-13.4/work/openttd-13.4/src/base_station_base.h:13: In static member function ‘static void Pool<Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero>::PoolItem<Tpool>::operator delete(void*) [with Pool<Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero>* Tpool = (& _cargopacket_pool); Titem = CargoPacket; Tindex = unsigned int; long unsigned int Tgrowth_step = 1024; long unsigned int Tmax_size = 16773120; PoolType Tpool_type = PT_NORMAL; bool Tcache = true; bool Tzero = false]’, inlined from ‘static void Pool<Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero>::PoolItem<Tpool>::operator delete(void*) [with Pool<Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero>* Tpool = (& _cargopacket_pool); Titem = CargoPacket; Tindex = unsigned int; long unsigned int Tgrowth_step = 1024; long unsigned int Tmax_size = 16773120; PoolType Tpool_type = PT_NORMAL; bool Tcache = true; bool Tzero = false]’ at /var/tmp/portage/games-simulation/openttd-13.4/work/openttd-13.4/src/core/pool_type.hpp:256:15, inlined from ‘void Pool<Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero>::CleanPool() [with Titem = CargoPacket; Tindex = unsigned int; long unsigned int Tgrowth_step = 1024; long unsigned int Tmax_size = 16773120; PoolType Tpool_type = PT_NORMAL; bool Tcache = true; bool Tzero = false]’ at /var/tmp/portage/games-simulation/openttd-13.4/work/openttd-13.4/src/core/pool_func.hpp:200:3: /var/tmp/portage/games-simulation/openttd-13.4/work/openttd-13.4/src/core/pool_type.hpp:261:45: warning: ‘*MEM[(struct CargoPacket * *)_13].CargoPacket::Pool<CargoPacket, unsigned int, 1024, 16773120, PT_NORMAL, true, false>::PoolItem<(& _cargopacket_pool)>.Pool<CargoPacket, unsigned int, 1024, 16773120, PT_NORMAL, true, false>::PoolItem<(& _cargopacket_pool)>::index’ may be used uninitialized [-Wmaybe-uninitialized] 261 | Tpool->FreeItem(pn->index); | ~~~~^~~~~ In static member function ‘static void Pool<Titem, Tindex, Tgrowth_step, Tmax_ [...] ```