https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113012
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Siddhesh Poyarekar <siddh...@gcc.gnu.org>: https://gcc.gnu.org/g:576c1fc4401a9dae9757ac2e4fa37d05e130fa3d commit r14-6730-g576c1fc4401a9dae9757ac2e4fa37d05e130fa3d Author: Siddhesh Poyarekar <siddh...@gotplt.org> Date: Mon Dec 18 09:44:00 2023 -0500 tree-object-size: Always set computed bit for bdos [PR113012] It is always safe to set the computed bit for dynamic object sizes at the end of collect_object_sizes_for because even in case of a dependency loop encountered in nested calls, we have an SSA temporary to actually finish the object size expression. The reexamine pass for dynamic object sizes is only for propagation of unknowns and gimplification of the size expressions, not for loop resolution as in the case of static object sizes. gcc/ChangeLog: PR tree-optimization/113012 * tree-object-size.cc (compute_builtin_object_size): Expand comment for dynamic object sizes. (collect_object_sizes_for): Always set COMPUTED bitmap for dynamic object sizes. gcc/testsuite/ChangeLog: PR tree-optimization/113012 * gcc.dg/ubsan/pr113012.c: New test case. Signed-off-by: Siddhesh Poyarekar <siddh...@gotplt.org>