[cfe-dev] disabling loop idiom recognizer in clang

Damjan Marion damjan.marion at gmail.com
Sat Apr 30 09:54:50 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.

Here it is:

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

void func1(unsigned *b)
{
 unsigned c[17];
 unsigned i;
 for (i=0; i < 17; i++)  c[i] = 0;
 do { c[*b]++; b++; } while (--i);
}

will produce memset call even with -ffreestanding.





More information about the cfe-dev mailing list