From patchwork Mon Oct 8 19:23:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 190110 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 5997D2C0315 for ; Tue, 9 Oct 2012 06:23:51 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1350329033; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=GxP3frQr//P48LtdfC2G NxBKp08=; b=QWwuFR/7QAzcnP/8TcKp2s4KbG+MIiKuHKClhD3NQ6F6qI7BMKQP j8scPTYgeLzagMT2Za5ebXGcQmXEmj7c1DQKzQGOqW9qO3xbWm0APTUbfW9NpojO TnxFxHpLFbmFysOjeH+mDzKkUFu7BcLhJSPgQ0ZPDPJ3B74oY2O+nRQ= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=uA7/mtI3yLQ4ghCnXP7FIDh7W0qHP2iikSQYjVoq1vFaUX02lyZwRzWfpfw2JW zID5E81z+yuxMdF7XV7C/EkdT01ohzwZd0r6ZeP9N8GGwjQMRWBN0+OQWDWfWLK4 +Kw1TdUD7Nlfbtj2MQVMiaRdIkKHPbNOP4wQFIjddj30U=; Received: (qmail 18418 invoked by alias); 8 Oct 2012 19:23:45 -0000 Received: (qmail 18406 invoked by uid 22791); 8 Oct 2012 19:23:44 -0000 X-SWARE-Spam-Status: No, hits=-7.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Oct 2012 19:23:30 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q98JNTkN014125 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 8 Oct 2012 15:23:29 -0400 Received: from zalov.redhat.com (vpn1-7-35.ams2.redhat.com [10.36.7.35]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q98JNRQe021707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 8 Oct 2012 15:23:29 -0400 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id q98JNRTO005650; Mon, 8 Oct 2012 21:23:27 +0200 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id q98JNQ8w005649; Mon, 8 Oct 2012 21:23:26 +0200 Date: Mon, 8 Oct 2012 21:23:26 +0200 From: Jakub Jelinek To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Subject: [C++ PATCH] Fix ICE in cp_tree_equal (PR c++/54858) Message-ID: <20121008192326.GB26735@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi! The following testcase ICEs because cp_tree_equal doesn't handle FIELD_DECLs (in 4.4 it was enough to have c0/d0 and c1/d1 in the testcase, now 12 lines are needed due to introduction of a hash table). Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk/4.7? 2012-10-08 Jakub Jelinek PR c++/54858 * tree.c (cp_tree_equal): Handle FIELD_DECL. * g++.dg/template/crash113.C: New test. Jakub --- gcc/cp/tree.c.jj 2012-10-05 21:26:54.000000000 +0200 +++ gcc/cp/tree.c 2012-10-08 18:19:00.897543649 +0200 @@ -2559,6 +2559,7 @@ cp_tree_equal (tree t1, tree t2) case VAR_DECL: case CONST_DECL: + case FIELD_DECL: case FUNCTION_DECL: case TEMPLATE_DECL: case IDENTIFIER_NODE: --- gcc/testsuite/g++.dg/template/pr54858.C.jj 2012-10-08 18:15:55.470586784 +0200 +++ gcc/testsuite/g++.dg/template/pr54858.C 2012-10-08 18:14:28.000000000 +0200 @@ -0,0 +1,21 @@ +// PR c++/54858 +// { dg-do compile } + +template struct A {}; +template struct B {}; +template struct C +{ + A<0> c0; B, &C::c0> d0; // { dg-error "could not convert template argument" } + A<0> c1; B, &C::c1> d1; // { dg-error "could not convert template argument" } + A<0> c2; B, &C::c2> d2; // { dg-error "could not convert template argument" } + A<0> c3; B, &C::c3> d3; // { dg-error "could not convert template argument" } + A<0> c4; B, &C::c4> d4; // { dg-error "could not convert template argument" } + A<0> c5; B, &C::c5> d5; // { dg-error "could not convert template argument" } + A<0> c6; B, &C::c6> d6; // { dg-error "could not convert template argument" } + A<0> c7; B, &C::c7> d7; // { dg-error "could not convert template argument" } + A<0> c8; B, &C::c8> d8; // { dg-error "could not convert template argument" } + A<0> c9; B, &C::c9> d9; // { dg-error "could not convert template argument" } + A<0> ca; B, &C::ca> da; // { dg-error "could not convert template argument" } + A<0> cb; B, &C::cb> db; // { dg-error "could not convert template argument" } +}; +C e;