Enable sext.w removal for riscv targets

Bug: 275574215
Test: Verified boot complete on aosp_cf_riscv64_phone target.
Change-Id: I771dbc492075eec18919b66dc74ae524e3f4b3cd
diff --git a/cc/config/riscv64_device.go b/cc/config/riscv64_device.go
index 35c57f9..76c8e5d 100644
--- a/cc/config/riscv64_device.go
+++ b/cc/config/riscv64_device.go
@@ -28,6 +28,9 @@
 		"-fno-emulated-tls",
 		// For -fsanitize=shadow-call-stack.
 		"-ffixed-x18",
+		// A temporary fix for SExtWRemoval miscompilation bug.
+		"-mllvm",
+		"-riscv-disable-sextw-removal=true",
 	}
 
 	riscv64ArchVariantCflags = map[string][]string{}