On 11/22/2017 03:57 PM, Jakub Jelinek wrote:
Hi!

My reading of insert_late_enum_def_bindings etc. is that it intentionally
appends stuff into the vector without checking if the trees are already
present there (on the testcase below in particular CONST_DECLs for the e1
and e2 enumerators which are already there before), then qsorts the vector
and finally member_vec_dedup removes the duplicates that are now next to
each other.

Yes indeed. My reading of its behaviour before I made those changes was it didn't consider duplicates. Probably because previously they were harmless.

But the qsort checking really requires that the entries (if ever can be
present multiple times) must compare 0, or we'd need to say enter into the
vector pairs of tree and original position and then sort on the original
position as additional sorting key.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?

ok

nathan
--
Nathan Sidwell

Reply via email to