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, Jun 28, 2022 at 11:38 PM Alexander Monakov <amonakov@xxxxxxxxx>
wrote:

> 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
>

For the secondary issue, could I explain that Clang chooses to ignore it?

-- 
Best regards,
Adonis



[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