https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106409
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Lewis Hyatt <[email protected]>: https://gcc.gnu.org/g:8e23a9982fa4b885a27608825cbe326d61f20498 commit r16-6110-g8e23a9982fa4b885a27608825cbe326d61f20498 Author: Lewis Hyatt <[email protected]> Date: Sun Dec 14 09:51:12 2025 -0500 middle-end: Fix spurious -Walloc-size-larger-than warning during LTO [PR106409] The implementation of -Walloc-size-larger-than has logic to avoid issuing the warning for ::operator new[] calls emitted by the C++ front end, which otherwise produce known false positives. The logic for suppressing the warning only activates in the C++ front end, and so it does not prevent the LTO front end from issuing the warning. Fix by applying the logic in all cases. gcc/ChangeLog: PR tree-optimization/106409 * gimple-ssa-warn-access.cc (maybe_warn_alloc_args_overflow): Adjust comment for clarity, and augment check to work in LTO as well. gcc/testsuite/ChangeLog: PR tree-optimization/106409 * g++.dg/lto/pr106409_0.C: New test.
