Bug 25375 - G++ seg fault
Summary: G++ seg fault
Keywords:
Status: CLOSED DUPLICATE of bug 24115
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-01-31 13:07 UTC by Han-Wen Nienhuys
Modified: 2007-04-18 16:31 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-01-31 13:07:10 UTC
Embargoed:


Attachments (Terms of Use)

Description Han-Wen Nienhuys 2001-01-31 13:07:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.75 [en] (X11; U; Linux 2.4.0 i686)


See included source snippet. COmpiling with the right options crashes GCC.
This RedHat 7 update gcc-c++-2.96-69

Reproducible: Always
Steps to Reproduce:
/*
  dokkum:~/usr/src$ g++ -funroll-loops -O6  -march=pentiumpro bug.cc 
bug.cc: In method `void Matrix3::diag (double)':
bug.cc:52: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.
 */

const int DIM=3;
class Vector3;
typedef double Real;
struct Matrix3
{
  Real elts_[3][3];

  void fill (Real);
  void diag (Real);



  void set_vectors (Vector3 const &va, Vector3 const &vb ,Vector3 const
&vc);
  Real operator ()(int i, int j) const { return elts_[i][j]; }
  Real &operator ()(int i, int j) { return elts_[i][j]; }
  Real trace () const;
  Real determinant () const;
  Real sub_determinant (int, int ) const;
  void print () const;
  Real max_norm () const;

  static void multiply (Matrix3 &dest, Matrix3 const&m1, Matrix3 const&m2);
  static void multiply (Matrix3 &dest, Real r, Matrix3 const&m2);
  static void substract (Matrix3 & dest, Matrix3 const &, Matrix3 const&);
  static void add (Matrix3 & dest, Matrix3 const &, Matrix3 const&);
  static void transpose_to (Matrix3 &dest, Matrix3 const&);
  static void invert_to (Matrix3 &dest, Matrix3 const&);
  static void multiply (Vector3 &dest, Matrix3 const &m, Vector3 const
&rhs);
  void set_rotate (int axis, Real angle);
  static void to_opengl_matrix (Real *rp, Matrix3 const&m);
  void operator *= (Real r);
  static Matrix3 rotate_about (Vector3, Real);
};


void
Matrix3::diag (Real r)
{
  for (int i=0; i < DIM; i++)
    for (int j=0; j < DIM; j++)
      elts_[i][j] = (i == j ? r :0);
}

Comment 1 Jakub Jelinek 2001-01-31 13:20:03 UTC
This is the same bug as #24115 fixed in 2.96-71 and above.

*** This bug has been marked as a duplicate of 24115 ***


Note You need to log in before you can comment on or make changes to this bug.