]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/103456 - Record only successes from object_sizes_set
authorSiddhesh Poyarekar <siddhesh@gotplt.org>
Wed, 1 Dec 2021 07:28:12 +0000 (12:58 +0530)
committerSiddhesh Poyarekar <siddhesh@gotplt.org>
Wed, 1 Dec 2021 08:27:50 +0000 (13:57 +0530)
commitda9386f9a70ac494939650c0e0a0e4168a6f76d8
treeec05dc6498fe70ecd3ce0bcdac7b782564fad750
parentc177e80609287cd32c6096a4ddc4dbef56c74f77
tree-optimization/103456 - Record only successes from object_sizes_set

Avoid overwriting osi->changed if object_sizes_set does not update the
size, so that a previous success in the same pass is not overwritten.
This fixes the bootstrap-ubsan build config, which was failing due to
incorrect object size.

gcc/ChangeLog:

PR tree-optimization/103456
* tree-object-size.c (merge_object_sizes): Update osi->changed
only if object_sizes_set succeeded.

gcc/testsuite/ChangeLog:

PR tree-optimization/103456
* gcc.dg/ubsan/pr103456.c: New test.

Co-authored-by: Martin Liška <mliska@suse.cz>
Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
gcc/testsuite/gcc.dg/ubsan/pr103456.c [new file with mode: 0644]
gcc/tree-object-size.c