http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35561
--- Comment #10 from davidxl 2011-06-27 20:44:56
UTC ---
Agree. Such optimization should not be done in gimplication, Nor should the
const keyword be looked at. It should be done in middle end where local
aggregate are analyzed:
1) the aggregat
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35561
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #9 f
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35561
--- Comment #8 from joseph at codesourcery dot com 2011-06-23 10:32:28 UTC ---
See bug 38615 for the case when converting an object to static is not
valid.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35561
--- Comment #7 from Andrew Pinski 2011-06-23
03:17:58 UTC ---
At one point this was done but it was found it violated C rules. I can find
the bug report but I am being lazy right now but it comes down to if it was
promoted then you have issues
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35561
Steven Fuerst changed:
What|Removed |Added
CC||svfuerst at gmail dot com
--- Comment #6
--- Comment #5 from pinskia at gcc dot gnu dot org 2008-03-12 21:23 ---
By constructor I mean the initializer.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35561
--- Comment #4 from xinliangli at gmail dot com 2008-03-12 21:19 ---
(In reply to comment #3)
> If there is not enough 0's, then we actually promote the constructor but never
> the variable.
>
I am a little confused. How do you promote constructor? By the way, this is a C
program.
Dav
--- Comment #3 from pinskia at gcc dot gnu dot org 2008-03-12 21:15 ---
If there is not enough 0's, then we actually promote the constructor but never
the variable.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35561
--- 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,
--- Comment #1 from pinskia at gcc dot gnu dot org 2008-03-12 21:07 ---
This should be already done.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35561
10 matches
Mail list logo