summaryrefslogtreecommitdiff
path: root/gcc/config/arm/arm-c.c
diff options
context:
space:
mode:
authorchrbr <chrbr@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-15 13:43:17 +0000
committerchrbr <chrbr@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-15 13:43:17 +0000
commit8bf419a707ebdfd55ae20f0d5ee1a163f7c56505 (patch)
tree3c9079b3638a9296726a171dbffa7e1c71148d10 /gcc/config/arm/arm-c.c
parente1a00927eeb260e6564cbe9a925fd8bc92337cb2 (diff)
downloadgcc-8bf419a707ebdfd55ae20f0d5ee1a163f7c56505.tar.gz
2015-09-15 Christian Bruel <christian.bruel@st.com>
PR target/52144 * config/arm/arm.c (arm_option_params_internal): Remove opts parameter. * config/arm/arm-c.c (arm_cpu_builtins): Declare static. Remove flags parameter. * config/arm/arm.h (TARGET_32BIT_P, TARGET_ARM_QBIT_P) (TARGET_ARM_SAT_P, TARGET_IDIV_P, TARGET_HAVE_LDREX_P) (TARGET_HAVE_LDREXBH_P, TARGET_HAVE_LDREXD_P, TARGET_DSP_MULTIPLY_P) (TARGET_ARM_FEATURE_LDREX_P, TARGET_INT_SIMD_P): Redefine macros with... (TARGET_ARM_SAT, TARGET_IDIV, TARGET_HAVE_LDREX) (TARGET_HAVE_LDREXBH, TARGET_HAVE_LDREXD, TARGET_ARM_FEATURE_LDREX) (TARGET_DSP_MULTIPLY, TARGET_INT_SIMD): Redefined macros. * gcc/config/arm/arm-protos.h (arm_cpu_builtins): Remove declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227795 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/arm/arm-c.c')
-rw-r--r--gcc/config/arm/arm-c.c50
1 files changed, 24 insertions, 26 deletions
diff --git a/gcc/config/arm/arm-c.c b/gcc/config/arm/arm-c.c
index 9bf3973f290..4754a15f52c 100644
--- a/gcc/config/arm/arm-c.c
+++ b/gcc/config/arm/arm-c.c
@@ -54,23 +54,20 @@ arm_lang_object_attributes_init (void)
#pragma GCC target, we need to adjust the macros dynamically. */
static void
-def_or_undef_macro(struct cpp_reader* pfile, const char *name, bool def_p)
+def_or_undef_macro(struct cpp_reader* pfile, const char *name, bool def_p)
{
if (def_p)
- cpp_define (pfile, name);
- else
- cpp_undef (pfile, name);
-}
+ cpp_define (pfile, name);
+ else
+ cpp_undef (pfile, name);
+}
-void
-arm_cpu_builtins (struct cpp_reader* pfile, int flags)
+static void
+arm_cpu_builtins (struct cpp_reader* pfile)
{
- def_or_undef_macro (pfile, "__ARM_FEATURE_DSP",
- TARGET_DSP_MULTIPLY_P (flags));
- def_or_undef_macro (pfile, "__ARM_FEATURE_QBIT",
- TARGET_ARM_QBIT_P (flags));
- def_or_undef_macro (pfile, "__ARM_FEATURE_SAT",
- TARGET_ARM_SAT_P (flags));
+ def_or_undef_macro (pfile, "__ARM_FEATURE_DSP", TARGET_DSP_MULTIPLY);
+ def_or_undef_macro (pfile, "__ARM_FEATURE_QBIT", TARGET_ARM_QBIT);
+ def_or_undef_macro (pfile, "__ARM_FEATURE_SAT", TARGET_ARM_SAT);
if (TARGET_CRYPTO)
builtin_define ("__ARM_FEATURE_CRYPTO");
if (unaligned_access)
@@ -78,19 +75,19 @@ arm_cpu_builtins (struct cpp_reader* pfile, int flags)
if (TARGET_CRC32)
builtin_define ("__ARM_FEATURE_CRC32");
- def_or_undef_macro (pfile, "__ARM_32BIT_STATE", TARGET_32BIT_P (flags));
+ def_or_undef_macro (pfile, "__ARM_32BIT_STATE", TARGET_32BIT);
- if (TARGET_ARM_FEATURE_LDREX_P (flags))
+ if (TARGET_ARM_FEATURE_LDREX)
builtin_define_with_int_value ("__ARM_FEATURE_LDREX",
- TARGET_ARM_FEATURE_LDREX_P (flags));
+ TARGET_ARM_FEATURE_LDREX);
else
cpp_undef (pfile, "__ARM_FEATURE_LDREX");
def_or_undef_macro (pfile, "__ARM_FEATURE_CLZ",
- ((TARGET_ARM_ARCH >= 5 && !TARGET_THUMB_P (flags))
+ ((TARGET_ARM_ARCH >= 5 && !TARGET_THUMB)
|| TARGET_ARM_ARCH_ISA_THUMB >=2));
- def_or_undef_macro (pfile, "__ARM_FEATURE_SIMD32", TARGET_INT_SIMD_P (flags));
+ def_or_undef_macro (pfile, "__ARM_FEATURE_SIMD32", TARGET_INT_SIMD);
builtin_define_with_int_value ("__ARM_SIZEOF_MINIMAL_ENUM",
flag_short_enums ? 1 : 4);
@@ -108,12 +105,12 @@ arm_cpu_builtins (struct cpp_reader* pfile, int flags)
builtin_define ("__ARM_ARCH_ISA_ARM");
builtin_define ("__APCS_32__");
- def_or_undef_macro (pfile, "__thumb__", TARGET_THUMB_P (flags));
- def_or_undef_macro (pfile, "__thumb2__", TARGET_THUMB2_P (flags));
+ def_or_undef_macro (pfile, "__thumb__", TARGET_THUMB);
+ def_or_undef_macro (pfile, "__thumb2__", TARGET_THUMB2);
if (TARGET_BIG_END)
- def_or_undef_macro (pfile, "__THUMBEB__", TARGET_THUMB_P (flags));
+ def_or_undef_macro (pfile, "__THUMBEB__", TARGET_THUMB);
else
- def_or_undef_macro (pfile, "__THUMBEL__", TARGET_THUMB_P (flags));
+ def_or_undef_macro (pfile, "__THUMBEL__", TARGET_THUMB);
if (TARGET_ARM_ARCH_ISA_THUMB)
builtin_define_with_int_value ("__ARM_ARCH_ISA_THUMB",
@@ -181,8 +178,8 @@ arm_cpu_builtins (struct cpp_reader* pfile, int flags)
builtin_define ("__ARM_EABI__");
}
- def_or_undef_macro (pfile, "__ARM_ARCH_EXT_IDIV__", TARGET_IDIV_P (flags));
- def_or_undef_macro (pfile, "__ARM_FEATURE_IDIV", TARGET_IDIV_P (flags));
+ def_or_undef_macro (pfile, "__ARM_ARCH_EXT_IDIV__", TARGET_IDIV);
+ def_or_undef_macro (pfile, "__ARM_FEATURE_IDIV", TARGET_IDIV);
def_or_undef_macro (pfile, "__ARM_ASM_SYNTAX_UNIFIED__", inline_asm_unified);
}
@@ -193,7 +190,7 @@ arm_cpu_cpp_builtins (struct cpp_reader * pfile)
builtin_assert ("cpu=arm");
builtin_assert ("machine=arm");
- arm_cpu_builtins (pfile, target_flags);
+ arm_cpu_builtins (pfile);
}
/* Hook to validate the current #pragma GCC target and set the arch custom
@@ -245,7 +242,8 @@ arm_pragma_target_parse (tree args, tree pop_target)
cpp_opts->warn_unused_macros = 0;
/* Update macros. */
- arm_cpu_builtins (parse_in, cur_opt->x_target_flags);
+ gcc_assert (cur_opt->x_target_flags == target_flags);
+ arm_cpu_builtins (parse_in);
cpp_opts->warn_unused_macros = saved_warn_unused_macros;
}