From patchwork Thu Feb 4 17:29:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Mahoney X-Patchwork-Id: 10735 Received: (qmail 17126 invoked by alias); 4 Feb 2016 17:29:43 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 16944 invoked by uid 89); 4 Feb 2016 17:29:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=circuit X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 04 Feb 2016 17:29:40 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 49362ACDA for ; Thu, 4 Feb 2016 17:29:37 +0000 (UTC) Received: by starscream.home.jeffm.io (Postfix, from userid 1000) id 748E48992E; Thu, 4 Feb 2016 12:29:34 -0500 (EST) From: jeffm@suse.com To: gdb-patches@sourceware.org Cc: Jeff Mahoney Subject: [PATCH 1/7] check_types_equal: short circuit check if identical pointers are used Date: Thu, 4 Feb 2016 12:29:27 -0500 Message-Id: <1454606973-31017-2-git-send-email-jeffm@suse.com> In-Reply-To: <1454606973-31017-1-git-send-email-jeffm@suse.com> References: <1454606973-31017-1-git-send-email-jeffm@suse.com> X-IsSubscribed: yes From: Jeff Mahoney If two types share identical pointers, we don't need to check typedefs before comparing the result. --- gdb/gdbtypes.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index b9850cf..1b6f276 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -3218,6 +3218,9 @@ static int check_types_equal (struct type *type1, struct type *type2, VEC (type_equality_entry_d) **worklist) { + if (type1 == type2) + return 1; + type1 = check_typedef (type1); type2 = check_typedef (type2);