------- Comment #1 from wvangulik at xs4all dot nl 2007-09-12 07:20 ------- Tested this against 4.1.2. The output for the given test case is different (optimiser removed the useless loading):
/* prologue: frame size=0 */ push r28 /* prologue end (size=1) */ /* #APP */ in r28, 0x2F /* #NOAPP */ /* epilogue: frame size=0 */ pop r28 ret However making the struct volatile (there for forcing it on stack and thus using Y pointer) generates the requested error: void test(void) { volatile struct { int a, b, c, d, e, f; } x; x.d = 5; asm volatile("in r28, 0x2F" : : : "r28"); x.d = 6; } Gives this error test.c: In function 'test': test.c:11: error: r28 cannot be used in asm here ------------------------------------------------------ Using gcc version: Using built-in specs. Target: avr Configured with: ../gcc-4.1.2/configure --prefix=/c/WinAVR --target=avr --enable -languages=c,c++ --with-dwarf2 --enable-win32-registry=WinAVR-20070525 --disable -nls --with-gmp=/usr/local --with-mpfr=/usr/local --enable-doc --disable-libssp Thread model: single gcc version 4.1.2 (WinAVR 20070525) ------------------------------------------------------------------- So could it's know to work for 4.1.2. I can't test this against a higher version at the moment. -- wvangulik at xs4all dot nl changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wvangulik at xs4all dot nl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32895