This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][middle-end] Make qsort in tree-ssa-sccvn.c stable.


> + Â/* Make qsort stable by doing addition comparisons. */

s/addition/additional/  ?


> +
> + Âver_a = SSA_NAME_VERSION (opa);
> + Âver_b = SSA_NAME_VERSION (opb);
> + Âif (ver_a < ver_b)
> + Â Âreturn -1;
> + Âelse if (ver_a > ver_b)
> + Â Âreturn 1;
> + Âelse
> + Â Âreturn 0;
> +}

If this function returns 0 then the sort not stable, just not as
unstable as before. If you are sure this cannot happen,  you should
replace "return 0" with gcc_unreachable(). If not, please note in a
comment that the sort is not completely stable.

Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]