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: const warning...


dnovillo@redhat.com said:
> In theory, you should be able to get this information in the tree-ssa
> branch.  Every _DECL that has been written-to directly is marked.  If
> the _DECL survives the optimization passes, then you know it's used
> and has been written to.  If the _DECL is aliased and there are
> aliased stores to it, you will also need to assume that it's been
> written to. 

Indeed, I suspected that the ssa branch was better suited for doing this.

> Tracking individual fields in an object will be more challenging,
> though.  We currently don't build an SSA form for fields. 

[ I'm assuming that you say this for the method part. ]

First, I'm perfectly OK with doing one thing at a time...

Then, the C++ frontend is already able to detect that a const methods 
attempts to modify a member, so that the proper information should be 
available somehow (rough and stupid idea, compile every method as if 
it were marked const, if indeed the method was marked const just do whatever 
is done currently, otherwise if it succeeds then emit the warning, if 
it fails just continue...

Anyway, thank's for the tip...


--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
 --------------------------------------------------------------------



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