I am writing a compiler that generates C ++ code at the end, I cannot use while\for or any other normal loop, so I will transfer it to goto\if and assign \ will cause lines like this:
if (i<b) goto loop_959__again; loop_959__end: ; } { int inumber; int i; i=0; inumber=3; if (!(inumber<30)) goto loop_4482__end; loop_4482__again: float fnumber; _A1__main__increase(__owner); i++; inumber++; fnumber=3; loop_4482__step_begin: if (inumber<30) goto loop_4482__again; loop_4482__end: ; }
It is very painful to watch, but can the GCC compiler compile and optimize code like the one above, as if it consisted of regular loops, etc.?
source share