This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/12395] Suboptimal code with global variables
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Sep 2003 23:30:03 -0000
- Subject: [Bug optimization/12395] Suboptimal code with global variables
- References: <20030924231750.12395.steven@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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)"