compilation fails with an internal error... g++-4 -v Using built-in specs. Target: powerpc-apple-darwin7 Configured with: ../configure --prefix=/sw --prefix=/sw/lib/gcc4 --enable- languages=c,c++,f95,objc --infodir=/share/info --with-gmp=/sw --with-included-gettext -- host=powerpc-apple-darwin7 --with-as=/sw/lib/odcctools/bin/as --with-ld=/sw/lib/odcctools/bin/ ld Thread model: posix gcc version 4.1.0 20050417 (experimental) the problem is triggered by: /sw/lib/gcc4/libexec/gcc/powerpc-apple-darwin7/4.1.0/cc1plus -fpreprocessed CbcModel.ii -fPIC -quiet -dumpbase CbcModel.cpp -auxbase-strip Darwin-O3/CbcModel.o -O3 -Wall -Wpointer-arith -Wcast-qual -Wwrite-strings -Wconversion -version -o CbcModel.s GNU C++ version 4.1.0 20050417 (experimental) (powerpc-apple-darwin7) compiled by GNU C version 3.3 20030304 (Apple Computer, Inc. build 1495). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 CbcModel.cpp: In member function 'CbcModel* CbcModel::findCliques(bool, int, int, int)': CbcModel.cpp:3369: warning: operation on 'numberCliques' may be undefined CbcModel.cpp: In member function 'double CbcModel::checkSolution(double, const double*, bool)': CbcModel.cpp:3878: warning: unused variable 'integerTolerance' CbcModel.cpp: In member function 'void CbcModel::originalModel(CbcModel*, bool)': CbcModel.cpp:4862: warning: unused variable 'numberIntegerInfeasibilities' CbcModel.cpp:4863: warning: unused variable 'numberObjectInfeasibilities' CbcModel.cpp: In member function 'void CbcModel::findIntegers(bool)': CbcModel.cpp:3571: internal compiler error: in compare_values, at tree-vrp.c:292 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. but how do i include the problematic file?
Created attachment 8723 [details] this is the ii file that causes the trouble.... this file demonstrates the prob....
Reduced testcase: struct class1 { virtual ~class1 (); }; struct class2 : class1 { }; void f(class1 * oo) { class2 * oj = dynamic_cast <class2 *>(oo) ; if (oj) delete oo; }
This is a latent bug in the C++ front-end with respect with dynamic_cast. if (oo.1 == 0) we have the wrong type already.
Created attachment 8724 [details] patch which should fix this I am bootstrapping this fix right now.
Patch posted: <http://gcc.gnu.org/ml/gcc-patches/2005-04/msg02623.html>.
Fixed.
Subject: Bug 21188 CVSROOT: /cvs/gcc Module name: gcc Changes by: pinskia@gcc.gnu.org 2005-04-25 18:08:36 Modified files: gcc/testsuite : ChangeLog gcc/cp : ChangeLog rtti.c Added files: gcc/testsuite/g++.dg/opt: rtti2.C Log message: 2005-04-25 Andrew Pinski <pinskia@physics.uc.edu> PR C++/21188 * g++.dg/opt/rtti2.C: New test. 2005-04-25 Andrew Pinski <pinskia@physics.uc.edu> PR C++/21188 * rtti.c (ifnonnull): Cast the zero comparison operand to the correct type. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/rtti2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5394&r2=1.5395 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4722&r2=1.4723 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/rtti.c.diff?cvsroot=gcc&r1=1.213&r2=1.214
*** Bug 21227 has been marked as a duplicate of this bug. ***