strange floating point problem

Hi,

I have a strange problem compiling a simple function. It just allocas two doubles on the stack, initializes them with constant values and calls another two functions with one of them as an argument.

The problem is, that the called function recieves the same input value regardless of the input I have set. I can expand it to more double values and function calls and it is always the first value used in a call that is used in all other calls too.

The IL looks fine. It is optimized so there are only the function calls with the different constant double values as direct input. If I change the values from double to i64 everything works fine!

Does this sound familiar to someone. Is there something going wrong with the floating point stack. I thought that perhaps I miss something in the compilation pass because compiling a normal program with clang does not give me this problems.

I'm a bit confused since the IL looks fine and this only happens with floating point values.

Cheers,
Alex

Hi Alex,

The IL looks fine. It is optimized so there are only the function
calls with the different constant double values as direct input. If I
change the values from double to i64 everything works fine!

I've not seen similar problems. Is there any chance you can send more
details? The .ll file itself, llc invocation options and LLVM version
would help a lot.

Other than that, you could try using a trunk build, or perhaps see if
the same thing happens when you change the to/from SSE.

Tim.

Hi Tim,

it turns out that the problem was due to wrong relocation in a custom elf loader. It's hard to debug such things but sorry for blaming llvm.

Thanks

Alex

Quoting Tim Northover <t.p.northover@gmail.com>: