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 c++/18842] New: Weak optimization on global references


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


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