This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Loop Optimization


Hello,
I was wondering if gcc can optimize this type of for loop using loop
rollback technique,
for(int i=5;i--;){//body}
in general we use,
for(int i=0;i<5;i++){//body} , this type of loops are easy to
understand for compilers and as 5 is constant compiler can apply loop
rollback technique to optimize.
I wonder which type of for loop will be good to use.
i will be grateful if someone responds.
Thanking you,
Debajyoti Chatterjee


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]