Hi,
We are seeing some strange stuff when trying to pass floating point values to a function. When we pass the parameter by value (meaning as an actual floating point number) the parameters' value changes. When we debug the code we can see that in the disassembly there is a call too __aeabi_f2d. However there should be no reason to call this since all of the values are floats and not doubles. When we pass the floating point number by reference everything works fine.
We are using the nRF52840 with the gcc compiler that comes with the 4.20a version of segger embedded studio.
Meaning this does not work, the value of variable intermediate is not the same value as the value found in input_param :
But this works just fine:
Does anybody have an explanation for this behavior? I believe that the call to __aeabi_f2d implies that for some reason the compiler thinks he needs to convert a float to a double but there is no reason to do this...
Any ideas are welcome
Thanks!