From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9264 invoked by alias); 8 Dec 2003 22:09:18 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 9241 invoked from network); 8 Dec 2003 22:09:16 -0000 Received: from unknown (HELO atrey.karlin.mff.cuni.cz) (195.113.31.123) by sources.redhat.com with SMTP; 8 Dec 2003 22:09:16 -0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 4018) id A9C724C0159; Mon, 8 Dec 2003 23:09:15 +0100 (CET) Date: Mon, 08 Dec 2003 22:35:00 -0000 From: Jan Hubicka To: Steven Bosscher Cc: "gcc@gcc.gnu.org" , gcc-patches@gcc.gnu.org, dnovillo@redhat.com Subject: Re: [RFC] Use accessor macros for the head and end of a basic block Message-ID: <20031208220915.GA32401@atrey.karlin.mff.cuni.cz> References: <200312081630.14467.s.bosscher@student.tudelft.nl> <200312082149.54263.steven@gcc.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200312082149.54263.steven@gcc.gnu.org> User-Agent: Mutt/1.5.4i X-SW-Source: 2003-12/txt/msg00546.txt.bz2 > On Monday 08 December 2003 16:30, Steven Bosscher wrote: > > Hello, > > > > For tree-ssa I would like to make the basic block head/end a union because > > we now have a head and end for both RTL and trees, and obviously we only > > can use one at a time so one field at least is redundant. > > > > Problem is, everything uses bb->head instead of BLOCK_HEAD (bb), and > > bb->end instead of BLOCK_END (bb). Is there a reason for this? Would a > > patch to update _all_ of these to use the macro be acceptable in stage3 if > > it prevents merge trouble for the tree-ssa branch maintainers? > > Of course the BLOCK_HEAD and BLOCK_END macros aren't the right ones. We'd need > two new macros... > > (BLOCK_{HEAD,END} are hardly used, and it seems that at least in reload we > could use a pointer to a basic block instead of an int in insn_chain. But > that's for later.) There are artefact of dark ages when it seemed to be good idea to implement CFG using arrays AFAIK. > > Now, here's the change I'd like to make. This is probably already the largest > patch I've ever submitted, but it should have no effect whatsoever. > Basically all this does is replace all occurences of "->{head,end}" with > "BB_{HEAD,END} (). > (Diego, this is one of those changes I was talking about last week, and as you > can see it touched matter all over the map.) > > This patch does not convert all files at once, because this was a large (and > RSI-prone ;-) amount of work, I'm extremely lazy and if this is unacceptable > then I won't have to do the rest of them. > > If a patch like this is not OK for mainline at this stage, then some CFG work > that I had in mind for tree-ssa (putting will have to be postponed until > after 3.4 branches. But really, I'd like to put this in now because: > 1. It is quite safe. > 2. Not doing it makes it very impractical to make basic_block_def a bit > smaller for tree-ssa, where this is needed especially now that we > have a garbage collectable CFG. > > Opinions? Should I finish this patch or is this just a big no-no? I think it is right thing to do. How will the tree counterparts called? Perhaps we can use BLOCK_HEAD_RTL/BLOCK_HEAD_TREE to make naming more conventient. Honza