I discovered another issue with the cache reset, this patch fixes both.
Issue 1 : The map->cacheindex compared against eltwordindex, which is
irrelevant; discussed in the message mentioned above.
Issue 2 : When the cache points to an element which is after the element
being removed, it is not updated, although all the elements are going to
be shifted in the array. Then, the cache points to the succeeding
element it should point to.
This patch fixes both issues :
1/ it uses the correct wordindex to compare cacheindex with.
2/ it makes the cache points one element backwards if the cached
element is about to be shifted.
I attached to this message two testcases for each issue.
The first one is taken from issue 1 initial patch.
By the way, patches
http://gcc.gnu.org/ml/gcc-patches/2009-09/msg00956.html and
http://gcc.gnu.org/ml/gcc-patches/2009-09/msg00959.html
are still pending. I hope someone will have a look at them.