Nested restrict pointers: missed optimization & client with UB?

Joseph Myers josmyers@redhat.com
Tue Feb 13 14:29:11 GMT 2024


On Tue, 13 Feb 2024, Ties Klappe via Gcc wrote:

> int foo2(int *restrict *p, int *restrict *q)
> {
>     **p = 10;
>     **q = 11;
>     return **p;
> }

In this case, *p and *q might be the same restricted pointer object.  See 
the more detailed explanation at 
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14192#c8>.

-- 
Joseph S. Myers
josmyers@redhat.com



More information about the Gcc mailing list