public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/33572]  New: wrong code with -O
@ 2007-09-27 16:03 wouter dot vermaelen at scarlet dot be
  2007-09-27 16:37 ` [Bug c++/33572] " pcarlini at suse dot de
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: wouter dot vermaelen at scarlet dot be @ 2007-09-27 16:03 UTC (permalink / raw)
  To: gcc-bugs

> cat bug.cc
#include <vector>
#include <memory>

struct Foo { virtual void f() {} };

int main(int argc, char**)
{
        std::auto_ptr<Foo> foo;
        if (argc) {
                foo.reset(new Foo());
        } else {
                std::vector<int> v;
        }
        Foo* p = foo.release();
        p->f();
}

> g++ -O bug.cc
> a.out
Segmentation fault (core dumped)

I'm using SVN revision 128838 on linux-x86_64.
Without -O or with g++ version 4.2.1 this program works correctly.


-- 
           Summary: wrong code with -O
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wouter dot vermaelen at scarlet dot be


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2007-10-15 17:08 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-27 16:03 [Bug c++/33572] New: wrong code with -O wouter dot vermaelen at scarlet dot be
2007-09-27 16:37 ` [Bug c++/33572] " pcarlini at suse dot de
2007-09-27 20:21 ` belyshev at depni dot sinp dot msu dot ru
2007-09-27 20:31 ` wouter dot vermaelen at scarlet dot be
2007-09-27 20:31 ` wouter dot vermaelen at scarlet dot be
2007-09-27 21:03 ` [Bug tree-optimization/33572] [4.3 Regression] " rguenth at gcc dot gnu dot org
2007-09-27 21:19 ` pcarlini at suse dot de
2007-09-28 12:28 ` rguenth at gcc dot gnu dot org
2007-09-28 12:59 ` rguenth at gcc dot gnu dot org
2007-09-30 12:41 ` rguenth at gcc dot gnu dot org
2007-09-30 12:51 ` rguenth at gcc dot gnu dot org
2007-09-30 13:41 ` dnovillo at google dot com
2007-09-30 14:01 ` rguenther at suse dot de
2007-10-01 19:55 ` aoliva at gcc dot gnu dot org
2007-10-02  1:38 ` aoliva at gcc dot gnu dot org
2007-10-03  1:05 ` aoliva at gcc dot gnu dot org
2007-10-06 11:45 ` aoliva at gcc dot gnu dot org
2007-10-07 14:40 ` hjl at lucon dot org
2007-10-08 16:42 ` danglin at gcc dot gnu dot org
2007-10-08 23:57 ` aoliva at gcc dot gnu dot org
2007-10-09  4:47 ` aoliva at gcc dot gnu dot org
2007-10-09  4:48 ` aoliva at gcc dot gnu dot org
2007-10-15 17:08 ` aoliva at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).