From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32134 invoked by alias); 30 May 2012 04:45:13 -0000 Received: (qmail 32116 invoked by uid 22791); 30 May 2012 04:45:10 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED,TW_GM X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 May 2012 04:44:55 +0000 From: "jimis at gmx dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/53525] Performance regression due to enabling track-macro-expansion Date: Wed, 30 May 2012 04:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jimis at gmx dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-05/txt/msg02804.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53525 --- Comment #2 from jimis 2012-05-30 04:44:54 UTC --- According to valgrind major overhead is due to numerous calls of line-map.c:linemap_line_start() that actually allocate new line_maps. This happens because we are resetting the max_column_hint whenever we enter macro context in enter_macro_context()->linemap_enter_macro(). The following one-liner seems to resolve this, as run time is improved by about 7ms or 45 M Instr. === modified file 'libcpp/line-map.c' --- libcpp/line-map.c 2012-04-30 11:42:12 +0000 +++ libcpp/line-map.c 2012-05-27 06:52:08 +0000 @@ -331,7 +331,6 @@ linemap_enter_macro (struct line_maps *s num_tokens * sizeof (source_location)); LINEMAPS_MACRO_CACHE (set) = LINEMAPS_MACRO_USED (set) - 1; - set->max_column_hint = 0; return map; }