From patchwork Sat May 11 00:16:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 243101 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id E2A352C00F3 for ; Sat, 11 May 2013 10:16:12 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=ww/0V59jkJfp4bp6x fi2KGSfkr3RfRWQDjxb+CbeCt0KtGt7T2FUniPbpB0ggGvdfZT2Vk+ius8Xv624g qgdaGHGF5u2iffJPco7HtTLhJtGQgk8+htU4NIETizXMvRobpwwR5AiuVL6cG+6x bU8aT/lmt8jO1qeXRllcWVwvxk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=rk7vaHGYJ46dQMWYRyb7d6j 2dbE=; b=g61ywuUwJOuJ9Gmef0LrjxqQEC0t53bvreZLjV7DkSR28ShfhuofGdl xZNsx2XxWWQ8018GtjPkmz6SRl5TqkH64VqJ822qutRB5NCvsMtAUKvMoxRxxNTC A7ESyhtQYr3aQ8RjAxfZvloF323WL1zGb17YWAETxe6fCGUnV3JQ= Received: (qmail 26395 invoked by alias); 11 May 2013 00:16:06 -0000 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 Received: (qmail 26385 invoked by uid 89); 11 May 2013 00:16:05 -0000 X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 11 May 2013 00:16:04 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 840985418B7; Sat, 11 May 2013 02:16:01 +0200 (CEST) Date: Sat, 11 May 2013 02:16:01 +0200 From: Jan Hubicka To: Richard Biener Cc: Jan Hubicka , Martin Jambor , GCC Patches Subject: Re: [PATCH] Use types_compatible_p in get_binfo_at_offset Message-ID: <20130511001601.GB29273@kam.mff.cuni.cz> References: <20130510171251.GG3568@virgil.suse> <20130510172405.GF23785@atrey.karlin.mff.cuni.cz> <20130510174056.GI3568@virgil.suse> <32c47948-a107-4275-a9ac-8f7805209a1b@email.android.com> <20130510190133.GA8298@atrey.karlin.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) > > The existing check should work ok with lto. If not then we should figure out why we do not merge the main variants properly. Hmm, adding: seems to bring a lot of positives and by quick inspection most of them seem like same classes. I will try to find some time to debug this more. But glancing over the the dumps, I see many of them just have different name spaces. Do we even attempt to merge namespace_decl? How types from same namespaces in different units are supposed to match? Honza > > Richard. > > >Honza > Index: tree.c =================================================================== --- tree.c (revision 198796) +++ tree.c (working copy) @@ -11572,6 +11572,12 @@ get_binfo_at_offset (tree binfo, HOST_WI if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (expected_type)) return binfo; + else + if (types_compatible_p (type, expected_type)) + { + debug_tree (TYPE_MAIN_VARIANT (type)); + debug_tree (TYPE_MAIN_VARIANT (expected_type)); + } if (offset < 0) return NULL_TREE; @@ -11605,6 +11611,12 @@ get_binfo_at_offset (tree binfo, HOST_WI found_binfo = base_binfo; break; } + else + if (types_compatible_p (TREE_TYPE (base_binfo), TREE_TYPE (fld))) + { + debug_tree (TREE_TYPE (base_binfo)); + debug_tree (TREE_TYPE (fld)); + } if (!found_binfo) return NULL_TREE; binfo = found_binfo;