Re: Possible improvement in inline stringop code generation

2010-11-18 Thread Ian Lance Taylor
Jeremy Hall writes: > I wonder if its possible to improve the code generation for inline > stringops when > the length is known to be a multiple of 4 bytes? The selection of the algorithm is fairly complex and depends on the specific processor you are tuning for. See decide_alg in config/i386/i

Possible improvement in inline stringop code generation

2010-11-18 Thread Jeremy Hall
Hi Folks, GCC 4.5.1 20100924 "-Os -minline-all-stringops" on Core i7 int main( int argc, char *argv[] ) { int i, a[256], b[256]; for( i = 0; i < 256; ++i ) // discourage optimization a[i] = rand(); memcpy( b, a, argc * sizeof(int) ); printf( "%d\n", b[rand()] ); // discourag