This is the mail archive of the
mailing list for the GCC project.
Re: gcc-4.9.1 generating different code between two successive builds
- From: Georg-Johann Lay <avr at gjlay dot de>
- To: Cole <cole at opteqint dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 30 Dec 2015 16:33:59 +0100
- Subject: Re: gcc-4.9.1 generating different code between two successive builds
- Authentication-results: sourceware.org; auth=none
- References: <CACsf_wwETk+L6eq0HoL0Hz8sa-CZdntZVtjGk4aY8D1989vMqw at mail dot gmail dot com>
I am busy trying to generate a package for gcc that is consistent
between two successive builds, and I am now down to the final few
I am stuck with the file: cilk-abi-cilk-for.o, which is obviously
built with -O2, but between two successive builds, the assembly code
generated is different. Please refer to  for output and details.
Would anyone have any suggestions that I might be able to try to get
the file to generate the same assembly code?
IIRC the mentioned problem with qsort is in the register allocator as it
sorts registetr classes according to their cost. If two different
classes have the same cost then the result depends on the qsort
implementation. This can lead to different code across different
platforms, but the code built on one specific platform should be the same.
Some parts of the compiler use the address of objects to compute hashes,
but I don't remember which part(s) actually do this. That technique can
lead to different code for different runs of the compiler even on the
same system. This is hard to reproduce as it depends on how the OS is
supplying memory, and it might depend on the "history" of the machine
and the actual OS.