https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104941
--- Comment #2 from CVS 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:beb12c62eaec37ed0ee5a251ca0907d965d413b2 commit r12-7675-gbeb12c62eaec37ed0ee5a251ca0907d965d413b2 Author: Siddhesh Poyarekar <siddh...@gotplt.org> Date: Wed Mar 16 20:45:47 2022 +0530 tree-optimization/104941: Actually assign the conversion result Assign the result of fold_convert to offset. Also make the useless conversion check lighter since the two way check is not needed here. gcc/ChangeLog: PR tree-optimization/104941 * tree-object-size.cc (size_for_offset): Make useless conversion check lighter and assign result of fold_convert to OFFSET. gcc/testsuite/ChangeLog: PR tree-optimization/104941 * gcc.dg/builtin-dynamic-object-size-0.c (S1, S2): New structs. (test_alloc_nested_structs, g): New functions. (main): Call test_alloc_nested_structs. Signed-off-by: Siddhesh Poyarekar <siddh...@gotplt.org>