This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Loop Optimization
- From: Debajyoti Chatterjee <dchatterjee172 at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 13 Oct 2016 11:41:39 +0530
- Subject: Loop Optimization
- Authentication-results: sourceware.org; auth=none
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