diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-05-13 13:52:19 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-05-13 13:52:19 -0400 |
commit | aa512a27e9e8ed32f31b15eec67ab1ceca33839b (patch) | |
tree | b9f4c0e65027d2501eb08f4661d7aa95c4d5d74d | |
parent | 091bf7624d1c90cec9e578a18529f615213ff847 (diff) |
x86/function-graph: fix constraint for recording old return value
After upgrading from gcc 4.2.2 to 4.4.0, the function graph tracer broke.
Investigating, I found that in the asm that replaces the return value,
gcc was using the same register for the old value as it was for the
new value.
mov (addr), old
mov new, (addr)
But if old and new are the same register, we clobber new with old!
I first thought this was a bug in gcc 4.4.0 and reported it:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40132
Andrew Pinski responded (quickly), saying that it was correct gcc behavior
and the code needed to denote old as an "early clobber".
Instead of "=r"(old), we need "=&r"(old).
[Impact: keep function graph tracer from breaking with gcc 4.4.0 ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | arch/x86/kernel/ftrace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 18dfa30795c9..b79c5533c421 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c | |||
@@ -442,7 +442,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | |||
442 | _ASM_EXTABLE(1b, 4b) | 442 | _ASM_EXTABLE(1b, 4b) |
443 | _ASM_EXTABLE(2b, 4b) | 443 | _ASM_EXTABLE(2b, 4b) |
444 | 444 | ||
445 | : [old] "=r" (old), [faulted] "=r" (faulted) | 445 | : [old] "=&r" (old), [faulted] "=r" (faulted) |
446 | : [parent] "r" (parent), [return_hooker] "r" (return_hooker) | 446 | : [parent] "r" (parent), [return_hooker] "r" (return_hooker) |
447 | : "memory" | 447 | : "memory" |
448 | ); | 448 | ); |