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: [RFC][PATCH] Stabilize a few qsort comparison functions


Am 2018-06-12 um 23:49 schrieb Jeff Law:
On 02/07/2018 09:58 AM, Franz Sirl wrote:
Hi,

this is the result of an attempt to minimize the differences between the
compile results of a Linux-based and a Cygwin64-based powerpc-eabi cross
toolchain.
The method used was:

     - find the -fverbose-asm assembler files that differ
     - compile that file again on both platforms with
        -O2 -g3 -fdump-tree-all-all -fdump-rtl-all -fdump-noaddr
     - look for the first dump file with differences and check that pass
       for qsort's
     - stabilize the compare functions

With some help on IRC to better understand the passes and some serious
debugging of GCC I came up with this patch. On the tested codebase the
differences in the assembler sources are now down to 0.
If the various pass maintainers have better ideas on how to stabilize
the compare functions, I'll be happy to verify them on the codebase.
For the SRA patch I already have an alternate version with an additional
ID member.

Comments?

Bootstrapped on linux-x86_64, no testsuite regressions.

Franz Sirl


2018-02-07  Franz Sirl <franz.sirl-kernel@lauterbach.com>

     * ira-build.c (object_range_compare_func): Stabilize sort.
     * tree-sra.c (compare_access_positions): Likewise.
     * varasm.c (output_object_block_compare): Likewise.
     * tree-ssa-loop-ivopts.c (group_compare_offset): Likewise.
     (struct iv_common_cand): New member.
     (record_common_cand): Initialize new member.
     (common_cand_cmp): Use new member to stabilize sort.
     * tree-vrp.c (struct assert_locus): New member.
     (register_new_assert_for): Initialize new member.
     (compare_assert_loc): Use new member to stabilize sort.
This looks pretty reasonable.   I don't think you've contributed much
recently, do you still have write access to the repository?

Hi Jeff,

after Alexander Monakov's gcc_qsort changes, this patch is not necessary anymore. I've verified that with a backport (the 2 patches r260216 and r260222 applied cleanly) of gcc_qsort to the gcc-8-branch. The resulting powerpc-eabi crosscompilers produce no more unexpected differences between a Linux and a Cygwin host. Tested (same like with my patch) by comparing the -fverbose-asm assembly output on a complete rebuild of the software here. So, unless someone thinks one of the changes makes sense anyway, this patch is obsolete.

On the repository write access, yes, I don't have one anymore. But before reactivating that I need to do the legal paperwork, because unless before when GCC was a strictly private pet project for me, it now is work related. I already got permission from my company for that, just need to find some spare time to start the legal stuff.

Franz


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