https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114945
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[14/15 regression] Sporadic |[14 regression] Sporadic |std::vector::resize() |std::vector::resize() |-Wstringop-overflow or |-Wstringop-overflow or |-Warray-bounds warning with |-Warray-bounds warning with |gcc 14 |gcc 14 Known to work| |13.3.0 Known to fail| |14.2.0 --- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- Fixed on trunk so far. The warning first appeared with Honza's r14-1909-g5a1ef1cfac005370 Analyze SRA candidates in ipa-fnsummary this patch extends ipa-fnsummary to anticipate statements that will be removed by SRA. This is done by looking for calls passing addresses of automatic variables. In function body we look for dereferences from pointers of such variables and mark them with new not_sra_candidate condition. This is just first step which is overly optimistic. We do not try to prove that given automatic variable will not be SRAed even after inlining. We now also optimistically assume that the transformation will always happen. I will restrict this in a followup patch, but I think it is useful to gether some data on how much code is affected by this. This is motivated by PR109849 where we fail to fully inline push_back. The patch alone does not solve the problem even for -O3, but improves analysis in this case.