Re: Why does different types of array subscript used to iterate affect auto vectorization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 28 Jun 2022, Adonis Ling via Gcc-help wrote:

> > Here the main problem is '*array' and 'nread' have the same type, so they
> > might overlap. Ideally the compiler would recognize that that cannot happen
> > because it would make 'array[nread++] = i' undefined due to unsequenced
> > modifications, but GCC is not sufficiently smart (yet). The secondary issue
> > is the same as below:
> >
> 
> I got your point.
> 
> After that, I tried to add __restrict__ to nread as the following shows and
> GCC still doesn't optimize it.

As I said, there's a secondary issue even if you add 'restrict'.

Alexander



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux