https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45410
Andrew Pinski changed:
What|Removed |Added
Summary|constant not optimized /|constant not optimized /
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45410
Andrew Pinski changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Last reconfirmed|
--- Comment #5 from reza at parvan dot net 2010-08-27 17:59 ---
(In reply to comment #2)
> That's not the main problem here. The problem is that this is an aggregate
> and
> we SRA only automatic vars, not global vars. And it isn't constant either
Jakub,
Thanks for that insight. Of
--- Comment #4 from jakub at gcc dot gnu dot org 2010-08-26 09:59 ---
Sure, one that would also be able to assume that main is called just once.
Anyway, even to optimize ss.i into 77 you'd need a way to mark fields in global
aggregates as const if they aren't ever modified...
--
htt
--- Comment #3 from rguenth at gcc dot gnu dot org 2010-08-26 09:46 ---
Well, you need flow-sensitive analysis to figure out that when visiting
ss.j += 88; you can assume that ss.j is still 2.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45410
--- Comment #2 from jakub at gcc dot gnu dot org 2010-08-26 07:33 ---
That's not the main problem here. The problem is that this is an aggregate and
we SRA only automatic vars, not global vars. And it isn't constant either
(neither declared, nor actually, so can't be detected as consta
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
Severity|normal |enhancement
Component|c |middle-en