From patchwork Mon Jul 23 08:13:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 172571 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 22F4E2C00EB for ; Mon, 23 Jul 2012 18:14:07 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1343636048; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=1dQjvcVQXnZHa7JcCyeq oIhDH+o=; b=cIHxc4IHcrMMALuCWzPBuv11cTkn7jhoa/5donikAT+KfK3wI+zN I1hZpNB8Se3gUk5mUhsXKeK4rw3Y482Xnnva9hfxsntV1sPko52U5oYDlmBrG6a1 jrD2CpHbiN8MsDmVAVxH16o28e4iCgcEeg5Gp+p92yS8D4pXZO/z2Qw= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=RED9/NWtue3LhgeGEG4mKtvUZY5w/yBVUomdfG3eyRh/z83WfXMAYf3kN9XzkO L1kC/8evSUuDIBIPqIMV0fBg3Nwdp2/uZd+ICrNjJPDZbUi/2NdWJlOdtcUK56ml apvP9ErWgv/bvCBalQisgfGHld8NnSMS2H+CaZ0JN/w7g=; Received: (qmail 27989 invoked by alias); 23 Jul 2012 08:13:50 -0000 Received: (qmail 27959 invoked by uid 22791); 23 Jul 2012 08:13:49 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO, TW_TM X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Jul 2012 08:13:32 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 984DA1C6EBD; Mon, 23 Jul 2012 04:13:31 -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 SiWXOgIxdbIh; Mon, 23 Jul 2012 04:13:31 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 817EC1C7544; Mon, 23 Jul 2012 04:13:31 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 7FC0E92BF6; Mon, 23 Jul 2012 04:13:31 -0400 (EDT) Date: Mon, 23 Jul 2012 04:13:31 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Thomas Quinot Subject: [Ada] Support for coverage analysis of ACCEPT alternatives in SELECT statement Message-ID: <20120723081331.GA5913@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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 This change ensures that the NULL statement generated for coverage analysis purposes in an otherwise empty ACCEPT alternative is not eliminated by GIGI or the code generator by setting its Comes_From_Source flag. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-23 Thomas Quinot * exp_ch9.adb (Ensure_Statement_Present): Mark generated NULL statement as Comes_From_Source so that GIGI does not eliminate it. Index: exp_ch9.adb =================================================================== --- exp_ch9.adb (revision 189768) +++ exp_ch9.adb (working copy) @@ -5484,11 +5484,19 @@ ------------------------------ procedure Ensure_Statement_Present (Loc : Source_Ptr; Alt : Node_Id) is + Stmt : Node_Id; begin if Opt.Suppress_Control_Flow_Optimizations and then Is_Empty_List (Statements (Alt)) then - Set_Statements (Alt, New_List (Make_Null_Statement (Loc))); + Stmt := Make_Null_Statement (Loc); + + -- Mark NULL statement as coming from source so that it is not + -- eliminated by GIGI. + + Set_Comes_From_Source (Stmt, True); + + Set_Statements (Alt, New_List (Stmt)); end if; end Ensure_Statement_Present;