This is the mail archive of the gcc@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]

gcc optimization improvement?


Hi,

I was reading the following page:
http://gcc.gnu.org/news/hoist.html

And I was thinking that the listed source is still not optimal.

        incl %edx                  # Increment i
        cmpl %ecx,%edx   # Test i < j
        jl .L5                           # Loop if i < j

if j is assigned to i (edx) before the loop, then couldn't the above be
reduced to a decrement and branch if not zero?  (my old x86 assembly
book is not handy, but I'm pretty sure there is a jne or something like
that)

-Ralph



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