This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18842] New: Weak optimization on global references
- From: "felix dot nawothnig at t-online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Dec 2004 08:55:39 -0000
- Subject: [Bug c++/18842] New: Weak optimization on global references
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
int x, &y = x;
int main() { y = 42; }
produces
x:
.zero 4
...
y:
.long x
...
movl y, %eax
movl $42, (%eax)
Since a non-arg reference is always (?) constant it would be safe to omit
movl $42, x
--
Summary: Weak optimization on global references
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: felix dot nawothnig at t-online dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18842