]> git.baikalelectronics.ru Git - kernel.git/commit
time: Workaround gcc loop optimization that causes 64bit div errors
authorJohn Stultz <johnstul@us.ibm.com>
Fri, 13 Aug 2010 18:30:58 +0000 (11:30 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 13 Aug 2010 19:03:24 +0000 (12:03 -0700)
commit2a3489cc69c9112683b1c869981573ed09254b0f
tree1e4333e588ad6e8e69e310d8ae71798af1c0bdb5
parent228df709bc05610c427531d53d0f1f10bd8ed576
time: Workaround gcc loop optimization that causes 64bit div errors

Early 4.3 versions of gcc apparently aggressively optimize the raw
time accumulation loop, replacing it with a divide.

On 32bit systems, this causes the following link errors:
undefined reference to `__umoddi3'
undefined reference to `__udivdi3'

The gcc issue has been fixed in 4.4 and greater.

This patch replaces the accumulation loop with a do_div, as suggested
by Linus.

Signed-off-by: John Stultz <johnstul@us.ibm.com>
CC: Jason Wessel <jason.wessel@windriver.com>
CC: Larry Finger <Larry.Finger@lwfinger.net>
CC: Ingo Molnar <mingo@elte.hu>
CC: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/time/timekeeping.c