From patchwork Mon Oct 8 15:58:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 190055 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 89F6E2C02BC for ; Tue, 9 Oct 2012 02:58:33 +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=1350316714; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Date:From:To:Subject:Message-ID: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=qLPDCm+7mLLQQrX97nj+gSetRYM=; b=trSuYW9Hj1eA0bQ ghkSwQhNqfqXjpHpaBlhQ5nqLoQ49L9GAw8DEtfEk8VHxsYISGaZTtXMbvKly0zZ NXQVn1xH0tuN73tWKYDb6K2b/a7/vWvcJo5KRq9O+Uf5Y3AQYGTMW2XYp03X6Qha 38H0X1AT/lnVM1aU9yGriZAUq828= 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:Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ud+ayD3DQKz3qLgvHtybdkxpl01GhUc4rzWny3tgwHIDn8QRa0f89gAhuDBdh+ 6YFAfrKhfnjfjwLQ5nqS0DCMRpBVb0SvJKoYKb7Qo2C7MOo77nwun9E/f+w1Z+C4 pwBB/rT396vnyqpjEGHTJltTtJWxdM9ac5g5gBd43YO94=; Received: (qmail 20812 invoked by alias); 8 Oct 2012 15:58:29 -0000 Received: (qmail 20800 invoked by uid 22791); 8 Oct 2012 15:58:28 -0000 X-SWARE-Spam-Status: No, hits=-7.4 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 15:58:24 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q98FwOtT016482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 8 Oct 2012 11:58:24 -0400 Received: from redhat.com (ovpn-116-46.ams2.redhat.com [10.36.116.46]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q98FwFHk028609 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Mon, 8 Oct 2012 11:58:23 -0400 Date: Mon, 8 Oct 2012 17:58:15 +0200 From: Marek Polacek To: GCC Patches Subject: [PATCH] Fix up vt_add_function_parameter (PR debug/54831) Message-ID: <20121008155815.GR10286@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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 As the testcase shows, we ICEd when generating the debug info for C++ and not splitting types into multiple registers. The issue is in vt_add_function_parameter that we assumed that the DECL_RTL expression was a pseudo register. But in that case it is better to just give up than to ICE. Regtested/bootstrapped on x86_64, ok for trunk? 2012-10-08 Marek Polacek PR debug/54831 * var-tracking.c (vt_add_function_parameter): Use condition in place of gcc_assert. * testsuite/g++.dg/debug/pr54831.C: New test. Marek --- gcc/testsuite/g++.dg/debug/pr54831.C.mp 2012-10-08 12:14:55.790807737 +0200 +++ gcc/testsuite/g++.dg/debug/pr54831.C 2012-10-08 12:51:53.856042257 +0200 @@ -0,0 +1,20 @@ +// PR debug/54831 +// { dg-do compile } +// { dg-options "-O -fno-split-wide-types -g" } + +struct S +{ + int m1(); + int m2(); +}; + +typedef void (S::*mptr) (); + +mptr gmp; +void bar (mptr f); + +void foo (mptr f) +{ + f = gmp; + bar (f); +} --- gcc/var-tracking.c.mp 2012-10-08 10:56:32.354556352 +0200 +++ gcc/var-tracking.c 2012-10-08 12:50:09.627307344 +0200 @@ -9404,12 +9404,13 @@ vt_add_function_parameter (tree parm) if (parm != decl) { - /* Assume that DECL_RTL was a pseudo that got spilled to - memory. The spill slot sharing code will force the + /* If that DECL_RTL wasn't a pseudo that got spilled to + memory, bail out. The spill slot sharing code will force the memory to reference spill_slot_decl (%sfp), so we don't match above. That's ok, the pseudo must have referenced the entire parameter, so just reset OFFSET. */ - gcc_assert (decl == get_spill_slot_decl (false)); + if (decl != get_spill_slot_decl (false)) + return; offset = 0; }