Forum Discussion
Altera_Forum
Honored Contributor
11 years agoNIOS-II C Code optimization
I have defined a code looks like below: Style 1: function() { variable declaration and initialization int N; N= read_iteration(); for (n=0; n< N; n++) { i...
Altera_Forum
Honored Contributor
11 years ago --- Quote Start --- Extra code is needed to jump over the else code that is present only in style 2. --- Quote End --- This is not necessarily true. GCC is smart enough to inline (duplicate) the loop overhead such that each branch of the if/else runs to conclusion without additional branches, requiring only the initial if() 'bne' test (also required in the style 1).