Compiler optimizations question

Started by
11 comments, last by The C modest god 22 years ago
You''d think that would be a pretty obvious thing to optimise...

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions ]
Advertisement
Can we standardize some code to put between the declarations their usage?

It makes a massive difference on what this optmizer does.

I mean, this optimizer turns it basically into nothing, because the variables are stuck in registers.
char a[99999],*p=a;int main(int c,char**V){char*v=c>0?1[V]:(char*)V;if(c>=0)for(;*v&&93!=*v;){62==*v&&++p||60==*v&&--p||43==*v&&++*p||45==*v&&--*p||44==*v&&(*p=getchar())||46==*v&&putchar(*p)||91==*v&&(*p&&main(0,(char**)(--v+2))||(v=(char*)main(-1,(char**)++v)-1));++v;}else for(c=1;c;c+=(91==*v)-(93==*v),++v);return(int)v;}  /*** drpizza@battleaxe.net ***/
quote:Original post by The C modest god
I wouldn''t ask it if I didn''t intend to use this code in a critical section.



Show me code where one less memory reference would actually make a noticable difference.

codeka.com - Just click it.

This topic is closed to new replies.

Advertisement