Derived from gdb/testsuite/gdb.base/store.c : struct s_3 { short s[3]; } z_3, s_3; struct s_3 add_struct_3 (struct s_3 s) { int i; for (i = 0; i < sizeof (s) / sizeof (s.s[0]); i++) { s.s[i] = s.s[i] + s.s[i]; } return s; }
struct s_3 wack_struct_3 (void) { int i; register struct s_3 u = z_3; for (i = 0; i < sizeof (s_3) / sizeof (s_3.s[0]); i++) { s_3.s[i] = i + 1; } u = add_struct_3 (u); return u; } Compiling this with arm-none-eabi-gcc gives : try.c: In function 'wack_struct_3': try.c:41: error: address of register variable 'u' requested 3.4.5 and 4.0 seem to compile this ok. Its possibly related to the fix for #18160 . -- Summary: Spurious parse error message with register struct . Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ramana dot radhakrishnan at codito dot com GCC build triplet: i686-linux-gnu GCC host triplet: i686-linux-gnu GCC target triplet: arm-none-eabi http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26591