Re: [PATCH 2/2] Reduce the # of arguments of .ACCESS_WITH_SIZE from 6 to 4.

2025-07-10 Thread Jakub Jelinek
On Thu, Jul 10, 2025 at 05:49:53PM +, Qing Zhao wrote: > 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. >

Re: [PATCH 2/2] Reduce the # of arguments of .ACCESS_WITH_SIZE from 6 to 4.

2025-07-10 Thread Qing Zhao
> On Jul 10, 2025, at 13:53, Jakub Jelinek wrote: > > On Thu, Jul 10, 2025 at 05:49:53PM +, Qing Zhao wrote: >> 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 >>

Re: [PATCH 2/2] Reduce the # of arguments of .ACCESS_WITH_SIZE from 6 to 4.

2025-07-10 Thread Qing Zhao
> On Jul 10, 2025, at 13:27, Qing Zhao wrote: > > > >> On Jul 10, 2025, at 12:56, Jakub Jelinek wrote: >> >> On Thu, Jul 10, 2025 at 04:03:30PM +, Qing Zhao wrote: >>> gcc/c-family/ChangeLog: >>> >>> * c-ubsan.cc (get_bound_from_access_with_size): Adjust the position >>> of the argumen

Re: [PATCH 2/2] Reduce the # of arguments of .ACCESS_WITH_SIZE from 6 to 4.

2025-07-10 Thread Jakub Jelinek
On Thu, Jul 10, 2025 at 05:27:50PM +, Qing Zhao wrote: > 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 th

Re: [PATCH 2/2] Reduce the # of arguments of .ACCESS_WITH_SIZE from 6 to 4.

2025-07-10 Thread Qing Zhao
> On Jul 10, 2025, at 12:56, Jakub Jelinek wrote: > > On Thu, Jul 10, 2025 at 04:03:30PM +, 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-typec

Re: [PATCH 2/2] Reduce the # of arguments of .ACCESS_WITH_SIZE from 6 to 4.

2025-07-10 Thread Jakub Jelinek
On Thu, Jul 10, 2025 at 04:03:30PM +, 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. >

[PATCH 2/2] Reduce the # of arguments of .ACCESS_WITH_SIZE from 6 to 4.

2025-07-10 Thread Qing Zhao
This is an improvement to the design of internal function .ACCESS_WITH_SIZE. Currently, the .ACCESS_WITH_SIZE is designed as: ACCESS_WITH_SIZE (REF_TO_OBJ, REF_TO_SIZE, CLASS_OF_SIZE, TYPE_OF_SIZE, ACCESS_MODE, TYPE_SIZE_UNIT for element) which returns the REF_TO_OBJ sa