[Bug c++/56762] New: too aggressive optimization or missing warnings

npl at chello dot at gcc-bugzilla@gcc.gnu.org
Thu Mar 28 10:37:00 GMT 2013


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

             Bug #: 56762
           Summary: too aggressive optimization or missing warnings
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: npl@chello.at


Created attachment 29743
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29743
code describing the issue

Alternatively this could be just me misunderstanding C++.
But the issue is that I have an object created on the stack and I would expect
it to survive until it goes out of scope.
Now I understand that I probably used it the wrong way by giving it a temporary
when it needed a reference to something more solid, but I would expect an error
message in this case.

Please look at the provided code, which compiles without error/warning. the
exchange function wont have any calls to lock/unlock.

tested with gcc 4.7.2 + 4.8.0



More information about the Gcc-bugs mailing list