From patchwork Wed Jul 17 16:38:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pchang9@cs.wisc.edu X-Patchwork-Id: 259716 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 7D5D12C0079 for ; Thu, 18 Jul 2013 02:39:11 +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 :message-id:date:subject:from:to:mime-version:content-type; q= dns; s=default; b=NvypRUcuMcvSFT9B28SnQqmYidw+jr0qTcfl/4dYAfdBiB yzIF7/Ni1LoKNuUwOwP0Ys2WYgZsOp28EzeYMTM7MgqljbCqppvxcBgTpoCY8W5G dv7fm4nGn3vRlhkRGG/yiSHbwWOJZwDDJoTiswD0EY+HDUgcL7TgRICIePH7M= 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 :message-id:date:subject:from:to:mime-version:content-type; s= default; bh=1SnTlWWhPkoL5PKFukzybtqbdLc=; b=IjIpnDiCq5xV8Doo9g/5 /ENBhXBp5kRcioJ3wBQzcI5oFldDuah6b1O6bLQqypDnna2cUNZyXhh9ASa2Dq8M 0vgIdve5pknJJkypwF/0ZTZ5BBolyZ6xr7hUnQ1z5SKx0c6xD7NHODkif4HtFAH6 ECyG86Lxe0QLMkSILokUnL8= Received: (qmail 8870 invoked by alias); 17 Jul 2013 16:39:03 -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 8861 invoked by uid 89); 17 Jul 2013 16:39:03 -0000 X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_20, RCVD_IN_DNSWL_MED, RCVD_IN_HOSTKARMA_W, RDNS_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 Received: from Unknown (HELO sandstone.cs.wisc.edu) (128.105.6.39) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 17 Jul 2013 16:39:02 +0000 Received: from webmail.cs.wisc.edu (george.cs.wisc.edu [128.105.7.110]) by sandstone.cs.wisc.edu (8.14.1/8.14.1) with ESMTP id r6HGcscg002769 for ; Wed, 17 Jul 2013 11:38:54 -0500 Received: from 72.33.255.231 (SquirrelMail authenticated user pchang9) by webmail.cs.wisc.edu with HTTP; Wed, 17 Jul 2013 11:38:54 -0500 Message-ID: <3ee8c50b1df5dd4ff6403be6416ef009.squirrel@webmail.cs.wisc.edu> Date: Wed, 17 Jul 2013 11:38:54 -0500 Subject: [Patch, PR 57805] Wasted work in write_roots() From: pchang9@cs.wisc.edu To: gcc-patches@gcc.gnu.org User-Agent: SquirrelMail/1.4.22 MIME-Version: 1.0 X-Virus-Found: No Hi, The problem appears in revision 200945 in version 4.9. I attached a one-line patch that fixes it. I also reported this problem at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57805. In method "write_roots()" in gcc/gengtype.c, the loop on line 4682 should break immediately after "skip_p" is set to "1". All the iterations after "skip_p" set to "1" do not perform any useful work, at best they just set "skip_p" again to "1". Suggested patch: -Chang Index: gcc/gengtype.c =================================================================== --- gcc/gengtype.c (revision 200945) +++ gcc/gengtype.c (working copy) @@ -4682,7 +4682,10 @@ for (o = v->opt; o; o = o->next) if (strcmp (o->name, "deletable") == 0 || strcmp (o->name, "if_marked") == 0) - skip_p = 1; + { + skip_p = 1; + break; + } if (skip_p) continue; Index: gcc/gengtype.c =================================================================== --- gcc/gengtype.c (revision 200945) +++ gcc/gengtype.c (working copy) @@ -4682,7 +4682,10 @@ for (o = v->opt; o; o = o->next) if (strcmp (o->name, "deletable") == 0 || strcmp (o->name, "if_marked") == 0) - skip_p = 1; + { + skip_p = 1; + break; + } if (skip_p) continue;