[cfe-dev] disabling loop idiom recognizer in clang

Damjan Marion damjan.marion at gmail.com
Sat Apr 30 01:26:40 PDT 2011


On Apr 30, 2011, at 3:29 AM, Andrew Fish wrote:

>>> # arm-none-eabi-objdump -S inflate-tramp.o | grep -B 5 -A 2 memset
>>>   b58:	85900400 	ldrhi	r0, [r0, #1024]	; 0x400
>>>   b5c:	e58d104c 	str	r1, [sp, #76]	; 0x4c
>>>   b60:	e3a01000 	mov	r1, #0
>>>   b64:	858d0030 	strhi	r0, [sp, #48]	; 0x30
>>>   b68:	e24b0064 	sub	r0, fp, #100	; 0x64
>>>   b6c:	ebfffffe 	bl	0 <memset>
>>> 	for (i = 0; i < BMAX+1; i++) c [i] = 0;
>> 
>> Should I fill bug for this or this is just not supported?
>> 
> 
> Damjan,
> 
> If you think it is a bug write a small example program that shows the problem. Post it to the mailing list and describe how you compiled the test program. Then describe the issue. Also it is good to mention the version of clang you are using. objdump greps are not bug reports folks can act on.

I tried to write small c program and -ffreestanding works well. After applying -ffreestanding memset disappears from S.
Unfortunately this is not true for "my" code. I created -E version of my code and uploaded it at [1].

clang version is trunk 129857. Command line is: 

# clang  -ccc-host-triple arm-unknown-freebsd  -O2 -ffreestanding -g -c inflate.c -o inflate.o

> 
> Also you can just clang -S to generate assembler, so you don't need objdump. 

AFAIK clang -S doesn't intermix source code with assembly.

> 
> Thanks,
> 
> Andrew
> 

Thanks,

Damjan

[1] http://web.me.com/dmarion/inflate/inflate.c





More information about the cfe-dev mailing list