[PATCH] PR26251: -Os vs. tree-ssa jump threading

Uros Bizjak ubizjak@gmail.com
Mon Jul 3 06:17:00 GMT 2006


Roger Sayle wrote:

> foo:    movl    4(%esp), %edx
>        movl    $1, %eax
> .L2:    movl    $0, -4(%edx,%eax,4)
>         incl    %eax
>         cmpl    $11, %eax
>         jne     .L2
>         ret

> Apart from the curious change in induction variable performed by
> tree-ssa's ivopts pass, this is about as good as you can expect
> from tree-level jump threading with -Os.  Particularly, it resolves
> the code size regression, returning us to the code we generated
> in gcc 4.0.

This curiois change is covered in PR target/24699. This bug has no
effect on the code size in the PR 26251 test case, but for the PR
24699 case, one byte code increase could be observed:

   c:   8b 04 93                mov    (%ebx,%edx,4),%eax
   f:   89 04 91                mov    %eax,(%ecx,%edx,4)

vs:

  13:   8b 44 93 fc             mov    0xfffffffc(%ebx,%edx,4),%eax
  17:   89 44 91 fc             mov    %eax,0xfffffffc(%ecx,%edx,4)

Uros.



More information about the Gcc-patches mailing list