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: Refine escaping pointers when integers are involved


On Fri, 2004-11-26 at 20:22 -0500, Richard Kenner wrote:
>     Except that it only matters when you cast it back to a pointer.
> 
> Yes, but you might not see that one.  For example, you might pass that
> integer to a function that converts it back to a pointer.  The *integer*
> is escaping, but we don't look for that case.
> 
Yeah, i wasn't thinking.
We can only do that if we have the whole program (or interprocedural and
you are passing it to a static that doesn't call other external
functions, etc)

> In order to detect that, we'd have to have the code treat an integer
> that receives a pointer value as if it were a pointer and that seems to
> be much too much trouble.

On one hand, i doubt the code to track this is that much trouble with
some like the propagation engine (since it's just copying the state
around).

On the ohter hand, people who cast pointers to integers and back get
what the deserve.
:)

--Dan



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