Skip to content
Snippets Groups Projects
Commit 51b85dfe authored by Siddhesh Poyarekar's avatar Siddhesh Poyarekar
Browse files

tree-object-size: Fall back to wholesize for non-const offset


Don't bail out early if the offset to a pointer in __builtin_object_size
is a variable, return the wholesize instead since that is a better
fallback for maximum estimate.  This should keep checks in place for
fortified functions to constrain overflows to at lesat some extent.

gcc/ChangeLog:

	PR middle-end/77608
	* tree-object-size.cc (plus_stmt_object_size): Drop check for
	constant offset.

gcc/testsuite/ChangeLog:

	* gcc.dg/builtin-object-size-1.c (test12): New test.
	(main): Call it.

Signed-off-by: default avatarSiddhesh Poyarekar <siddhesh@gotplt.org>
parent b12c9ce2
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment