diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2012-11-21 21:11:18 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2012-11-21 21:11:18 +0000 |
commit | a90c19afd00727bef1fa7c952b417be93134006b (patch) | |
tree | 8eaf17ba834799661613d01db6068c8496afa647 /gnu | |
parent | 2214152e80f51d83decc47d1561d69b4651459f1 (diff) |
Turn OVERRIDE_OPTIONS into a function, will make it easier to extend on a
per-platform basis.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/gcc/gcc/config/m88k/m88k-protos.h | 2 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/gcc/config/m88k/m88k.c | 56 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/gcc/config/m88k/m88k.h | 56 |
3 files changed, 59 insertions, 55 deletions
diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/m88k-protos.h b/gnu/usr.bin/gcc/gcc/config/m88k/m88k-protos.h index 2a50634dac4..71232291c39 100644 --- a/gnu/usr.bin/gcc/gcc/config/m88k/m88k-protos.h +++ b/gnu/usr.bin/gcc/gcc/config/m88k/m88k-protos.h @@ -105,3 +105,5 @@ extern void m88k_function_arg_advance PARAMS ((CUMULATIVE_ARGS *, extern struct rtx_def *m88k_va_arg PARAMS ((tree, tree)); extern tree m88k_build_va_list PARAMS ((void)); #endif /* TREE_CODE */ + +extern void m88k_override_options PARAMS ((void)); diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c index 2a4587e3747..b305355a748 100644 --- a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c +++ b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c @@ -3518,3 +3518,59 @@ m88k_encode_section_info (decl, first) SYMBOL_REF_FLAG (XEXP (TREE_CST_RTL (decl), 0)) = 1; } } + +void +m88k_override_options () +{ + register int i; + + if ((target_flags & MASK_88000) == 0) + target_flags |= CPU_DEFAULT; + + if (TARGET_88110) + { + target_flags |= MASK_USE_DIV; + target_flags &= ~MASK_CHECK_ZERO_DIV; + } + + m88k_cpu = (TARGET_88000 ? PROCESSOR_M88000 + : (TARGET_88100 ? PROCESSOR_M88100 : PROCESSOR_M88110)); + + if (TARGET_BIG_PIC) + flag_pic = 2; + + if ((target_flags & MASK_EITHER_LARGE_SHIFT) == MASK_EITHER_LARGE_SHIFT) + error ("-mtrap-large-shift and -mhandle-large-shift are incompatible"); + + if (TARGET_SVR4) + { + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) + reg_names[i]--; + m88k_pound_sign = "#"; + } + else + { + target_flags |= MASK_SVR3; + target_flags &= ~MASK_SVR4; + } + + if (m88k_short_data) + { + const char *p = m88k_short_data; + while (*p) + if (ISDIGIT (*p)) + p++; + else + { + error ("invalid option `-mshort-data-%s'", m88k_short_data); + break; + } + m88k_gp_threshold = atoi (m88k_short_data); + if (m88k_gp_threshold > 0x7fffffff) + error ("-mshort-data-%s is too large ", m88k_short_data); + if (flag_pic) + error ("-mshort-data-%s and PIC are incompatible", m88k_short_data); + } + if (TARGET_OMIT_LEAF_FRAME_POINTER) /* keep nonleaf frame pointers */ + flag_omit_frame_pointer = 1; +} diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.h b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.h index 7dce55dd38b..7bc6a550d06 100644 --- a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.h +++ b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.h @@ -255,61 +255,7 @@ extern int flag_pic; /* -fpic */ { "version-", &m88k_version } } /* Do any checking or such that is needed after processing the -m switches. */ - -#define OVERRIDE_OPTIONS \ - do { \ - register int i; \ - \ - if ((target_flags & MASK_88000) == 0) \ - target_flags |= CPU_DEFAULT; \ - \ - if (TARGET_88110) \ - { \ - target_flags |= MASK_USE_DIV; \ - target_flags &= ~MASK_CHECK_ZERO_DIV; \ - } \ - \ - m88k_cpu = (TARGET_88000 ? PROCESSOR_M88000 \ - : (TARGET_88100 ? PROCESSOR_M88100 : PROCESSOR_M88110)); \ - \ - if (TARGET_BIG_PIC) \ - flag_pic = 2; \ - \ - if ((target_flags & MASK_EITHER_LARGE_SHIFT) == MASK_EITHER_LARGE_SHIFT) \ - error ("-mtrap-large-shift and -mhandle-large-shift are incompatible");\ - \ - if (TARGET_SVR4) \ - { \ - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) \ - reg_names[i]--; \ - m88k_pound_sign = "#"; \ - } \ - else \ - { \ - target_flags |= MASK_SVR3; \ - target_flags &= ~MASK_SVR4; \ - } \ - \ - if (m88k_short_data) \ - { \ - const char *p = m88k_short_data; \ - while (*p) \ - if (ISDIGIT (*p)) \ - p++; \ - else \ - { \ - error ("invalid option `-mshort-data-%s'", m88k_short_data); \ - break; \ - } \ - m88k_gp_threshold = atoi (m88k_short_data); \ - if (m88k_gp_threshold > 0x7fffffff) \ - error ("-mshort-data-%s is too large ", m88k_short_data); \ - if (flag_pic) \ - error ("-mshort-data-%s and PIC are incompatible", m88k_short_data); \ - } \ - if (TARGET_OMIT_LEAF_FRAME_POINTER) /* keep nonleaf frame pointers */ \ - flag_omit_frame_pointer = 1; \ - } while (0) +#define OVERRIDE_OPTIONS m88k_override_options () /*** Storage Layout ***/ |