This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/10979] New: g++ ICEs on legal code in subst_stack_regs_pat() (reg-stack.c)


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: g++ ICEs on legal code in subst_stack_regs_pat() (reg-
                    stack.c)
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: martin@mpa-garching.mpg.de
                CC: gcc-bugs@gcc.gnu.org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

Consider he following code:

double atan2(double a,double b);

class vec3
  {
  public:
    double x, y, z;
    vec3 &operator*= (double fact);
    double Length () const;
  };

using namespace std;

void toAxisAngle (vec3 &axis, double &angle)
  {
  double c2=8;
  axis.x=9; axis.y=7; axis.z=7;

  double s2 = 0;

  angle = atan2(s2,c2);
  axis *= 1/s2;
  }

Without optimization, the compilation succeeds, but when -O -ffast-math are
added the compiler crashes with the following output:

~/data/planck/LevelS/cxxmod>g++ -c -O -ffast-math -v bla.cc
Reading specs from /afs/mpa/data/martin/ugcc/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Configured with: /scratch/gcc/configure --prefix=/afs/mpa/data/martin/ugcc
--enable-languages=c++ --enable-namespaces
Thread model: posix
gcc version 3.4 20030526 (experimental)
 /afs/mpa/data/martin/ugcc/lib/gcc-lib/i686-pc-linux-gnu/3.4/cc1plus -quiet -v
-D_GNU_SOURCE bla.cc -quiet -dumpbase bla.cc -auxbase bla -O -version
-ffast-math -o /tmp/cc8c9jQa.s
ignoring nonexistent directory "/afs/mpa/data/martin/ugcc/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /afs/mpa/data/martin/ugcc/include/c++/3.4
 /afs/mpa/data/martin/ugcc/include/c++/3.4/i686-pc-linux-gnu
 /afs/mpa/data/martin/ugcc/include/c++/3.4/backward
 /usr/local/include
 /afs/mpa/data/martin/ugcc/include
 /afs/mpa/data/martin/ugcc/lib/gcc-lib/i686-pc-linux-gnu/3.4/include
 /usr/include
End of search list.
GNU C++ version 3.4 20030526 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 3.4 20030526 (experimental).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64489
bla.cc: In function `void toAxisAngle(vec3&, double&)':
bla.cc:22: internal compiler error: in subst_stack_regs_pat, at reg-stack.c:
   1468
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]