[Bug middle-end/35561] Promote written once local aggregates to static
xinliangli at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Mar 12 21:13:00 GMT 2008
------- 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
More information about the Gcc-bugs
mailing list