gcc -Wall -O3 -S test.c doesn't seem to propagate constants correctly. Notice that ss is declared static, therefor everything is known at compile time.
Code: #include <stdio.h> struct s {int i;int j;}; struct s static ss={77,2}; int main() { ss.j += 88; printf("%d\n",sizeof(ss)); return ss.i+ss.j; }; -- Summary: constant not optimized / propagated Product: gcc Version: 4.4.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: reza at parvan dot net GCC host triplet: x86 Ubuntu Linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45410