]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add the 6th argument to .ACCESS_WITH_SIZE
authorQing Zhao <qing.zhao@oracle.com>
Tue, 28 May 2024 18:39:31 +0000 (18:39 +0000)
committerQing Zhao <qing.zhao@oracle.com>
Fri, 31 May 2024 16:44:57 +0000 (16:44 +0000)
commit4c5bea7def13613fba166edb23289bab446b0b48
tree5a595325128d0c96ac3eebb617f63e57ab3b990f
parent3d94fee616d6132075f3292a6eafdcb7b1d3f5a5
Add the 6th argument to .ACCESS_WITH_SIZE

to carry the TYPE of the flexible array.

Such information is needed during tree-object-size.cc.

We cannot use the result type or the type of the 1st argument
of the routine .ACCESS_WITH_SIZE to decide the element type
of the original array due to possible type casting in the
source code.

gcc/c/ChangeLog:

* c-typeck.cc (build_access_with_size_for_counted_by): Add the 6th
argument to .ACCESS_WITH_SIZE.

gcc/ChangeLog:

* tree-object-size.cc (access_with_size_object_size): Use the type
of the 6th argument for the type of the element.
* internal-fn.cc (expand_ACCESS_WITH_SIZE): Update the comment with
the 6th argument.

gcc/testsuite/ChangeLog:

* gcc.dg/flex-array-counted-by-6.c: New test.
gcc/c/c-typeck.cc
gcc/internal-fn.cc
gcc/testsuite/gcc.dg/flex-array-counted-by-6.c [new file with mode: 0644]
gcc/tree-object-size.cc