From patchwork Fri Jul 5 09:43:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 257069 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 AD6642C0090 for ; Fri, 5 Jul 2013 19:44:04 +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:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=Q2TmvP+QZxJ7RjXwH0bY7s7vx/qJMk+tQj0H/NSKx/SnJtUTRm PgDUMrHD/NhtLBz7Ej3JIN7uaCreAhmbt1EDdaycksmxgzy8PYAJdj10Z+p5s7Zw VVGlbivHZy2XdkjDqj4tfHCu9TVCaDhfcVwa3/x4PMH5RVkXXt/eKo95Q= 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:cc:subject:message-id:mime-version:content-type; s= default; bh=iHNGIDeJoaOJ/tT1XUwUXjs88MM=; b=EhaZ6iUEHE5XvHntQwHR XLTSXJNbeAKWJOnzIYjpTAWmrTchvanEhJfzeh9oTzulqKjx2RZVa45c0adFinYy HnZ306DIf4fEHNbpqZrLTOD+DQZ3SWrSIXulp38pLY8qvco4r+hzjA9ho5QmoRej EuLMSOv8q5HxLdJznvJsrv0= Received: (qmail 6211 invoked by alias); 5 Jul 2013 09:43:56 -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 6201 invoked by uid 89); 5 Jul 2013 09:43:55 -0000 X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO autolearn=ham version=3.3.1 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 05 Jul 2013 09:43:54 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 645D21C670D; Fri, 5 Jul 2013 05:43:53 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hPjrT-pwl8Hn; Fri, 5 Jul 2013 05:43:53 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 4B8DE1C666A; Fri, 5 Jul 2013 05:43:53 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 4A6CC3FB31; Fri, 5 Jul 2013 05:43:53 -0400 (EDT) Date: Fri, 5 Jul 2013 05:43:53 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Thomas Quinot Subject: [Ada] Incorrect SCOs for loops in separates Message-ID: <20130705094353.GA2731@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Found: No This change adds a missing guard to the SCO generation circuitry that caused bogus extra SCOs to be generated for loop statements in separate bodies. The following compilation must produce the indicated SCOs: $ gcc -c -fdump-scos pak.adb $ grep "^C" pak.ali C 3 pak-p.adb CS F3:8-3:18 CS >S3:8 4:7-4:7 package body Pak is procedure P is separate; end Pak; package Pak is procedure P; end Pak; separate (Pak) procedure P is begin for J in 0 .. 0 loop null; end loop; end P; 2013-07-05 Thomas Quinot * par_sco.adb (Traverse_Declarations_Or_Statements): Ignore N_Implicit_Label_Declaration nodes. Index: par_sco.adb =================================================================== --- par_sco.adb (revision 200688) +++ par_sco.adb (working copy) @@ -2095,7 +2095,13 @@ if Is_Non_Empty_List (L) then N := First (L); while Present (N) loop - Traverse_One (N); + + -- Note: For separate bodies, we see the tree after Par.Labl has + -- introduced implicit labels, so we need to ignore those nodes. + + if Nkind (N) /= N_Implicit_Label_Declaration then + Traverse_One (N); + end if; Next (N); end loop;