public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "stephanemarcotte at 3d-p dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/39797]  New: Segmentation fault g++
Date: Fri, 17 Apr 2009 15:26:00 -0000	[thread overview]
Message-ID: <bug-39797-17591@http.gcc.gnu.org/bugzilla/> (raw)

Version Info:
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr
--enable-targets=all --enable-checking=release --build=i486-linux-gnu
--host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)

Command line:
g++ --save-temp snippet.cpp
snippet.cpp:21: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.2/README.Bugs>.

--- SOURCE CODE BEGIN ---
#include <stdlib.h>

class MatrixBase {
    public:
        virtual ~MatrixBase() {}
        virtual const size_t M() const = 0 ;
        virtual const size_t N() const = 0 ;
} ;

template <class T, size_t M, size_t N> class Matrix : public MatrixBase {
    public:
        Matrix() {}
        ~Matrix() {}
        const double & operator()( size_t m, size_t n ) const {
            if ( m < M && n < N ) {
                return m_array[ m ][ n ] ;
            } else {
                throw Exception( "Matrix indices out of bounds" ) ;
            }
        }
        Matrix<T,M,N> & operator*=( double f ) {
            for ( size_t m = 0; m < M; ++m ) {
                for ( size_t n = 0; n < N; ++n ) {
                    m_array[ m ][ n ] *= f ;
                }
            }
            return *this ;
        }
        const size_t M() const { return M ; }
        const size_t N() const { return N ; }
        typedef T size_type ;
    private:
        T m_array[ M ][ N ] ;
} ;

int main( int argc, char * argv[] )
{
 return 0 ;
}
--- SOURCE CODE END ---


-- 
           Summary: Segmentation fault g++
           Product: gcc
           Version: 4.2.4
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: stephanemarcotte at 3d-p dot com
GCC target triplet: i486-linux-gnu


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


             reply	other threads:[~2009-04-17 15:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-17 15:26 stephanemarcotte at 3d-p dot com [this message]
2009-04-17 15:27 ` [Bug c++/39797] " stephanemarcotte at 3d-p dot com
2009-04-17 15:28 ` stephanemarcotte at 3d-p dot com
2009-04-17 15:39 ` stephanemarcotte at 3d-p dot com
2009-04-17 15:40 ` paolo dot carlini at oracle dot com
2009-04-17 15:41 ` stephanemarcotte at 3d-p dot com
2009-04-17 15:45 ` stephanemarcotte at 3d-p dot com
2009-04-17 20:49 ` rguenth at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-39797-17591@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).