[cfe-dev] disabling loop idiom recognizer in clang

Chris Lattner clattner at apple.com
Sun May 1 11:32:44 PDT 2011


On Apr 30, 2011, at 9:54 AM, Damjan Marion wrote:

>> 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.

Thanks for the testcase, fixed in r130661.

-Chris



More information about the cfe-dev mailing list