Let's kill c-iterate.c

Jim Wilson wilson@cygnus.com
Wed Sep 8 13:10:00 GMT 1999


In article < Pine.LNX.4.10.9909041410440.15024-100000@biriani.cygnus.co.uk > you write:
>not entirely convinced that it's necessary; you need to read the gcc
>source carefully even to figure out that iterators exist, and that doesn't
>tell you yet how they are supposed to work.  The only program I managed
>to create that used iterators didn't show any advantage they have over a
>simple for loop.

Iterators provide a simple vector notation.  If we had vector support in
the compiler, then this would be useful.  However, currently, there is
no advantage to using iterators instead of for loops.  There aren't any
vector machines that gcc can generate code for, but there are a lot of
gcc targets that have SIMD (MMX-style) instructions, and we could
conceivably be using iterators for that.

Other languages have added vector notations, in particular Fortran 95 (?),
so the concept has value.  However, the current implementation is seriously
lacking documentation describing how iterators behave, particularly in the
presense of recurrences, so I wouldn't recommend use of iterators to anyone.

The iterator support was added by Analog Devices, a DSP provider.  They
have gcc ports for some of their DSPs, Sharc in particular.  There might be
a few DSP programmers using this feature.  Otherwise, I think it is highly
unlikely that anyone is using it.

I think iterators was one of the extensions that the Numerical C extensions
group was working on.  This extension did not make it into C9X, and I doubt
that anyone ever implemented it besides the Analog Devices gcc patches.

>Anyway, I found out in the meantime that the previous patch was incomplete,
>there are more places that contain iterator support.  Before I send another
>one, can we come to a decision what to do about the feature?

I too have a patch that removes iterator support.  I wrote it about 3 years
ago as an experiment.  It is a bit out of date, but it might be useful for
making sure that you've found all of the places where iterator support exists.
I'll send you a copy.

Jim



More information about the Gcc-patches mailing list