This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Refine escaping pointers when integers are involved
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 26 Nov 2004 20:23:26 -0500
- Subject: Re: Refine escaping pointers when integers are involved
- References: <10411270122.AA15156@vlsi1.ultra.nyu.edu>
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