public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steven Bosscher <steven@gcc.gnu.org>
To: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>, gcc-patches@gcc.gnu.org
Cc: dnovillo@redhat.com
Subject: [RFC] Use accessor macros for the head and end of a basic block
Date: Mon, 08 Dec 2003 22:09:00 -0000	[thread overview]
Message-ID: <200312082149.54263.steven@gcc.gnu.org> (raw)
In-Reply-To: <200312081630.14467.s.bosscher@student.tudelft.nl>

[-- Attachment #1: Type: text/plain, Size: 2486 bytes --]

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.)

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 "<bb>->{head,end}" with 
"BB_{HEAD,END} (<bb>).
(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?

Gr.
Steven

	* basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
	(BLOCK_HEAD_TREE, BLOCK_END_TREE): Remove.
	(BB_HEAD, BB_END): New accessor macros for the `head' and `end' fields
	of a basic_block.
	* bb-reorder.c, bt-load.c, caller-save.c, cfg.c, cfganal.c, cfgbuild.c,
	cfgcleanup.c, cfglayout.c, cfgloop.c, cfgloopanal.c, cfgloopmanip.c, 
	cfgrtl.c, combine.c, conflict.c, df.c, emit-rtl.c, gcse.c, haifa-sched.c,
	local-alloc.c, regmove.c, resource.c, sched-rgn.c: Use the BB_HEAD and
	BB_END macros instead of accessing the `head' and `end' fields of a
	basic block directly.

[-- Attachment #2: patch.gz --]
[-- Type: application/x-gzip, Size: 23895 bytes --]

  reply	other threads:[~2003-12-08 20:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-08 15:33 Why are BLOCK_HEAD/BLOCK_END not used? Steven Bosscher
2003-12-08 22:09 ` Steven Bosscher [this message]
2003-12-08 22:35   ` [RFC] Use accessor macros for the head and end of a basic block Jan Hubicka
2003-12-09  5:04     ` law
2003-12-09  6:52       ` Steven Bosscher
2003-12-09  9:28         ` law
2003-12-10  8:47           ` Steven Bosscher
2003-12-10 22:49             ` Zack Weinberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200312082149.54263.steven@gcc.gnu.org \
    --to=steven@gcc.gnu.org \
    --cc=dnovillo@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).