]> git.ipfire.org Git - thirdparty/gcc.git/commit
Use TYPE_INCLUDES_FLEXARRAY in __builtin_object_size [PR tree-optimization/101832]
authorQing Zhao <qing.zhao@oracle.com>
Fri, 30 Jun 2023 18:24:34 +0000 (18:24 +0000)
committerQing Zhao <qing.zhao@oracle.com>
Fri, 30 Jun 2023 18:24:34 +0000 (18:24 +0000)
commite050ce7c3adf71eedd5482c29cf54b827e026642
tree2cb23689a918b4729bb1b116f0685a28e4bafdd9
parentdb5d70632a6cb59521e41df7745cacb08d00a3f4
Use TYPE_INCLUDES_FLEXARRAY in __builtin_object_size [PR tree-optimization/101832]

__builtin_object_size should treat struct with TYPE_INCLUDES_FLEXARRAY as
flexible size.

gcc/ChangeLog:

PR tree-optimization/101832
* tree-object-size.cc (addr_object_size): Handle structure/union type
when it has flexible size.

gcc/testsuite/ChangeLog:

PR tree-optimization/101832
* gcc.dg/builtin-object-size-pr101832.c: New test.
gcc/testsuite/gcc.dg/builtin-object-size-pr101832.c [new file with mode: 0644]
gcc/tree-object-size.cc