
On 22/01/2015 17:17, Fletcher, John P wrote:
________________________________________ From: Boost [boost-bounces@lists.boost.org] on behalf of Mathias Gaunard [mathias.gaunard@ens-lyon.org] Sent: 22 January 2015 15:59 To: boost@lists.boost.org Subject: Re: [boost] Debugging optimisation unstable code - Stack and other tools
On 22/01/2015 15:35, Fletcher, John P wrote:
I am working to get the bugs out of Phoenix and have a situation where some tests are optimisation unstable - they run on Clang 3.5 with -O1 but not -O2 and on gcc 4.9.0 with -O0 but not -O1. The higher optimisation gives an erroneous return value.
I am looking for tools to work with this.
You can enable the sanitizers bundled with clang and gcc. You can also try valgrind.
Thank you.
I have been trying the sanitizers (clang version) without success. None report anything and using -fsanitize=undefined caused the error to disappear!
-fsanitize=undefined is pretty basic, you can try enabling the more advanced sanitizers, like address or memory.
I want to try making finer grained optimization but have not succeeded yet.
You can try to isolate what optimization pass is causing the problem by looking at the difference between the different optimization levels and trying individual flags.