From patchwork Tue May 17 14:33:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 95942 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 94181B6EDF for ; Wed, 18 May 2011 00:33:47 +1000 (EST) Received: (qmail 2985 invoked by alias); 17 May 2011 14:33:44 -0000 Received: (qmail 2976 invoked by uid 22791); 17 May 2011 14:33:43 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 May 2011 14:33:29 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 6E64D890B6 for ; Tue, 17 May 2011 16:33:28 +0200 (CEST) Date: Tue, 17 May 2011 16:33:28 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fixup LTO SCC hash comparison fn Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 Quite obvious if you look at it for the 100th time... Richard. 2011-05-17 Richard Guenther * gimple.c (type_hash_pair_compare): Fix comparison. Index: gcc/gimple.c =================================================================== --- gcc/gimple.c (revision 173830) +++ gcc/gimple.c (working copy) @@ -4070,9 +4070,11 @@ type_hash_pair_compare (const void *p1_, { const struct type_hash_pair *p1 = (const struct type_hash_pair *) p1_; const struct type_hash_pair *p2 = (const struct type_hash_pair *) p2_; - if (p1->hash == p2->hash) - return TYPE_UID (p1->type) - TYPE_UID (p2->type); - return p1->hash - p2->hash; + if (p1->hash < p2->hash) + return -1; + else if (p1->hash > p2->hash) + return 1; + return 0; } /* Returning a hash value for gimple type TYPE combined with VAL.