<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Thu, Sep 26, 2013 at 8:41 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">> IMO moving globals to locals in main is basically a SPEC benchmark hack.<br>

> It's only profitable when most of the program can be inlined into main and<br>
> the globals become register allocated.<br>
><br>
> The C++ standard sez [basic.start.main]p6: "The function main shall not be<br>
> used (3.2) within a program."  The C standard has no such language, so this<br>
> optimization isn't really valid for C.  IIRC this caused PNaCl some<br>
> problems.<br>
><br>
> So if we want to remove this optimization, it should be on *that* basis, and<br>
> not because we want leak checking to work out of the box.<br>
<br>
</div>Good point.<br>
<br>
Alexey, would you be ok with starting a new thread with a patch to<br>
remove this optimization completely?<br></blockquote><div><br></div><div>Sure, <a href="http://llvm-reviews.chandlerc.com/D1769">http://llvm-reviews.chandlerc.com/D1769</a></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div></div>