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

Martin Uecker <muecker at gwdg dot de> changed:

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

--- Comment #13 from Martin Uecker <muecker at gwdg dot de> ---

This fix seem too radical. It now prevents this from working even when there is
an explicit attribute but there is also a VLA bound.  Also I think it would be
nice if it worked without the explicit attribute at least in the simple cases
where this should be now problem.

__attribute__ ((noinline, access (read_only, 2, 1)))
int foo(int n, int buf[n])
{
    buf[n] = 1;
    return __builtin_dynamic_object_size(buf, 0);
}

int main() {
    int n = 10;
    int buf[n];
    return foo(n, buf);
}

Reply via email to