This is the mail archive of the gcc-patches@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: RFA: New optimization: Convert local statics into non-statics


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


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