This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug optimization/12617] [3.4 Regression] jump to next instruction not always properly eliminated


------- Additional Comments From steven at gcc dot gnu dot org  2003-12-16 22:51 -------
When I compile with "-O -fno-if-conversion2", I get the following:  
  
GCC 3.3.1 (SuSE Linux)			GCC 3.4 20031216 (experimental)  
        .file   "12617.c"               .file   "12617.c"   
        .text                                   .text   
.globl foo                              .globl foo   
        .type   foo, @function                  .type   foo, @function   
foo:                                    foo:   
        pushl   %ebp                            pushl   %ebp   
        movl    %esp, %ebp                      movl    %esp, %ebp   
        pushl   %ebx                            pushl   %ebx   
        subl    $4, %esp                        subl    $4, %esp   
        movl    8(%ebp), %ebx                   movl    8(%ebp), %ebx   
.L12:                                 | .L13:   
        movb    (%ebx), %cl           |         movb    (%ebx), %al   
        incl    %ebx                            incl    %ebx   
        cmpb    $10, %cl              |         cmpb    $10, %al   
        setne   %dl                   |         je      .L10   
        cmpb    $47, %cl              |         cmpb    $47, %al   
        setne   %al                   |         jne     .L13   
        andl    %edx, %eax            |         cmpb    $10, %al   
        testb   $1, %al               |         jne     .L7   
        jne     .L12                  | .L10:   
        cmpb    $10, %cl              <   
        jne     .L9                   <   
        subl    $12, %esp                       subl    $12, %esp   
        pushl   %ebx                            pushl   %ebx   
        call    thing_one                       call    thing_one   
        addl    $16, %esp                       addl    $16, %esp   
        jmp     .L12                  |         jmp     .L13   
.L9:                                  | .L7:   
        cmpb    $47, %cl              |         cmpb    $47, %al   
        jne     .L12                  |         jne     .L13   
        cmpb    $42, -1(%ebx)                   cmpb    $42, -1(%ebx)   
        jne     .L12                  |         jne     .L13   
        subl    $12, %esp                       subl    $12, %esp   
        pushl   %ebx                            pushl   %ebx   
        call    thing_two                       call    thing_two   
        addl    $16, %esp                       addl    $16, %esp   
        movl    -4(%ebp), %ebx                  movl    -4(%ebp), %ebx   
        leave                                   leave   
        ret                                     ret   
        .size   foo, .-foo                      .size   foo, .-foo   
                                      >         .section        .note.GNU-stack,"",@progbits   
  
  
In addition I get the following diff between 3.4 "-O -fno-ifconvert2" vs. "-O"  
--- no_ifcvt.s  2003-12-16 23:49:49.000000000 +0100  
+++ 12617.s     2003-12-16 23:49:51.000000000 +0100  
@@ -8,7 +8,9 @@  
        pushl   %ebx  
        subl    $4, %esp  
        movl    8(%ebp), %ebx  
+       jmp     .L14  
 .L13:  
+.L14:  
        movb    (%ebx), %al  
        incl    %ebx  
        cmpb    $10, %al  
  
So if-conversion is not helping here.  Honza mentioned on IRC that he and RTH  
already knew that the problem is that we do ifcvt after bb reorder, though  
nobody knows why.  Either way, if-conversion is messing things up here.  

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12617


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