Skip to content

Commit 8356c37

Browse files
RISC-V: gp_in_global needs register keyword
The Intel kernel build robot recently pointed out that I missed the register keyword on this one when I refactored the code to remove local register variables (which aren't supported by LLVM). GCC's manual indicates that global register variables must have the register keyword, As far as I can tell lacking the register keyword causes GCC to ignore the __asm__ and treat this as a regular variable, but I'm not sure how that didn't show up as some sort of failure. Fixes: 52e7c52 ("RISC-V: Stop relying on GCC's register allocator's hueristics") Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 8fa3cdf commit 8356c37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <asm/switch_to.h>
2323
#include <asm/thread_info.h>
2424

25-
unsigned long gp_in_global __asm__("gp");
25+
register unsigned long gp_in_global __asm__("gp");
2626

2727
extern asmlinkage void ret_from_fork(void);
2828
extern asmlinkage void ret_from_kernel_thread(void);

0 commit comments

Comments
 (0)