This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: New implementation of -Wstrict-aliasing
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: drow at false dot org (Daniel Jacobowitz)
- Cc: iant at google dot com (Ian Lance Taylor), gdr at cs dot tamu dot edu (Gabriel Dos Reis), rus at google dot com (Silvius Rus), gcc-patches at gcc dot gnu dot org
- Date: Sun, 21 Jan 2007 00:09:13 -0500 (EST)
- Subject: Re: Patch: New implementation of -Wstrict-aliasing
>
> On Sat, Jan 20, 2007 at 08:43:06PM -0800, Ian Lance Taylor wrote:
> > I believe that this warning is an example of those which can not be
> > emitted from the frontends.
>
> Could you give me a rough estimate of the amount of optimization
> required for this warning? i.e. in a hypothetical world where we
> use SSA at -O0, how expensive would it be to do the necessary analysis?
Technically this warning already requires optimization to warn. In fact
even at -O1, we don't warn. Maybe what I am requesting is the obvious
aliasing violations, the ones which dereference a cast from an address,
be warned in the front-end and the rest warned in the middle-end. This
is needed as the VIEW_CONVERT_EXPR optimization happens during gimplification
so by the time we get to this pass, the alasing violation is no longer
there.
Thanks,
Andrew Pinski