Bug 24277 - [4.0/4.1 Regression] Boost causes ICE in build_c_cast, at cp/typeck.c:5231
Summary: [4.0/4.1 Regression] Boost causes ICE in build_c_cast, at cp/typeck.c:5231
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.3
: P2 normal
Target Milestone: 4.0.3
Assignee: Mark Mitchell
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-10-08 19:00 UTC by Jonathan Wakely
Modified: 2005-10-11 06:28 UTC (History)
1 user (show)

See Also:
Host: x86_64-redhat-linux
Target:
Build:
Known to work:
Known to fail: 4.1.0 4.0.3
Last reconfirmed: 2005-10-08 20:24:58


Attachments
Pre-processed source, gzip-compressed (16.94 KB, application/octet-stream)
2005-10-08 19:01 UTC, Jonathan Wakely
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Wakely 2005-10-08 19:00:34 UTC
4.0.3 20051008 ICEs while compiling ths, using Boost CVS-HEAD

#include <boost/crc.hpp> // for boost::crc_basic, etc.

// Run tests on CRCs below a byte in size (here, 3 bits)
void small_crc_test1()
{
    unsigned char const samples[4][4]
      = {
            { 0x3A, 0xC4, 0x08, 0x06 },
            { 0x42, 0xC5, 0x0A, 0x41 },
            { 0x4A, 0xC5, 0x08, 0x22 },
            { 0x52, 0xC4, 0x08, 0x05 }
        };

    boost::crc<3, 0x03, 0, 0, false, false>(samples[0], 4);
}

3.4 and 4.1 accept this, I think 4.0 might have done until recently.
Comment 1 Jonathan Wakely 2005-10-08 19:01:51 UTC
Created attachment 9938 [details]
Pre-processed source, gzip-compressed
Comment 2 Andrew Pinski 2005-10-08 19:21:09 UTC
the mainline as of today ICEs.
Comment 3 Andrew Pinski 2005-10-08 19:31:03 UTC
Reducing.
Comment 4 Andrew Pinski 2005-10-08 20:24:58 UTC
Confirmed, reduced testcase:
template< int Bits > struct uint_t {
  typedef unsigned short fast;
};
template < int Bits > struct mask_uint_t {
  typedef typename uint_t< Bits >::fast fast;
  static const fast sig_bits = 1;
  static const fast sig_bits_fast = fast(sig_bits);
};
template < int Bits> int checksum ( ) {
  return 1 & mask_uint_t<Bits>::sig_bits_fast;
}
int i = checksum<1>();
Comment 5 GCC Commits 2005-10-11 06:25:53 UTC
Subject: Bug 24277

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	mmitchel@gcc.gnu.org	2005-10-11 06:25:50

Modified files:
	gcc/cp         : pt.c ChangeLog 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: static20.C 

Log message:
	PR c++/24277
	* pt.c (instantiate_decl): Call finish_static_data_member_decl for
	static data members.
	PR c++/24277
	* g++.dg/template/static20.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.978.2.29&r2=1.978.2.30
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.122&r2=1.4648.2.123
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/static20.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.440&r2=1.5084.2.441

Comment 6 GCC Commits 2005-10-11 06:26:08 UTC
Subject: Bug 24277

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2005-10-11 06:26:04

Modified files:
	gcc/cp         : pt.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: static20.C 

Log message:
	PR c++/24277
	* pt.c (instantiate_decl): Call finish_static_data_member_decl for
	static data members.
	PR c++/24277
	* g++.dg/template/static20.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.1042&r2=1.1043
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/static20.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6161&r2=1.6162

Comment 7 Mark Mitchell 2005-10-11 06:28:14 UTC
Fixed in 4.0.3.