This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Recent changes to cse.c
- To: Richard Henderson <rth at redhat dot com>
- Subject: Re: Recent changes to cse.c
- From: law at redhat dot com
- Date: Tue, 17 Jul 2001 08:38:55 -0600
- cc: Mike Lerwill <mike at ml-solutions dot co dot uk>, gcc at gcc dot gnu dot org
- Reply-To: law at redhat dot com
In message <20010717000140.G11525@redhat.com>you write:
> On Tue, Jul 17, 2001 at 02:18:57AM -0400, Daniel Berlin wrote:
> > We should have a lint configuration for gcc (much like the *BSD's have
> > a LINT configuration for the kernel to test compile breakages), that
> > will help tell you, fer instance, if *compiles* break on a cc0
> > (execution would still have to be done by simulator) machine, without
> > having to figure out which machines are cc0/not cc0, which machines
> > have this or that, etc.
>
> That's mostly solved by ridding ourselves of all of the
> conditional compilation that we can.
Right. This is a perfect example.
What benefits do we get by exposing cc0 in all its glory to every pass
of the compiler? Nothing other than bugs because folks forget to
insert HAVE_cc0 compensation code.
IMHO, cc0 should be exposed during final because that's the only time
we actually care about the contents of cc0 (for redundant compare/test
elimination).
Also note that this fits into the whole gradual RTL lowering concepts I'm
working on -- you expose attributes of the target when it makes sense to
do so. No earlier :-)
So the next obvious question is how do we represent this stuff earlier
in the compiler. Well, it's pretty simple. Instead of having separate
compare + branch instructions (where the compare sets cc0 and the branch
uses cc0) we have a unified compare & branch instruction.
Just before final we lower the unified compare & branch into its component
compare and branch insns, then try to eliminate the compare in the usual
ways.
FWIW, we've got 127 hunks of code that are conditionally compiled based
on HAVE_cc0. I would expect the vast majority of them to simply go away
with this scheme.
jeff