This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: New implementation of -Wstrict-aliasing


> Patch Description
> =================
> 
> The proposed patch contains a new implementation of -Wstrict-aliasing.
> The proposed implementation lives in the backend and is based on 
> flow-sensitive
> points-to information, which is computed by analyzing the entire source of
> each function.  It is not perfect (the problem is undecidable), but it 
> improves
> in all three directions: it checks whether pointers get dereferenced,
> it detects aliasing across multiple statements and it produces more
> meaningful messages.

The only problem with this implementation I can see is that once
we start folding *(int*)&float_var into using VIEW_CONVERT_EXPR, we
are no longer going to warn about this specific aliasing issue (even
though after that, we will get it correct, we should warn about it).

Yes I am working on getting that specific optimization implemented.
I mentioned about aliasing in
http://gcc.gnu.org/ml/gcc-patches/2006-09/msg00117.html

And Diego responed with:
If we've warned then I have no problems in letting the folder ignore the
alias sets.  Undefined code is fair game.  Wait for stage 1 for this
one, though.
-------------------------------------------------------------------------
So I think we still need a warning in the front-end for the obvious
aliasing issues.

Thanks,
Andrew Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]