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

Martin Uecker <muecker at gwdg dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |muecker at gwdg dot de

--- Comment #3 from Martin Uecker <muecker at gwdg dot de> ---
Was just to file this bug...  

Note that the access attribute could be translated into the same builtin
suggested for counted_by in

https://gcc.gnu.org/pipermail/gcc-patches/2023-October/634177.html

and then this could work.  This would also simply the BDOS path I think because
special code for the access attribute could go.

Example: https://godbolt.org/z/1TTePn7hn 

static
#if 0
char *propagate(char *p, int s)
    [[gnu::access(read_only, 1, 2)]]
#else
char *propagate(char *p; int s; 
    char p[(p = pointer_with_size(p, s), s)], int s)
#endif
{
    printf("%ld\n", __builtin_dynamic_object_size(p, 0));
    return p;
}

Reply via email to