public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34086]  New: g++ crashes on simple 20-line source file
@ 2007-11-13 20:12 nmaquet at gmail dot com
  2007-11-13 20:13 ` [Bug c++/34086] " nmaquet at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: nmaquet at gmail dot com @ 2007-11-13 20:12 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2993 bytes --]

The following code crashes g++ 4.1.3 :


*********START OF FILE**************

#include <iostream>
using namespace std;

double arctan(double x)
{
   int i=1,n=20;
   double c=1.0,arct=0.0,paf=1.0,eps=0.00001,hab;
   hab=(x/(1+x*x));
   do
       {
           arct+=paf;
           c+=2i/(2i+1);
           paf=(c*hab);
           i++;
       }
   while((i<n)||(paf>eps));
   arct*=hab;
   return arct;
}

int main()
{
   double Pi;
   Pi=4*(4*arctan(1/5)-arctan(1/239));
   cout<<Pi<<endl;
}

********* END OF FILE **************

And here's the output of g++ :

nmaquet@nmaquet-desktop:/tmp$ g++ -v test.cpp
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.1.3 --program-suffix=-4.1
--enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug
--enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
 /usr/lib/gcc/i486-linux-gnu/4.1.3/cc1plus -quiet -v -D_GNU_SOURCE test.cpp
-quiet -dumpbase test.cpp -mtune=generic -auxbase test -version
-fstack-protector -fstack-protector -o /tmp/ccQX7fQO.s
ignoring nonexistent directory "/usr/local/include/i486-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../i486-linux-gnu/include"
ignoring nonexistent directory "/usr/include/i486-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.1.3
 /usr/include/c++/4.1.3/i486-linux-gnu
 /usr/include/c++/4.1.3/backward
 /usr/local/include
 /usr/lib/gcc/i486-linux-gnu/4.1.3/include
 /usr/include
End of search list.
GNU C++ version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
(i486-linux-gnu)
        compiled by GNU C version 4.1.3 20070929 (prerelease) (Ubuntu
4.1.2-16ubuntu2).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 3cc47be363985179cfafdceddd0e8f5d
test.cpp: In function ‘double arctan(double)’:
test.cpp:12: internal compiler error: in const_binop, at fold-const.c:1641
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.1/README.Bugs>.
Preprocessed source stored into /tmp/cczf63dY.out file, please attach this to
your bugreport.


-- 
           Summary: g++ crashes on simple 20-line source file
           Product: gcc
           Version: 4.1.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nmaquet at gmail dot com


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


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

end of thread, other threads:[~2008-07-04 16:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-13 20:12 [Bug c++/34086] New: g++ crashes on simple 20-line source file nmaquet at gmail dot com
2007-11-13 20:13 ` [Bug c++/34086] " nmaquet at gmail dot com
2007-11-13 20:16 ` nmaquet at gmail dot com
2007-11-13 21:12 ` fang at csl dot cornell dot edu
2007-11-13 22:38 ` [Bug c++/34086] [4.1 Regression] " rguenth at gcc dot gnu dot org
2007-11-19  5:20 ` pinskia at gcc dot gnu dot org
2008-07-04 16:17 ` jsm28 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).