From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7876 invoked by alias); 27 Oct 2011 19:29:32 -0000 Received: (qmail 7867 invoked by uid 22791); 27 Oct 2011 19:29:31 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_ZJ X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 Oct 2011 19:29:18 +0000 Received: from hpaq3.eem.corp.google.com (hpaq3.eem.corp.google.com [172.25.149.3]) by smtp-out.google.com with ESMTP id p9RJTG4k000545 for ; Thu, 27 Oct 2011 12:29:17 -0700 Received: from pzk2 (pzk2.prod.google.com [10.243.19.130]) by hpaq3.eem.corp.google.com with ESMTP id p9RJHjbp006844 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 27 Oct 2011 12:29:15 -0700 Received: by pzk2 with SMTP id 2so12022550pzk.8 for ; Thu, 27 Oct 2011 12:29:14 -0700 (PDT) Received: by 10.68.66.36 with SMTP id c4mr16044811pbt.39.1319743754934; Thu, 27 Oct 2011 12:29:14 -0700 (PDT) Received: by 10.68.66.36 with SMTP id c4mr16044793pbt.39.1319743754773; Thu, 27 Oct 2011 12:29:14 -0700 (PDT) Received: from coign.google.com ([216.239.45.130]) by mx.google.com with ESMTPS id x8sm16974079pbx.15.2011.10.27.12.29.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Oct 2011 12:29:14 -0700 (PDT) From: Ian Lance Taylor To: Uros Bizjak Cc: gcc@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Re: -fdump-go-spec option does not handle redefinitions References: Date: Thu, 27 Oct 2011 19:41:00 -0000 In-Reply-To: (Uros Bizjak's message of "Thu, 27 Oct 2011 20:29:38 +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@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: 2011-10/txt/msg00493.txt.bz2 Uros Bizjak writes: > This testfile: > > #define aa 2 > #undef aa > #define aa 3 > > does not generate correct output with -fdump-go-spec. The result is: > > const _aa = 2 > // undef _aa > > One would expect: > > const _aa = 2 > // undef _aa > const _aa = 3 Did this come up in a real situation? The problem with your proposal is that the output would be invalid Go, because it would attempt to define the name _aa twice. However, it does seem plausible that in most scenarios of this type it would be more useful for -fdump-go-spec to generate const _aa = 3 Ian