public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/45699]  New: Incorrect copy constructor generated with -O
@ 2010-09-17  0:50 bredelin at ucla dot edu
  2010-09-17  9:37 ` [Bug middle-end/45699] [4.6 Regression] " rguenth at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: bredelin at ucla dot edu @ 2010-09-17  0:50 UTC (permalink / raw)
  To: gcc-bugs

If you compile the attached file without optimization, it runs fine.  However,
if you compile with -O, then you get:

$ ~/Devel/GCC/local/4.6/bin/g++-4.6 -g -O crash.C -o crash --save-temps
$ ./crash
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted
Interestingly, 4.5 works fine.

The version of 4.6 is revision 164339.

$ ~/Devel/GCC/local/4.6/bin/g++-4.6 -v
Using built-in specs.
COLLECT_GCC=/home/bredelings/Devel/GCC/local/4.6/bin/g++-4.6
COLLECT_LTO_WRAPPER=/home/bredelings/Devel/GCC/local/4.6/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --enable-languages=c,c++,fortran
--prefix=/home/bredelings/Devel/GCC/local/4.6 --enable-shared
--enable-linker-build-id --with-system-zlib --disable-nls --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin
--enable-gold --with-plugin-ld=ld.gold --with-tune=generic --disable-werror
--enable-checking=yes --program-suffix=-4.6
Thread model: posix
gcc version 4.6.0 20100916 (experimental) (GCC) 
The version of 4.5 is:
$ g++-4.5 -v
Using built-in specs.
COLLECT_GCC=/usr/bin/g++-4.5
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.5.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.5.1-5'
--with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.5 --enable-shared --enable-multiarch
--enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-plugin --enable-gold --with-plugin-ld=ld.gold --enable-objc-gc
--with-arch-32=i586 --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.5.1 (Debian 4.5.1-5) 
The crash seems to result from using the wrong location for SuperModel2::object
in the generated copy constructor.


-- 
           Summary: Incorrect copy constructor generated with -O
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bredelin at ucla dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

end of thread, other threads:[~2010-10-11 18:46 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-45699-4@http.gcc.gnu.org/bugzilla/>
2010-09-29 18:43 ` [Bug middle-end/45699] [4.6 Regression] Incorrect copy constructor generated with -O rguenth at gcc dot gnu.org
2010-10-06 15:46 ` bredelin at ucla dot edu
2010-10-08 12:12 ` jamborm at gcc dot gnu.org
2010-10-08 14:41 ` jamborm at gcc dot gnu.org
2010-10-08 15:59 ` bredelin at ucla dot edu
2010-10-08 16:37 ` bredelin at ucla dot edu
2010-10-08 16:51 ` jamborm at gcc dot gnu.org
2010-10-08 17:57 ` jamborm at gcc dot gnu.org
2010-10-11 18:45 ` jamborm at gcc dot gnu.org
2010-10-11 18:46 ` jamborm at gcc dot gnu.org
2010-09-17  0:50 [Bug middle-end/45699] New: " bredelin at ucla dot edu
2010-09-17  9:37 ` [Bug middle-end/45699] [4.6 Regression] " rguenth at gcc dot gnu dot org
2010-09-17 14:29 ` hjl dot tools at gmail dot com
2010-09-17 14:29 ` hjl dot tools at gmail dot com
2010-09-17 14:40 ` jamborm 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).