Commit 6377653f by Kito Cheng Committed by Kito Cheng

RISC-V: Define __riscv_cmodel_medany for PIC mode.

 - According the conclusion in RISC-V C API document, we decide to deprecat
   the __riscv_cmodel_pic marco

 - __riscv_cmodel_pic is deprecated and will removed in next GCC
   release.

[1] https://github.com/riscv/riscv-c-api-doc/pull/11

gcc/ChangeLog:

	* config/riscv/riscv-c.c (riscv_cpu_cpp_builtins): Define
	__riscv_cmodel_medany when PIC mode.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/predef-3.c: Update testcase.
	* gcc.target/riscv/predef-6.c: Ditto.
parent ccddbbc0
...@@ -90,12 +90,15 @@ riscv_cpu_cpp_builtins (cpp_reader *pfile) ...@@ -90,12 +90,15 @@ riscv_cpu_cpp_builtins (cpp_reader *pfile)
builtin_define ("__riscv_cmodel_medlow"); builtin_define ("__riscv_cmodel_medlow");
break; break;
case CM_PIC:
/* __riscv_cmodel_pic is deprecated, and will removed in next GCC release.
see https://github.com/riscv/riscv-c-api-doc/pull/11 */
builtin_define ("__riscv_cmodel_pic");
/* FALLTHROUGH. */
case CM_MEDANY: case CM_MEDANY:
builtin_define ("__riscv_cmodel_medany"); builtin_define ("__riscv_cmodel_medany");
break; break;
case CM_PIC:
builtin_define ("__riscv_cmodel_pic");
break;
} }
} }
...@@ -55,11 +55,11 @@ int main () { ...@@ -55,11 +55,11 @@ int main () {
#if defined(__riscv_cmodel_medlow) #if defined(__riscv_cmodel_medlow)
#error "__riscv_cmodel_medlow" #error "__riscv_cmodel_medlow"
#endif #endif
#if defined(__riscv_cmodel_medany) #if !defined(__riscv_cmodel_medany)
#error "__riscv_cmodel_medlow" #error "__riscv_cmodel_medany"
#endif #endif
#if !defined(__riscv_cmodel_pic) #if !defined(__riscv_cmodel_pic)
#error "__riscv_cmodel_medlow" #error "__riscv_cmodel_pic"
#endif #endif
return 0; return 0;
......
...@@ -55,11 +55,11 @@ int main () { ...@@ -55,11 +55,11 @@ int main () {
#if defined(__riscv_cmodel_medlow) #if defined(__riscv_cmodel_medlow)
#error "__riscv_cmodel_medlow" #error "__riscv_cmodel_medlow"
#endif #endif
#if defined(__riscv_cmodel_medany) #if !defined(__riscv_cmodel_medany)
#error "__riscv_cmodel_medlow" #error "__riscv_cmodel_medany"
#endif #endif
#if !defined(__riscv_cmodel_pic) #if !defined(__riscv_cmodel_pic)
#error "__riscv_cmodel_medlow" #error "__riscv_cmodel_medpic"
#endif #endif
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment