From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29771 invoked by alias); 5 Oct 2004 22:35:11 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 29761 invoked from network); 5 Oct 2004 22:35:10 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 5 Oct 2004 22:35:10 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i95MZ5Xi007945; Tue, 5 Oct 2004 18:35:10 -0400 Received: from [172.16.83.125] (vpn83-125.boston.redhat.com [172.16.83.125]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i95MZ4r32361; Tue, 5 Oct 2004 18:35:04 -0400 Subject: Re: [PATCH] Fix PRs middle-end/15014 and middle-end/16973, removing labels with their address taken From: Jeffrey A Law Reply-To: law@redhat.com To: Andrew Pinski Cc: GCC Patches In-Reply-To: <2852718A-1614-11D9-81C0-000A95D692F4@physics.uc.edu> References: <2852718A-1614-11D9-81C0-000A95D692F4@physics.uc.edu> Content-Type: text/plain Organization: Red Hat, Inc Message-Id: <1097015702.22266.583.camel@localhost.localdomain> Mime-Version: 1.0 Date: Tue, 05 Oct 2004 22:40:00 -0000 Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00455.txt.bz2 On Mon, 2004-10-04 at 08:46, Andrew Pinski wrote: > The problem here is that we were getting rid of some bb as they were > being marked as unreachable (which is true in the code flow sense) but > should not > be removed. I fixed this by adding an edge from the first bb to the > label's > bb which has its address taken. I think this is most correct solution > as > this does not happen much we should not have to worry about losing some > optimization possibility from doing it this way. > > OK? Bootstrapped and tested on powerpc-apple-darwin. > > Thanks, > Andrew Pinski > > > Testcase: > void > f (void) > { > static __SIZE_TYPE__ u = &&a-&&b; > a : b : return; > } > > > ChangeLog: > * tre-cfg.c (make_edges): After making the edges but before > cleaning up the cfg, make an edge from the first BB to ever > BB which we take the address of the label. Didn't we decide to disallow taking the addresses of user labels for use by anything but control flow statements? That would make this code ill-formed. If we're going to allow this, then I would strongly recommend against this approach to the problem. Instead just move these labels to the start of their nearest following block that is reachable. Inserting arbitrary edges into the CFG is generally bad. Jeff