]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/109334: Improve computation for access attribute
authorMartin Uecker <uecker@tugraz.at>
Wed, 25 Oct 2023 21:24:34 +0000 (23:24 +0200)
committerMartin Uecker <uecker@tugraz.at>
Sun, 29 Oct 2023 06:47:36 +0000 (07:47 +0100)
commitd96757842a13cad3500b74a352ab34d27a8be622
treea54506a6b12dfcc243240b58b5cfd4e883e28d5b
parentcc7aca846ae524f36a350cd54cd31da22acd6805
tree-optimization/109334: Improve computation for access attribute

The fix for PR104970 restricted size computations to the case
where the access attribute was specified explicitly (no VLA).
It also restricted it to void pointers or elements with constant
sizes.  The second restriction is enough to fix the original bug.
Revert the first change to again allow size computations for VLA
parameters and for VLA parameters together with an explicit access
attribute.

gcc/ChangeLog:

PR tree-optimization/109334
* tree-object-size.cc (parm_object_size): Allow size
computation for implicit access attributes.

gcc/testsuite/ChangeLog:

PR tree-optimization/109334
* gcc.dg/builtin-dynamic-object-size-0.c
(test_parmsz_simple3): Supported again.
(test_parmsz_external4): New test.
* gcc.dg/builtin-dynamic-object-size-20.c: New test.
* gcc.dg/pr104970.c: New test.
gcc/testsuite/gcc.dg/builtin-dynamic-object-size-0.c
gcc/testsuite/gcc.dg/builtin-dynamic-object-size-20.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr104970.c [new file with mode: 0644]
gcc/tree-object-size.cc