This is the mail archive of the gcc-bugs@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]

[Bug middle-end/35561] Promote written once local aggregates to static



------- Comment #2 from xinliangli at gmail dot com  2008-03-12 21:12 -------
(In reply to comment #1)
> This should be already done.  
> 

With which option? I tried with -O2/-O3, it does not kick in:


int foo(int n, int* p)
{
   int i,s=0;
   int arr[100] = {
1,2,3,3,4,3,3,3,3,5,6,7,1,1,1,1,1,1,1,1,1,11,1,1,11,1,1,1,11,1,1,11,1,1,11,10};

   for ( i = 0; i < n; i++)
   {
           p[i] += arr[i];
           s+=arr[i];
   }
  return s;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35561


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