Re: Remove dead assignments to static local variables

2013-06-06 Thread Richard Biener
On Thu, Jun 6, 2013 at 5:10 PM, Bernd Schmidt wrote: > On 06/06/2013 04:52 PM, Richard Biener wrote: >> + /* We cannot optimize away a static used in multiple functions (as >> +might happen in C++). */ >> + && !DECL_NONLOCAL(var) >> >> it may also happen trivially with inlining.

Re: Remove dead assignments to static local variables

2013-06-06 Thread Bernd Schmidt
On 06/06/2013 04:52 PM, Richard Biener wrote: > + /* We cannot optimize away a static used in multiple functions (as > +might happen in C++). */ > + && !DECL_NONLOCAL(var) > > it may also happen trivially with inlining. Which means a local pass can > never > "remove" vars safe

Re: Remove dead assignments to static local variables

2013-06-06 Thread Richard Biener
On Thu, Jun 6, 2013 at 3:42 PM, Bernd Schmidt wrote: > There's a well-known benchmark which uselessly likes to declare local > variables as static. There exist at least two implementations to demote > these to normal register variables. See the discussion thread here: > http://gcc.gnu.org/ml/gcc

Remove dead assignments to static local variables

2013-06-06 Thread Bernd Schmidt
There's a well-known benchmark which uselessly likes to declare local variables as static. There exist at least two implementations to demote these to normal register variables. See the discussion thread here: http://gcc.gnu.org/ml/gcc-patches/2008-07/msg00982.html These days, however, we can ski