This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/35561] Promote written once local aggregates to static
- From: "xinliangli at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Mar 2008 21:12:29 -0000
- Subject: [Bug middle-end/35561] Promote written once local aggregates to static
- References: <bug-35561-9436@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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