Files
linux/drivers
Jim Bos 726f22c83d Fix gcc 4.5.1 miscompiling drivers/char/i8k.c (again)
commit 22d3243de8 upstream.

The fix in commit 6b4e81db25 ("i8k: Tell gcc that *regs gets
clobbered") to work around the gcc miscompiling i8k.c to add "+m
(*regs)" caused register pressure problems and a build failure.

Changing the 'asm' statement to 'asm volatile' instead should prevent
that and works around the gcc bug as well, so we can remove the "+m".

[ Background on the gcc bug: a memory clobber fails to mark the function
  the asm resides in as non-pure (aka "__attribute__((const))"), so if
  the function does nothing else that triggers the non-pure logic, gcc
  will think that that function has no side effects at all. As a result,
  callers will be mis-compiled.

  Adding the "+m" made gcc see that it's not a pure function, and so
  does "asm volatile". The problem was never really the need to mark
  "*regs" as changed, since the memory clobber did that part - the
  problem was just a bug in the gcc "pure" function analysis  - Linus ]

Signed-off-by: Jim Bos <jim876@xs4all.nl>
Acked-by: Jakub Jelinek <jakub@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-09 15:54:59 -07:00
..
2011-04-14 16:53:18 -07:00
2011-01-07 14:43:17 -08:00
2011-01-07 14:43:06 -08:00
2011-05-09 15:54:51 -07:00
2009-10-15 09:58:27 -06:00
2009-11-12 07:26:01 -08:00
2011-05-09 15:54:50 -07:00
2010-05-12 14:57:15 -07:00