From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20958 invoked by alias); 12 May 2009 16:27:28 -0000 Received: (qmail 20949 invoked by uid 22791); 12 May 2009 16:27:27 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 May 2009 16:27:22 +0000 Received: from spaceape12.eur.corp.google.com (spaceape12.eur.corp.google.com [172.28.16.146]) by smtp-out.google.com with ESMTP id n4CGRIha012081; Tue, 12 May 2009 17:27:19 +0100 Received: from smtp.corp.google.com (spacemonkey1.corp.google.com [192.168.120.115]) by spaceape12.eur.corp.google.com with ESMTP id n4CGRGUF007859 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 12 May 2009 09:27:17 -0700 Received: from localhost.localdomain.google.com (adsl-71-133-8-30.dsl.pltn13.pacbell.net [71.133.8.30]) (authenticated bits=0) by smtp.corp.google.com (8.13.8/8.13.8) with ESMTP id n4CGRFe2001292 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 12 May 2009 09:27:15 -0700 To: Fengzhe Zhang Cc: gcc@gcc.gnu.org Subject: Re: incomplete tree dump with flag -fdump-tree-all References: <5bed002e0905120130h7311850bt97c7baa94bd3614@mail.gmail.com> From: Ian Lance Taylor Date: Tue, 12 May 2009 16:47:00 -0000 In-Reply-To: <5bed002e0905120130h7311850bt97c7baa94bd3614@mail.gmail.com> (Fengzhe Zhang's message of "Tue\, 12 May 2009 16\:30\:55 +0800") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (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@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-05/txt/msg00306.txt.bz2 Fengzhe Zhang writes: > I found that the tree dump (xxx.c.t00.tu file) with -fdump-tree-all > flag is incomplete in gcc-4.1.2. And the tree-dump.c is not modified > for this bug up to 4.4.0. > > When a function body contains a for-statement or if-statement, the > stmt-list will break, and the rest of the function body is lost. > > I did some search and found an early discussion thread about > -fdump-tree-original-raw: > http://gcc.gnu.org/ml/gcc-bugs/2008-07/msg00695.html > > I tried that patch and it didn't work for the "tu" dump. And I found > that the output with -fdump-tree-all-slim flag is the same as with > -fdump-tree-all flag. > > How can I find the rest of the statements from the broken statement-list? Thx. I think you will need to add code to gcc/cp/cxx-pretty-print.c and/or gcc/cp/dump.c to handle IF_STMT and FOR_STMT (and WHILE_STMT and DO_STMT too, I expect). I haven't looked into it in detail, though. Ian