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/12395] Suboptimal code with global variables


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-09-24 23:30:02
               date|                            |


------- Additional Comments From bangerth at dealii dot org  2003-09-24 23:30 -------
Confirmed. Present mainline gives different assembly than the
tree-ssa results you showed, but the code is equally suboptimal.

One question, though: from the summary line, it seems as if you
imply that the problem is related to global variables. Do you
have an example that this doesn't happen with locals?

W.

Here's what I get with mainline (actually from the C++ FE, but that
shouldn't matter so much):
_Z3foov:
.LFB2:
        movl    a, %eax
        cmpl    $-1, %eax
        je      .L3
        addl    $2, %eax
        movl    %eax, a
        ret
        .p2align 4,,7
.L3:
        xorl    %eax, %eax
        movl    %eax, a
        ret
.LFE2:
        .size   _Z3foov, .-_Z3foov
        .section        .note.GNU-stack,"",@progbits
        .ident  "GCC: (GNU) 3.4 20030919 (experimental)"


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