https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67064
Bug ID: 67064 Summary: Register asm variable broken Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: sebastian.hu...@embedded-brains.de Target Milestone: --- The following test case fails on x86_64-pc-linux-gnu, powerpc-rtems, sparc-rtems: struct s { int i; }; register struct s *reg __asm__( "1" ); int f(void) { int i; i = reg->i; i = (reg)->i; return i; } Yields: prreg.cc:5:20: warning: call-clobbered register used for global register variable register struct s *reg __asm__( "1" ); ^ prreg.cc: In function ‘int f()’: prreg.cc:12:8: error: address of explicit register variable ‘reg’ requested i = (reg)->i; ^ Please note, that the line 11 "i = reg->i;" works.