|
From: Henry G. <he...@ca...> - 2016-02-11 09:16:55
|
I've been working on some code targeting an ARM Cortex A9. A minimal working example and compile/test script can be found here: https://gist.github.com/hgomersall/22a19f245559d55f1ff6 What I've found is that with -O3 and -mfpu=neon flags, some values, as computed under Valgrind, are wrong. This is demonstrated in the minimal example linked to above through the printf statement. Now I understand that Valgrind has potential problems with its own testing on higher optimisation levels, but this is a problem with the validity of the program itself (I am assuming the code itself remains valid). Clearly, if this is just a Valgrind problem I shouldn't worry too much, but I seem to be getting various poorly defined problems (largely erroneous results) with the higher optimisation levels and the neon flag, even when running outside of Valgrind. It's very hard to isolate a minimal example though. My asm-fu is not quite at the point I can understand the program logic from the compiler output. I'm trying to understand whether this is a bug in my code, a compiler bug, or a valgrind bug. Any assistance on this is much appreciated! All the code is tested initially on x86_64, on which everything works with no problems at all. The problem code is with ARM cortex A9 valgrind 3.10.1 gcc 5.2.0 glibc 2.22 kernel 3.19.0 Many thanks, Henry |