gcc3 vs 176.gcc

Geoff Keating geoffk@geoffk.org
Wed Jan 9 16:35:00 GMT 2002


> From: Joe Buck <jbuck@synopsys.com>
> Date: Wed, 9 Jan 2002 12:44:19 -0800 (PST)
> Cc: rth@redhat.com (Richard Henderson), geoffk@redhat.com (Geoff Keating),
>         dalej@apple.com (Dale Johannesen), gcc@gcc.gnu.org
> 
> I wrote:
> 
> > I think that the check happens too late if it is done this way.
> > Better to detect that the rules are broken at the time of tree->RTL
> > conversion.  In the 176.gcc case, as soon as we parse
> > 
> > 	((int *)rt)[length]
> > 
> > and note that the type of rt is not pointer to (possibly cv-qualified)
> > int or unsigned, we know already that the rules have been broken,
> > independent of what the backend is.
> 
> What if we tell the back end that such a pointer expression (one that
> breaks the rules) is a pointer to char*, or aliases like one? (can
> collide with anything)?

The problem is finding which expressions break the rules.  What I
expect will happen is that we can do a 90% solution, but the missing
10% will vary by target and compiler revision---some things will work
on x86 with 3.1, some of those won't work on powerpc, and some won't
work with 3.2.  So you end up with a 70% or 30% or 5% solution.

A much better project, one which has been waiting for someone to do it
for some time and is universally agreed to be a good idea, is to have
the compiler warn in situations where it detects that the rules are
broken.  That way, even if it's only a 90% solution, people can fix
those problems in their source---and if it's a different 90% on other
targets, it just means that even more problems get found and fixed.
And additionally the compiler can do the right thing when it does
detect a problem as part of error recovery.

-- 
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>



More information about the Gcc mailing list