diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-03-11 16:12:22 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-03-11 16:12:22 -0800 |
commit | bc636c218f2b28da06cd1404d5b35d1f8cc43fd1 (patch) | |
tree | 764937d8460563db6132d7c75e19b95ef3ea6ea8 /gcc/common | |
parent | 89d7be42db00cd0953e7d4584877cf50a56ed046 (diff) | |
parent | 7ad5a72c8bc6aa71a0d195ddfa207db01265fe0b (diff) | |
download | gcc-bc636c218f2b28da06cd1404d5b35d1f8cc43fd1.zip gcc-bc636c218f2b28da06cd1404d5b35d1f8cc43fd1.tar.gz gcc-bc636c218f2b28da06cd1404d5b35d1f8cc43fd1.tar.bz2 |
Merge from trunk revision 7ad5a72c8bc6aa71a0d195ddfa207db01265fe0b.
Diffstat (limited to 'gcc/common')
-rw-r--r-- | gcc/common/config/arm/arm-common.c | 49 | ||||
-rw-r--r-- | gcc/common/config/s390/s390-common.c | 4 |
2 files changed, 47 insertions, 6 deletions
diff --git a/gcc/common/config/arm/arm-common.c b/gcc/common/config/arm/arm-common.c index 9882451..9980af6 100644 --- a/gcc/common/config/arm/arm-common.c +++ b/gcc/common/config/arm/arm-common.c @@ -33,6 +33,8 @@ #include "sbitmap.h" #include "diagnostic.h" +#include "configargs.h" + /* Set default optimization options. */ static const struct default_options arm_option_optimization_table[] = { @@ -240,16 +242,34 @@ check_isa_bits_for (const enum isa_feature* bits, enum isa_feature bit) return false; } +/* Look up NAME in the configuration defaults for this build of the + the compiler. Return the value associated with that name, or NULL + if no value is found. */ +static const char * +arm_config_default (const char *name) +{ + unsigned i; + + if (configure_default_options[0].name == NULL) + return NULL; + + for (i = 0; i < ARRAY_SIZE (configure_default_options); i++) + if (strcmp (configure_default_options[i].name, name) == 0) + return configure_default_options[i].value; + + return NULL; +} + /* Called by the driver to check whether the target denoted by current - command line options is a Thumb-only target. ARGV is an array of - tupples (normally only one) where the first element of the tupple - is 'cpu' or 'arch' and the second is the option passed to the - compiler for that. An architecture tupple is always taken in - preference to a cpu tupple and the last of each type always + command line options is a Thumb-only, or ARM-only, target. ARGV is + an array of tupples (normally only one) where the first element of + the tupple is 'cpu' or 'arch' and the second is the option passed + to the compiler for that. An architecture tupple is always taken + in preference to a cpu tupple and the last of each type always overrides any earlier setting. */ const char * -arm_target_thumb_only (int argc, const char **argv) +arm_target_mode (int argc, const char **argv) { const char *arch = NULL; const char *cpu = NULL; @@ -285,6 +305,9 @@ arm_target_thumb_only (int argc, const char **argv) if (arch_opt && !check_isa_bits_for (arch_opt->common.isa_bits, isa_bit_notm)) return "-mthumb"; + if (arch_opt && !check_isa_bits_for (arch_opt->common.isa_bits, + isa_bit_thumb)) + return "-marm"; } else if (cpu) { @@ -294,6 +317,20 @@ arm_target_thumb_only (int argc, const char **argv) if (cpu_opt && !check_isa_bits_for (cpu_opt->common.isa_bits, isa_bit_notm)) return "-mthumb"; + if (cpu_opt && !check_isa_bits_for (cpu_opt->common.isa_bits, + isa_bit_thumb)) + return "-marm"; + } + + const char *default_mode = arm_config_default ("mode"); + if (default_mode) + { + if (strcmp (default_mode, "thumb") == 0) + return "-mthumb"; + else if (strcmp (default_mode, "arm") == 0) + return "-marm"; + else + gcc_unreachable (); } /* Compiler hasn't been configured with a default, and the CPU diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c index d066cf7..b6bc850 100644 --- a/gcc/common/config/s390/s390-common.c +++ b/gcc/common/config/s390/s390-common.c @@ -49,7 +49,11 @@ EXPORTED_CONST int processor_flags_table[] = | PF_Z13 | PF_VX | PF_VXE | PF_Z14, /* z15 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX + | PF_Z13 | PF_VX | PF_VXE | PF_Z14 | PF_VXE2 | PF_Z15, + /* arch14 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT + | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX | PF_Z13 | PF_VX | PF_VXE | PF_Z14 | PF_VXE2 | PF_Z15 + | PF_NNPA | PF_ARCH14 }; /* Change optimizations to be performed, depending on the |