https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121000

--- Comment #10 from qinzhao at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #9)
> The problem if it is the scalar type rather than pointer to it is that it
> could be e.g. too narrow to fit all the ACCESS_MODE values there.  Think
> about unsigned _BitInt(1) counted_by.

Okay, so the final change is like the following:

   ACCESS_WITH_SIZE (REF_TO_OBJ, REF_TO_SIZE,
                     TYPE_OF_SIZE + ACCESS_MODE, TYPE_SIZE_UNIT for element)
   which returns the REF_TO_OBJ same as the 1st argument;

   1st argument REF_TO_OBJ: The reference to the object;
   2nd argument REF_TO_SIZE: The reference to the size of the object,
   3rd argument TYPE_OF_SIZE + ACCESS_MODE: An integer constant with a pointer
     TYPE.
     The pointee TYPE of the pointer TYPE is the TYPE of the object referenced
        by REF_TO_SIZE.
     The integer constant value represents the ACCESS_MODE:
        0: none
        1: read_only
        2: write_only
        3: read_write

   4th argument: The TYPE_SIZE_UNIT of the element TYPE of the array.


I have implemented this and worked well in my local workspace.
let me know if you see any more issue.

Reply via email to