Bug 21188 - [4.1 Regression] CbcModel.cpp:3571: internal compiler error: in compare_values, at tree-vrp.c:292
Summary: [4.1 Regression] CbcModel.cpp:3571: internal compiler error: in compare_value...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Andrew Pinski
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-valid-code, patch
: 21227 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-24 12:52 UTC by devries
Modified: 2005-04-25 23:51 UTC (History)
3 users (show)

See Also:
Host: powerpc-apple-darwin7
Target: powerpc-apple-darwin7
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-04-24 13:29:43


Attachments
this is the ii file that causes the trouble.... (142.17 KB, application/octet-stream)
2005-04-24 13:00 UTC, devries
Details
patch which should fix this (320 bytes, patch)
2005-04-24 13:42 UTC, Andrew Pinski
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description devries 2005-04-24 12:52:23 UTC
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?
Comment 1 devries 2005-04-24 13:00:01 UTC
Created attachment 8723 [details]
this is the ii file that causes the trouble....

this file demonstrates the prob....
Comment 2 Andrew Pinski 2005-04-24 13:29:41 UTC
Reduced testcase:
struct class1
{
  virtual ~class1 ();
};
struct class2 :  class1 { };

void f(class1 * oo)
{
  class2 * oj = dynamic_cast <class2 *>(oo) ;
  if (oj)
    delete oo;
}
Comment 3 Andrew Pinski 2005-04-24 13:31:43 UTC
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.
Comment 4 Andrew Pinski 2005-04-24 13:42:03 UTC
Created attachment 8724 [details]
patch which should fix this

I am bootstrapping this fix right now.
Comment 5 Andrew Pinski 2005-04-25 17:44:38 UTC
Patch posted: <http://gcc.gnu.org/ml/gcc-patches/2005-04/msg02623.html>.
Comment 6 Andrew Pinski 2005-04-25 18:08:56 UTC
Fixed.
Comment 7 GCC Commits 2005-04-25 18:09:36 UTC
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

Comment 8 Andrew Pinski 2005-04-25 23:51:21 UTC
*** Bug 21227 has been marked as a duplicate of this bug. ***