noinline attribute problem

Hello,

I have the following simple C code below. It should return ‘8’ as a result. But the returned result is false as it returns ‘1’.

When I remove the line of ‘attribute((noinline))’ , the returned results are correct ‘8’.

Any idea? Please advice as I need to get the assembly code of the ‘getTexSize’ function alone.

Note: I compile using the following commands

clang -O2 -emit-llvm test.cpp -c -o test.bc

lli -use-mcjit test.bc

Thanks in advance

Sara Elshbaky

Hi Sara,

   clang -O2 -emit-llvm test.cpp -c -o test.bc
    lli -use-mcjit test.bc

I'm not seeing the issue here. Could you tell us what version of Clang
& lli you're using, and what the platform is? If you're not using
trunk, it would be useful to know if the problem is still present
there.

Attaching the bad test.bc could also be helpful.

Cheers.

Tim.

Hi Tim,
I attached the .cpp file and the .bc one
I'm using clang and lli version 3.3 on ARM PC

I modified the code to send n as an argument to the main function. As a result, the wrong '1' is returned always even if the no_inline attribute is available or not.
But, including the printf function in the getTexSize function solve it.
Is it normal? Also I do not need to printf anything ..
Thanks in advance
Sara

test.bc (2.01 KB)

test.cpp (694 Bytes)

Hi Sara,

I'm using clang and lli version 3.3 on ARM PC

Hmm, that's getting on for a year old now, and lots of bugs have been
fixed since.

Is it normal? Also I do not need to printf anything ..

It's sounding very much like a CodeGen bug, but since we don't really
do patch releases it's unlikely to catch anyone's attention unless
it's still around in trunk.

I don't suppose you could try again with 3.4 or (preferable) an svn checkout?

Cheers.

Tim.