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


On 1/20/07, Andrew Pinski <pinskia@physics.uc.edu> wrote:
> 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).

You could mark such folded trees somehow to tell the strict-aliasing warning machinery to warn about the VIEW_CONVERT_EXPR. (using TREE_NO_WARNING with a reversed sense comes to my mind)

Richard.


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