[PATCH] Don't localize globals that may serve as leak checker roots.

Alexey Samsonov samsonov at google.com
Fri Sep 27 01:39:57 PDT 2013


On Thu, Sep 26, 2013 at 8:41 PM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> > IMO moving globals to locals in main is basically a SPEC benchmark hack.
> > It's only profitable when most of the program can be inlined into main
> and
> > the globals become register allocated.
> >
> > The C++ standard sez [basic.start.main]p6: "The function main shall not
> be
> > used (3.2) within a program."  The C standard has no such language, so
> this
> > optimization isn't really valid for C.  IIRC this caused PNaCl some
> > problems.
> >
> > So if we want to remove this optimization, it should be on *that* basis,
> and
> > not because we want leak checking to work out of the box.
>
> Good point.
>
> Alexey, would you be ok with starting a new thread with a patch to
> remove this optimization completely?
>

Sure, http://llvm-reviews.chandlerc.com/D1769


>
> Cheers,
> Rafael
>



-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130927/5d762700/attachment.html>


More information about the llvm-commits mailing list