From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4589 invoked by alias); 18 Jun 2003 14:04:13 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 4573 invoked by uid 48); 18 Jun 2003 14:04:12 -0000 Date: Wed, 18 Jun 2003 14:04:00 -0000 From: "ehrhardt at mathematik dot uni-ulm dot de" To: gcc-bugs@gcc.gnu.org Message-ID: <20030618140410.11237.ehrhardt@mathematik.uni-ulm.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/11237] New: Internal Compiler Error (segfault) in convert_from_reference at cvt.c:568 X-Bugzilla-Reason: CC X-SW-Source: 2003-06/txt/msg02014.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11237 Summary: Internal Compiler Error (segfault) in convert_from_reference at cvt.c:568 Product: gcc Version: 3.3 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: critical Priority: P2 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: ehrhardt@mathematik.uni-ulm.de CC: gcc-bugs@gcc.gnu.org,stip@mathematik.uni-ulm.de The code ICEs all versions of gcc since 2.95 and up to 3.4. The ICE is in this piece of code in cvt.c where we have type == NULL: tree convert_from_reference (val) tree val; { tree type = TREE_TYPE (val); if (TREE_CODE (type) == OFFSET_TYPE) type = TREE_TYPE (type); if (TREE_CODE (type) == REFERENCE_TYPE) return build_indirect_ref (val, NULL); return val; } Comeau's C++ compiler accepts the code in strict C++ mode. Here's the code: -------------------- cut ----------------------------- template struct restrictTo { typedef T type; }; template struct isDifferentType { static const bool value = true; }; template class ConstDenseVector { }; class MultiIndex { }; template void operator+(ConstDenseVector u, ConstDenseVector v) { } template typename restrictTo< true || isDifferentType< V, V >::value, void>::type operator+(U u, V v) { operator+(u, u); } int main() { ConstDenseVector v; MultiIndex mi; v + mi; } -------------------- cut ----------------------------- regards Christian