Re: how to generate code-loops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> a)  It looks like a loop to me.
> No it is not a loop, at least not a loop I would like to have. Perhaps I
> had to mention this in my message, but the boy of the "loop" should be a
> basic block ( no jump to/from it ) - the code generated is not a such.
for loop before doing any instructions must check conditions and then
perform statements inside it. So your code is not right (there is no
check for conditions before starting the loop)(though sometimes it is
correct).

Label:
    <code>
    conditional jump to 'Label'

You might consider using:
do
{
code
} while (condition not satisfied)


>> b)  You instructed the compiler to unroll all loops, which is
>> apparently what it did.
>Maybe I'm confused about what you are asking?

You forced gcc compiler to unroll all loops in your code even if it
makes performance lower. "-funroll-all-loops"
>From gcc manual:
"-funroll-all-loops" Unroll all loops, even if their number of
iterations is uncertain when the loop is entered. This usually makes
programs run more slowly.
http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Optimize-Options.html#Optimize-Options

Try switching that setting of.

Arturas M.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux