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: -Wuninitialized issues


On Mon, 2005-10-31 at 18:52 -0500, Daniel Jacobowitz wrote:
> On Mon, Oct 31, 2005 at 04:49:43PM -0700, Jeffrey A Law wrote:
> > On Sun, 2005-10-30 at 23:40 -0800, Mark Mitchell wrote:
> > > In reviewing the PR list, I saw several (maybe 5?) PRs about problems
> > > with -Wuninitialized.
> > [ ... ]
> > After pondering this some more I almost wonder if what we need is a 
> > separate warning for variables which were potentially uninitialized
> > but which optimization passes somehow proved were unused or the paths
> > in which the variable was uninitialized were unexecutable.
> > 
> > So the early pass would catch unconditionally uninitialized variables;
> > it would also record (but not warn for) maybe uninitialized variables
> > (by detecting default definitions appearing in PHI nodes).
> 
> > Thoughts?
> 
> I think that sounds very clever...
I just cobbled up some proof of concept code...  It wasn't terribly
difficult.  I think the question we need to answer is whether or not
we want to distinguish between potentially uninitialized uses remaining
after optimization and those which were either optimized away or the
object was proven always initialized.
jeff



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