From patchwork Thu Aug 22 15:03:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 269087 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 068AD2C0092 for ; Fri, 23 Aug 2013 01:03:29 +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:subject:message-id:mime-version:content-type; q=dns; s= default; b=DHOyF7xWBqXZXG/alT5v3I2ucB2HbidHLqsWc3nNTip4THwimWHlp iVeFhSfL1CON+U2qZawVEmuWu/iHBCggSjFSVYntPFEHp749M8EtIcM2+UxH+y5i SmYaOCrxjs42YzrX6HIOohRyVmBCMRg3RzTcCM5AJbnXvxT1DXsCSs= 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:subject:message-id:mime-version:content-type; s= default; bh=WlKVLpogpBlKj815nypMFPTFg1g=; b=LfbUypyRhFjVYxfzaDTj lFXkXAIOw2csxAAEkwGY+NoJgDiDPjTugtZRTDjMVB9kkw2mW4JL+PLI3FjTxjEk rRwQKPnqDQj5Vp5j/Q8+q8BKvg5o4w4+ghY482HI6HpMsbJ4Gi2I7Yr5r9XzbzJg QWJuC9OXF4szayeuZOya6jA= Received: (qmail 25015 invoked by alias); 22 Aug 2013 15:03:22 -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 25006 invoked by uid 89); 22 Aug 2013 15:03:22 -0000 X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD autolearn=ham version=3.3.2 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; Thu, 22 Aug 2013 15:03:21 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id E4E4C540C0A; Thu, 22 Aug 2013 17:03:18 +0200 (CEST) Date: Thu, 22 Aug 2013 17:03:18 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix overflows in -ftime-report Message-ID: <20130822150318.GB11005@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Hi, this patch fixes overflow happening in -ftime-report when printing memory usage of bigger WPA compilations. Honza * timevar.c (validate_phases): Use size_t for memory. * timevar.h (struct timevar_time_def): Use size_t for ggc_mem. Index: timevar.c =================================================================== --- timevar.c (revision 201919) +++ timevar.c (working copy) @@ -430,7 +430,7 @@ validate_phases (FILE *fp) double phase_user = 0.0; double phase_sys = 0.0; double phase_wall = 0.0; - unsigned phase_ggc_mem = 0; + size_t phase_ggc_mem = 0; static char phase_prefix[] = "phase "; const double tolerance = 1.000001; /* One part in a million. */ @@ -465,7 +465,7 @@ validate_phases (FILE *fp) if (phase_wall > total->wall) fprintf (fp, "wall %24.18e > %24.18e\n", phase_wall, total->wall); if (phase_ggc_mem > total->ggc_mem) - fprintf (fp, "ggc_mem %24u > %24u\n", phase_ggc_mem, total->ggc_mem); + fprintf (fp, "ggc_mem %24lu > %24lu\n", phase_ggc_mem, total->ggc_mem); gcc_unreachable (); } } Index: timevar.h =================================================================== --- timevar.h (revision 201919) +++ timevar.h (working copy) @@ -62,7 +62,7 @@ struct timevar_time_def double wall; /* Garbage collector memory. */ - unsigned ggc_mem; + size_t ggc_mem; }; /* An enumeration of timing variable identifiers. Constructed from