From bc6e624fe1167b088af5694bb74eb68d61dde8ba Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 8 Feb 2022 15:51:20 -0800 Subject: Fix local variable register usage for ra (#268) See https://gcc.gnu.org/onlinedocs/gcc/Local-Register-Variables.html#Local-Register-Variables "Other than when invoking the Extended asm, the contents of the specified register are not guaranteed." Also revert 90191ad93eac47d61ab9cc89084050ad1541d160. --- pk/console.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pk/console.c') diff --git a/pk/console.c b/pk/console.c index 475a93b..cf40a0a 100644 --- a/pk/console.c +++ b/pk/console.c @@ -64,6 +64,5 @@ void do_panic(const char* s, ...) void kassert_fail(const char* s) { - register uintptr_t ra asm ("ra"); - do_panic("assertion failed @ %p: %s\n", ra, s); + do_panic("assertion failed @ %p: %s\n", __builtin_return_address(0), s); } -- cgit v1.1