This is the mail archive of the gcc@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: Undefined behavior in genautomata.c?


On Mon, Sep 19, 2005 at 09:22:56AM -0400, Daniel Berlin wrote:
> On Mon, 2005-09-19 at 15:07 +0200, Jakub Jelinek wrote:
> > On Mon, Sep 19, 2005 at 09:03:48AM -0400, Daniel Berlin wrote:
> > > Anyway, the real fix is to simply not attempt to derive information when
> > > the access is through a pointer (IE it is not related to structs at all,
> > > it's the fact that these are heap allocated), unless you have info about
> > > the malloc sites and the upper bound on what size it is allocating.
> > > 
> > > I'll actually soon be providing you such malloc site size info :)
> > 
> > tree-object-size.c already provides that...
> 
> 1. Not interprocedurally.

True, it was written before the IPA infrastructure was added.
For 4.2 the plan is to rewrite it using Diego's propagator and then
IPA propagation should be added too.  It will be useful for both
__builtin_object_size builtin itself as well as other passes that might
use the info (e.g. mudflap).

> 2. Not for regular objects, only things involved with
> builtin_object_siz.

Not true, you can call it internally on any anything.

> tree-object-size is also a bit hard to follow, in part because it does
> things like:
> if (object_size_type & 2)
> 
> *all over the place*, and says to go look at the builtin_object_size
> documentation.  It would have been nice to give the existing bits
> symbolic names of some sort :)

++todo, that certainly will not hurt.  Though out of the 11 occurrences
of & 1 and & 2 tests, 4 of them are documented...

	Jakub


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