]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LoongArch: Simplify -mexplicit-reloc definitions
authorYang Yujie <yangyujie@loongson.cn>
Mon, 8 Jan 2024 01:14:10 +0000 (09:14 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Wed, 10 Jan 2024 03:54:24 +0000 (11:54 +0800)
Since we do not need printing or manual parsing of this option,
(whether in the driver or for target attributes to be supported later)
it can be handled in the .opt file framework.

gcc/ChangeLog:

* config/loongarch/genopts/loongarch-strings: Remove explicit-reloc
argument string definitions.
* config/loongarch/loongarch-str.h: Same.
* config/loongarch/genopts/loongarch.opt.in: Mark -m[no-]explicit-relocs
as aliases to -mexplicit-relocs={always,none}
* config/loongarch/loongarch.opt: Regenerate.
* config/loongarch/loongarch.cc: Same.

gcc/config/loongarch/genopts/loongarch-strings
gcc/config/loongarch/genopts/loongarch.opt.in
gcc/config/loongarch/loongarch-str.h
gcc/config/loongarch/loongarch.cc
gcc/config/loongarch/loongarch.opt

index ba47be31227f49a9c691a736e81a0c5fba0e86db..e434a89c9ee69448c5f9e008c6e818c02ed12c33 100644 (file)
@@ -64,9 +64,3 @@ STR_CMODEL_TS       tiny-static
 STR_CMODEL_MEDIUM     medium
 STR_CMODEL_LARGE      large
 STR_CMODEL_EXTREME    extreme
-
-# -mexplicit-relocs
-OPTSTR_EXPLICIT_RELOCS         explicit-relocs
-STR_EXPLICIT_RELOCS_AUTO       auto
-STR_EXPLICIT_RELOCS_NONE       none
-STR_EXPLICIT_RELOCS_ALWAYS     always
index 38ac347c660d19b23728d532c6f0651a63c86883..1dbd3ad1e3f2016452fdaa285baf1fad1ee0ee27 100644 (file)
@@ -181,20 +181,20 @@ Name(explicit_relocs) Type(int)
 The code model option names for -mexplicit-relocs:
 
 EnumValue
-Enum(explicit_relocs) String(@@STR_EXPLICIT_RELOCS_AUTO@@) Value(EXPLICIT_RELOCS_AUTO)
+Enum(explicit_relocs) String(auto) Value(EXPLICIT_RELOCS_AUTO)
 
 EnumValue
-Enum(explicit_relocs) String(@@STR_EXPLICIT_RELOCS_NONE@@) Value(EXPLICIT_RELOCS_NONE)
+Enum(explicit_relocs) String(none) Value(EXPLICIT_RELOCS_NONE)
 
 EnumValue
-Enum(explicit_relocs) String(@@STR_EXPLICIT_RELOCS_ALWAYS@@) Value(EXPLICIT_RELOCS_ALWAYS)
+Enum(explicit_relocs) String(always) Value(EXPLICIT_RELOCS_ALWAYS)
 
 mexplicit-relocs=
 Target RejectNegative Joined Enum(explicit_relocs) Var(la_opt_explicit_relocs) Init(M_OPT_UNSET)
 Use %reloc() assembly operators.
 
 mexplicit-relocs
-Target Var(la_opt_explicit_relocs_backward) Init(M_OPT_UNSET)
+Target Alias(mexplicit-relocs=, always, none)
 Use %reloc() assembly operators (for backward compatibility).
 
 mrecip
index 0a6a36c5783ebe3fa885e115b00ad1942734b4fe..20da2b169edbe0d823b3093d15bfb39dbf467f5e 100644 (file)
@@ -63,11 +63,6 @@ along with GCC; see the file COPYING3.  If not see
 #define STR_CMODEL_LARGE "large"
 #define STR_CMODEL_EXTREME "extreme"
 
-#define OPTSTR_EXPLICIT_RELOCS "explicit-relocs"
-#define STR_EXPLICIT_RELOCS_AUTO "auto"
-#define STR_EXPLICIT_RELOCS_NONE "none"
-#define STR_EXPLICIT_RELOCS_ALWAYS "always"
-
 #define OPTSTR_FRECIPE "frecipe"
 #define OPTSTR_DIV32   "div32"
 #define OPTSTR_LAM_BH  "lam-bh"
index c01bb826bbf62d723d12086ef2d99b1d58ab5291..37bda50fe94f3f54a8ba76930c6868a39e20be21 100644 (file)
@@ -7522,18 +7522,6 @@ loongarch_option_override_internal (struct gcc_options *opts,
   loongarch_update_gcc_opt_status (&la_target, opts, opts_set);
   loongarch_cpu_option_override (&la_target, opts, opts_set);
 
-  if (la_opt_explicit_relocs != M_OPT_UNSET
-      && la_opt_explicit_relocs_backward != M_OPT_UNSET)
-    error ("do not use %qs (with %qs) and %qs (without %qs) together",
-          "-mexplicit-relocs=", "=",
-          la_opt_explicit_relocs_backward ? "-mexplicit-relocs"
-                                          : "-mno-explicit-relocs", "=");
-
-  if (la_opt_explicit_relocs_backward != M_OPT_UNSET)
-    la_opt_explicit_relocs = (la_opt_explicit_relocs_backward
-                             ? EXPLICIT_RELOCS_ALWAYS
-                             : EXPLICIT_RELOCS_NONE);
-
   if (la_opt_explicit_relocs == M_OPT_UNSET)
     la_opt_explicit_relocs = (HAVE_AS_EXPLICIT_RELOCS
                              ? (loongarch_mrelax
index 76b42d51d0977d7453d7520b235ce692647c98c3..adb2304fbd57495090cf096c95bfed113108eeb1 100644 (file)
@@ -202,7 +202,7 @@ Target RejectNegative Joined Enum(explicit_relocs) Var(la_opt_explicit_relocs) I
 Use %reloc() assembly operators.
 
 mexplicit-relocs
-Target Var(la_opt_explicit_relocs_backward) Init(M_OPT_UNSET)
+Target Alias(mexplicit-relocs=, always, none)
 Use %reloc() assembly operators (for backward compatibility).
 
 mrecip