Slowdowns in code generated by GCC>=3.3

Peter Barada peter@the-baradas.com
Wed Oct 20 21:22:00 GMT 2004


>> 
>> Nothing stops GCC from folding that asm into the common-ized jump
>> block.
>> 
>> zw
>> 
>
>I see.
>
>So the practical solution is 
>
>- generate asm listing
>- identify appropriate jumps, eg:
>
>        ...
>        movl    8(%ecx), %eax
>        jmp     .Lxxxxx
>	...
>.Lxxxxx:
>        jmp     *%eax
>
>- change "jmp .Lxxxxx" to "jmp *%eax" with your favorite text editor
>- compile the asm source

Wouldn't it be better to make the compiler not do
tail-merging/crossjumping unless the savings makes it
wortwhile; i.e. don't do the jump to save less than N
instructions(where in this case, it actaully *increases* the
instruction count by one)?

-- 
Peter Barada
peter@the-baradas.com



More information about the Gcc mailing list