> On Jul 10, 2025, at 13:27, Qing Zhao <qing.z...@oracle.com> wrote: > > > >> On Jul 10, 2025, at 12:56, Jakub Jelinek <ja...@redhat.com> wrote: >> >> On Thu, Jul 10, 2025 at 04:03:30PM +0000, Qing Zhao wrote: >>> gcc/c-family/ChangeLog: >>> >>> * c-ubsan.cc (get_bound_from_access_with_size): Adjust the position >>> of the arguments per the new design. >>> >>> gcc/c/ChangeLog: >>> >>> * c-typeck.cc (build_counted_by_ref): Update comments. >>> (build_access_with_size_for_counted_by): Adjust the arguments per >>> the new design. >>> >>> gcc/ChangeLog: >>> >>> * internal-fn.cc (expand_DEFERRED_INIT): Update comments. >>> * internal-fn.def (DEFERRED_INIT): Update comments. >>> * tree-object-size.cc (addr_object_size): Update comments. >>> (access_with_size_object_size): Adjust the arguments per the new >>> design. >> >> Similar comment about ChangeLog entries as on the previous patch. > > Sure, will check the changeling and update accordingly. > >> >> I see only code passing 0 as the third argument (with the right type), >> so don't see why it is documented to be 0/1/2/3. Or is that something >> done in the patch that got reverted? > > ACCESS_MODE is only for a future work to reimplement the attribute > access with the internal function .ACCESS_WITH_SIZE. > > https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-access-function-attribute > > For the current “counted_by”, this flag is not used at all. Therefore only 0 > is passed.
One more note here, previously, ACCESS_MODE has 5 values: -1: Unknown access semantics 0: none 1: read_only 2: write_only 3: read_write For counted_by, I passed “-1” to the .ACCESS_WITH_SIZE. With the new design, ACCESS_MODE has only 4 values (I think that the -1 is not necessary, 0 should be enough) 0: none 1: read_only 2: write_only 3: read_write For counted_by, I passed “0” to the .ACCESS_WITH_SIZE. Later, when we reimplement the “access” attribute by using .ACCESS_WITH_SIZE, the ACCESS_MODE will be used At that time. What do you think? thanks. Qing > > Hope this is clear. >> >> Jakub