aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/riscv/riscv-c.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/riscv/riscv-c.cc')
-rw-r--r--gcc/config/riscv/riscv-c.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/config/riscv/riscv-c.cc b/gcc/config/riscv/riscv-c.cc
index 4fc0528..d497326 100644
--- a/gcc/config/riscv/riscv-c.cc
+++ b/gcc/config/riscv/riscv-c.cc
@@ -165,6 +165,15 @@ riscv_cpu_cpp_builtins (cpp_reader *pfile)
if (!subset_list)
return;
+ /* Define profile macro if a profile was used. */
+ const char *profile_name = subset_list->get_profile_name ();
+ if (profile_name)
+ {
+ char *profile_macro = (char *)alloca (strlen (profile_name) + 10);
+ sprintf (profile_macro, "__riscv_%s", profile_name);
+ builtin_define (profile_macro);
+ }
+
size_t max_ext_len = 0;
/* Figure out the max length of extension name for reserving buffer. */