]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-object-size.cc: Fix assert constant offset in check_for_plus_in_loops [PR122012]
authorLinsen Zhou <i@lin.moe>
Fri, 17 Oct 2025 03:05:04 +0000 (11:05 +0800)
committerSiddhesh Poyarekar <siddhesh@gotplt.org>
Sat, 18 Oct 2025 01:58:33 +0000 (20:58 -0500)
commit82cefc4898d4ccabe76e28d6626b91ca9e998923
tree79c4d3e4ecec082241e0f6dbf4f5f14ac64cdfdd
parentfa8ca9554d5c52f3f45551e5eefa1541231ec891
tree-object-size.cc: Fix assert constant offset in check_for_plus_in_loops [PR122012]

After commit 51b85dfeb19652bf3e0aaec08828ba7cee1e641c, when the
pointer offset is a variable in the loop, the object size of the
pointer may also need to be reexamined.
Which make gcc_assert in the check_for_plus_in_loops failed.

gcc/ChangeLog:

PR tree-optimization/122012
* tree-object-size.cc (check_for_plus_in_loops): Skip check
for the variable offset

gcc/testsuite/ChangeLog:

PR tree-optimization/122012
* gcc.dg/torture/pr122012.c: New test.

Signed-off-by: Linsen Zhou <i@lin.moe>
gcc/testsuite/gcc.dg/torture/pr122012.c [new file with mode: 0644]
gcc/tree-object-size.cc