The following example core dumps on target when compiled with GCC 4.1.2 prelease and also with GCC 4.1.1
int main() { char k[255]; time((long*)k); return 0; } The local variable is not tail aligned I think. This was aligned in gcc 3.4.3 Here is a diff of the two assembly files. --- test.s 2006-08-14 21:12:59.000000000 -0700 +++ test-4.0.s 2006-08-14 21:08:30.000000000 -0700 @@ -5,16 +5,15 @@ .type main, #function .proc 04 main: - !#PROLOGUE# 0 save %sp, -368, %sp - !#PROLOGUE# 1 - add %fp, -272, %g1 + add %fp, -271, %g1 mov %g1, %o0 call time, 0 nop mov 0, %g1 mov %g1, %i0 - ret restore + jmp %o7+8 + nop .size main, .-main - .ident "GCC: (GNU) 3.4.3 (MontaVista 3.4.3-25.0.96.0600605 2006-05-06)" + .ident "GCC: (GNU) 4.1.2 20060725 (prerelease) (MontaVista 4.1.0-2)" -- Summary: Local variables not aligned to 4 byte boundary causes bus error due to unaligned access Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: raj dot khem at gmail dot com GCC build triplet: sparc-sun-solaris2.7 GCC host triplet: sparc-sun-solaris2.7 GCC target triplet: sparc-sun-solaris2.7 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28731