From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15858 invoked by alias); 4 Jun 2009 05:33:07 -0000 Received: (qmail 15847 invoked by uid 22791); 4 Jun 2009 05:33:06 -0000 X-SWARE-Spam-Status: No, hits=0.7 required=5.0 tests=AWL,BAYES_05,BOTNET,RDNS_NONE X-Spam-Check-By: sourceware.org Received: from Unknown (HELO your.mail.server.name.com) (63.224.70.214) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Thu, 04 Jun 2009 05:32:58 +0000 Received: (qmail 12742 invoked from network); 4 Jun 2009 05:27:34 -0000 Received: from unknown (HELO localhost) (10.128.1.121) by 0 with SMTP; 4 Jun 2009 05:27:34 -0000 Received: from jlquinn by localhost with local (Exim 4.69) (envelope-from ) id 1MBx40-0006DE-Gb for gcc@gcc.gnu.org; Wed, 03 Jun 2009 16:27:56 -0400 Subject: Help with BLOCK vs BIND_EXPR trees? From: Jerry Quinn To: gcc@gcc.gnu.org Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Thu, 04 Jun 2009 05:33:00 -0000 Message-Id: <1244060875.5429.51.camel@localhost> Mime-Version: 1.0 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00054.txt.bz2 Hi, all. I have a basic question about GENERIC trees. I'm playing with writing a front end, and find the distinction between BLOCK and BIND_EXPR to be somewhat confusing. In particular, I'm trying to get a handle on how to represent a function in GENERIC form. On the surface the texi docs and code comments don't seem to agree: Section on function trees say FUNCTION_DECL represents a function, and that DECL_INITIAL is not empty. But it doesn't say what should be contained there. It says DECL_SAVED_TREE should contain the body of the function. The comments in tree.h say that DECL_INITIAL holds the body of a function, with a BLOCK tree at the root. BLOCK nodes are described under TREE_SSA->GIMPLE, though these nodes are part of GENERIC if I understand correctly. In this section, it says that block scopes and variables are declared in BIND_EXPR nodes. Can someone please clarify how these things are supposed to relate in GENERIC form, assuming the default conversion to GIMPLE will be used? Thanks, Jerry Quinn