RFA: New optimization: Convert local statics into non-statics

Jeff Law law@redhat.com
Mon Jul 14 20:41:00 GMT 2008


Joseph S. Myers wrote:
> On Mon, 14 Jul 2008, Ralf Wildenhues wrote:
> 
>>> +/* Verify that we don't eliminate a global static variable.  */
>> Why?  This global static could be removed.  Or is it that you would like
>> to explicitly forbid file-scope optimizations, and if yes, how do these
>> dg-options ensure that -O2 doesn't activate them?
> 
> I didn't do the implementation, only the specification, but my 
> understanding is that this implementation optimizes within a single 
> function only (and possibly that we don't have a use case that doing this 
> for statics potentially accessed by multiple functions would benefit).
[ ... ]
I haven't followed closely, but is there an option to turn this 
optimization off in both implementations?  Some of us still remember the 
days of setting up a file/function scoped static which controlled 
debugging and editing binaries to twiddle the debugging state....

Jeff



More information about the Gcc-patches mailing list