From patchwork Mon Aug 8 09:26:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Pettersson X-Patchwork-Id: 108874 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 E160DB6F71 for ; Mon, 8 Aug 2011 19:27:43 +1000 (EST) Received: (qmail 2313 invoked by alias); 8 Aug 2011 09:27:37 -0000 Received: (qmail 1669 invoked by uid 22791); 8 Aug 2011 09:27:21 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, TW_SV X-Spam-Check-By: sourceware.org Received: from fanny.its.uu.se (HELO fanny.its.uu.se) (130.238.4.241) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Aug 2011 09:26:57 +0000 Received: from fanny.its.uu.se (localhost [127.0.0.1]) by fanny.its.uu.se (Postfix) with ESMTP id C16A36273 for ; Mon, 8 Aug 2011 11:26:54 +0200 (MSZ) Received: from pilspetsen.it.uu.se (pilspetsen.it.uu.se [130.238.18.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by fanny.its.uu.se (Postfix) with ESMTP id 714FB61F9 for ; Mon, 8 Aug 2011 11:26:54 +0200 (MSZ) Received: (from mikpe@localhost) by pilspetsen.it.uu.se (8.14.4+Sun/8.14.4) id p789Qrhb019177; Mon, 8 Aug 2011 11:26:54 +0200 (MEST) MIME-Version: 1.0 Message-ID: <20031.43997.941589.223641@pilspetsen.it.uu.se> Date: Mon, 8 Aug 2011 11:26:53 +0200 From: Mikael Pettersson To: gcc-patches@gcc.gnu.org Subject: [PATCH, PR50005] fix -Wsign-compare warning in ipa-inline-analysis.c 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 A recent change in ipa-inline-analysis.c introduced a comparison between signed and unsigned values, which broke bootstrap due to -Wsign-compare (PR50005). Fixed by casting VEC_length to int before using it in a comparison, as is done in many other places. Tested on i686-linux and sparc64-linux. Pre-approved by Jan Hubicka in the PR trail. Ok for trunk? (I don't have svn write access.) (The warning is only visible with the C FE due to an unrelated C++ FE diagnostics bug, which I've filed as PR50012.) /Mikael gcc/ 2011-08-08 Mikael Pettersson PR tree-optimization/50005 * ipa-inline-analysis (remap_predicate): Add cast to silence signed/unsigned comparison warning. --- gcc-4.7-20110806/gcc/ipa-inline-analysis.c.~1~ 2011-08-05 22:56:05.000000000 +0200 +++ gcc-4.7-20110806/gcc/ipa-inline-analysis.c 2011-08-07 12:15:46.000000000 +0200 @@ -1873,7 +1873,7 @@ remap_predicate (struct inline_summary * /* See if we can remap condition operand to caller's operand. Otherwise give up. */ if (!operand_map - || VEC_length (int, operand_map) <= c->operand_num + || (int)VEC_length (int, operand_map) <= c->operand_num || VEC_index (int, operand_map, c->operand_num) == -1) cond_predicate = true_predicate (); else