From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16152 invoked by alias); 25 Oct 2011 13:43:35 -0000 Received: (qmail 16135 invoked by uid 22791); 25 Oct 2011 13:43:34 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Oct 2011 13:43:16 +0000 Received: from hpaq6.eem.corp.google.com (hpaq6.eem.corp.google.com [172.25.149.6]) by smtp-out.google.com with ESMTP id p9PDhEU0029212 for ; Tue, 25 Oct 2011 06:43:14 -0700 Received: from pzk4 (pzk4.prod.google.com [10.243.19.132]) by hpaq6.eem.corp.google.com with ESMTP id p9PDgWlR003823 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 25 Oct 2011 06:43:12 -0700 Received: by pzk4 with SMTP id 4so2230914pzk.6 for ; Tue, 25 Oct 2011 06:43:12 -0700 (PDT) Received: by 10.68.208.229 with SMTP id mh5mr57193158pbc.124.1319550192526; Tue, 25 Oct 2011 06:43:12 -0700 (PDT) Received: by 10.68.208.229 with SMTP id mh5mr57193134pbc.124.1319550192369; Tue, 25 Oct 2011 06:43:12 -0700 (PDT) Received: from coign.google.com ([66.109.104.177]) by mx.google.com with ESMTPS id g1sm7350184pbv.2.2011.10.25.06.43.10 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Oct 2011 06:43:11 -0700 (PDT) From: Ian Lance Taylor To: Harry Trinta Cc: gcc-help Subject: Re: Data-flow informations (CFG) References: Date: Tue, 25 Oct 2011 13:43:00 -0000 In-Reply-To: (Harry Trinta's message of "Tue, 25 Oct 2011 04:21:08 -0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00214.txt.bz2 Harry Trinta writes: >> The CFG doesn't have any declarations. In effect all declarations are >> moved to the outer-most block of a function, renamed as necessary. > > Truth. The CFC of GCC does not have the DECLARATIONS. =( > > I know that declarations is not in a block of the CFG in fact. But if > we analyze the code, a declaration always is a "part" of a block too. > So, there is no way to see in which block a declaration was made? Assuming we are talking about C or C++, then if you look at GENERIC immediately after parsing, you can find the declarations by looking for DECL_EXPR statements. However, at that point there is no CFG, and the DECL_EXPR statements are dropped when moving to GIMPLE. So, no, gcc does not have any representation of the program which includes both a CFG and records which block contains a declaration. At least as far as I know. Ian