From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28430 invoked by alias); 18 Aug 2010 22:05:25 -0000 Received: (qmail 28381 invoked by uid 48); 18 Aug 2010 22:05:10 -0000 Date: Wed, 18 Aug 2010 22:05:00 -0000 Message-ID: <20100818220510.28380.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/45293] ICE in iterative_hash_template_arg, at cp/pt.c:1589 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "fang at csl dot cornell dot edu" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-08/txt/msg01506.txt.bz2 ------- Comment #8 from fang at csl dot cornell dot edu 2010-08-18 22:05 ------- reduced test case (manually reduced after delta): =========================================================== typedef long unsigned int size_t; template struct never_ptr { T* ptr; T* operator -> () const throw() { return ptr; } }; namespace HAC { template class instance_collection_pool_bundle; template class footprint_base { typedef instance_collection_pool_bundle collection_pool_bundle_type; protected: const never_ptr collection_pool_bundle; }; struct process_tag; template class instance_collection; template struct class_traits; template class instance_alias_info; } namespace std { template struct default_vector { typedef size_t type; }; } namespace HAC { class footprint : private footprint_base { void operator [] ( const size_t ) const; }; class physical_instance_collection; template class instance_array; typedef instance_collection process_instance_collection; typedef instance_alias_info process_instance_alias_info; template class general_collection_type_manager; template <> struct class_traits { typedef process_tag tag_type; typedef process_instance_alias_info instance_alias_info_type; typedef process_instance_collection instance_collection_generic_type; typedef physical_instance_collection instance_collection_parent_type; typedef general_collection_type_manager collection_type_manager_parent_type; }; class instance_collection_base { }; class physical_instance_collection : public instance_collection_base { }; template class collection_interface : public class_traits::instance_collection_parent_type { }; template class instance_collection : public collection_interface, public class_traits::collection_type_manager_parent_type { public: typedef class_traits traits_type; typedef typename traits_type::instance_alias_info_type instance_alias_info_type; typedef never_ptr const_instance_alias_info_ptr_type; }; template class general_collection_type_manager { }; template class instance_collection_pool_wrapper { public: typedef T collection_type; typedef typename collection_type::traits_type::tag_type tag_type; }; template struct instance_collection_pool_bundle : public instance_collection_pool_wrapper > { void lookup_collection(void) const; }; template class instance_array : public instance_collection { public: typedef class_traits traits_type; typedef typename traits_type::instance_collection_generic_type parent_type; typedef typename parent_type::const_instance_alias_info_ptr_type const_instance_alias_info_ptr_type; void get_all_aliases(typename std::default_vector::type&) const; }; template class instance_array : public instance_collection { public: typedef class_traits traits_type; typedef typename traits_type::instance_collection_generic_type parent_type; typedef typename parent_type::const_instance_alias_info_ptr_type const_instance_alias_info_ptr_type; void get_all_aliases(typename std::default_vector::type&) const; }; void footprint::operator [] ( const size_t ) const { footprint_base::collection_pool_bundle->lookup_collection(); } } =========================================================== This should be a valid test case, passes g++-4.0.1. reducing script: #!/bin/sh -e # must be valid for g++-4.0.1! (powerpc-apple-darwin8) g++ -o footprint.o -c footprint.ii > /dev/null 2>&1 # then fail specifically with ICE g++-fsf-4.5 -o footprint.o -c footprint.ii > footprint.err 2>&1 || : grep -q "internal compiler error: in iterative_hash_template_arg, at cp/pt.c:1589" footprint.err keywords: ICE-on-valid-code -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45293