Please repost the patch to gcc-patches@ mailing list. David
On Tue, Jul 9, 2013 at 1:10 PM, Cong Hou <co...@google.com> wrote: > Hi > > My name is Cong Hou, and I am a Noogler working in the compiler > optimization team at Google. > > When we were trying moving the vectorization from O3 to O2 in GCC 4.9, > we met a bootstrap failure from comparison between stage 2&3. This > failure is caused by a potential bug in GCC as stated below. > > In the file tree-vect-data-refs.c, there is a qsort() function call > which sorts a group of data references using a comparison function > called "dr_group_sort_cmp()". In this function, the iterative hash > values of tree nodes are used for comparisons. For a declaration tree > node, its UID participates in the calculation of the hash value. > However, a specific declaration may have different UIDs whether the > debug information is switched on/off. In consequence, the results of > comparisons may vary in stage 2&3 during bootstrapping. > > As a solution, I think we need a function to compare two tree nodes > that does not rely on UIDs. An apparent idea is comparing the tree > code first, and if they have the same tree code, then compare their > subnodes recursively. To resolve the issue we have now, I just > composed a very basic comparison function which only compares tree > codes, and this patch can make the bootstrap get passed. I have > attached the patch here. > > I am wondering if this is a valid solution and appreciate if someone > could give me any feedback. > > > Thank you! > > > Cong