From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18893 invoked by alias); 2 Nov 2011 00:56:03 -0000 Received: (qmail 18884 invoked by uid 22791); 2 Nov 2011 00:56:03 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-gx0-f175.google.com (HELO mail-gx0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Nov 2011 00:55:49 +0000 Received: by ggnj1 with SMTP id j1so8678404ggn.20 for ; Tue, 01 Nov 2011 17:55:49 -0700 (PDT) Received: by 10.236.193.70 with SMTP id j46mr3285565yhn.108.1320195348917; Tue, 01 Nov 2011 17:55:48 -0700 (PDT) Received: by 10.236.193.70 with SMTP id j46mr3285526yhn.108.1320195348529; Tue, 01 Nov 2011 17:55:48 -0700 (PDT) Received: from coign.google.com ([216.239.45.130]) by mx.google.com with ESMTPS id i50sm1359109yhk.11.2011.11.01.17.55.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Nov 2011 17:55:48 -0700 (PDT) From: Ian Lance Taylor To: Matthew Plant Cc: gcc-help@gcc.gnu.org Subject: Re: Question regarding the values of labels References: Date: Wed, 02 Nov 2011 00:56:00 -0000 In-Reply-To: (Matthew Plant's message of "Tue, 1 Nov 2011 16:52:17 -0700") 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-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-11/txt/msg00007.txt.bz2 Matthew Plant writes: > So my final question is this: what determines the addresses of labels? > Can this problem be fixed with at least semi-readable code? Speaking very roughly, gcc separates the code into basic blocks and builds a control flow graph. The blocks in the control flow graph are sorted based on the predicted results of branches. The blocks are then output in the order. Nothing like what you want to do is possible with gcc. You are assuming that there is a natural correspondence between your source code and gcc's internal representation; that is a natural thing assumption, but in actual fact no such correspondence exists. Ian