aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/arm/arm.c
diff options
context:
space:
mode:
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>2017-12-07 16:32:03 +0000
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>2017-12-07 16:32:03 +0000
commitdab0e385e3d445022e5be724290b00a384bc4bff (patch)
treea586e44e1f5c41fd8ae4cb8fd80446c763cc595d /gcc/config/arm/arm.c
parent865ea74800b9099f5eead817cc8fcfff005c43c5 (diff)
PR c/81544 - attribute noreturn and warn_unused_result on the same function accepted
PR c/81566 - invalid attribute aligned accepted on functions gcc/ada/ChangeLog: PR c/81544 * gcc-interface/utils.c (gnat_internal_attribute_table): Initialize new member of struct attribute_spec. gcc/c/ChangeLog: PR c/81544 * c-decl.c (c_decl_attributes): Look up existing declaration and pass it to decl_attributes. gcc/c-family/ChangeLog: PR c/81544 PR c/81566 * c-attribs.c (attr_aligned_exclusions): New array. (attr_alloc_exclusions, attr_cold_hot_exclusions): Same. (attr_common_exclusions, attr_const_pure_exclusions): Same. (attr_gnu_inline_exclusions, attr_inline_exclusions): Same. (attr_noreturn_exclusions, attr_returns_twice_exclusions): Same. (attr_warn_unused_result_exclusions): Same. (handle_hot_attribute, handle_cold_attribute): Simplify. (handle_const_attribute): Warn on function returning void. (handle_pure_attribute): Same. (handle_aligned_attribute): Diagnose conflicting attribute specifications. * c-warn.c (diagnose_mismatched_attributes): Simplify. gcc/cp/ChangeLog: PR c/81544 * cp-tree.h (decls_match): Add default argument. * decl.c (decls_match): Avoid calling into the target back end and triggering an error. * decl2.c (cplus_decl_attributes): Look up existing declaration and pass it to decl_attributes. * tree.c (cxx_attribute_table): Initialize new member of struct attribute_spec. gcc/fortran/ChangeLog: PR c/81544 * f95-lang.c (gfc_attribute_table): Initialize new member of struct attribute_spec. gcc/lto/ChangeLog: PR c/81544 * lto-lang.c (lto_attribute_table): Initialize new member of struct attribute_spec. gcc/ChangeLog: PR c/81544 * attribs.c (empty_attribute_table): Initialize new member of struct attribute_spec. (decl_attributes): Add argument. Handle mutually exclusive combinations of attributes. (selftests::test_attribute_exclusions): New function. (selftests::attribute_c_tests): Ditto. * attribs.h (decl_attributes): Add default argument. * selftest.h (attribute_c_tests): Declare. * selftest-run-tests.c (selftest::run_tests): Call attribute_c_tests. * tree-core.h (attribute_spec::exclusions, exclude): New type and member. * doc/extend.texi (Common Function Attributes): Update const and pure. gcc/testsuite/ChangeLog: PR c/81544 * c-c++-common/Wattributes-2.c: New test. * c-c++-common/Wattributes.c: New test. * c-c++-common/attributes-3.c: Adjust. * gcc.dg/Wattributes-6.c: New test. * gcc.dg/Wattributes-7.c: New test. * gcc.dg/attr-noinline.c * gcc.dg/pr44964.c: Same. * gcc.dg/torture/pr42363.c: Same. * gcc.dg/tree-ssa/ssa-ccp-2.c: Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255469 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/arm/arm.c')
-rw-r--r--gcc/config/arm/arm.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index b98637714ab..f34b6e0d933 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -323,24 +323,24 @@ static HOST_WIDE_INT arm_constant_alignment (const_tree, HOST_WIDE_INT);
static const struct attribute_spec arm_attribute_table[] =
{
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
- affects_type_identity } */
+ affects_type_identity, exclusions } */
/* Function calls made to this symbol must be done indirectly, because
it may lie outside of the 26 bit addressing range of a normal function
call. */
- { "long_call", 0, 0, false, true, true, NULL, false },
+ { "long_call", 0, 0, false, true, true, NULL, false, NULL },
/* Whereas these functions are always known to reside within the 26 bit
addressing range. */
- { "short_call", 0, 0, false, true, true, NULL, false },
+ { "short_call", 0, 0, false, true, true, NULL, false, NULL },
/* Specify the procedure call conventions for a function. */
{ "pcs", 1, 1, false, true, true, arm_handle_pcs_attribute,
- false },
+ false, NULL },
/* Interrupt Service Routines have special prologue and epilogue requirements. */
{ "isr", 0, 1, false, false, false, arm_handle_isr_attribute,
- false },
+ false, NULL },
{ "interrupt", 0, 1, false, false, false, arm_handle_isr_attribute,
- false },
+ false, NULL },
{ "naked", 0, 0, true, false, false, arm_handle_fndecl_attribute,
- false },
+ false, NULL },
#ifdef ARM_PE
/* ARM/PE has three new attributes:
interfacearm - ?
@@ -351,22 +351,24 @@ static const struct attribute_spec arm_attribute_table[] =
them with spaces. We do NOT support this. Instead, use __declspec
multiple times.
*/
- { "dllimport", 0, 0, true, false, false, NULL, false },
- { "dllexport", 0, 0, true, false, false, NULL, false },
+ { "dllimport", 0, 0, true, false, false, NULL, false, NULL },
+ { "dllexport", 0, 0, true, false, false, NULL, false, NULL },
{ "interfacearm", 0, 0, true, false, false, arm_handle_fndecl_attribute,
- false },
+ false, NULL },
#elif TARGET_DLLIMPORT_DECL_ATTRIBUTES
- { "dllimport", 0, 0, false, false, false, handle_dll_attribute, false },
- { "dllexport", 0, 0, false, false, false, handle_dll_attribute, false },
+ { "dllimport", 0, 0, false, false, false, handle_dll_attribute, false,
+ NULL },
+ { "dllexport", 0, 0, false, false, false, handle_dll_attribute, false,
+ NULL },
{ "notshared", 0, 0, false, true, false, arm_handle_notshared_attribute,
- false },
+ false, NULL },
#endif
/* ARMv8-M Security Extensions support. */
{ "cmse_nonsecure_entry", 0, 0, true, false, false,
- arm_handle_cmse_nonsecure_entry, false },
+ arm_handle_cmse_nonsecure_entry, false, NULL },
{ "cmse_nonsecure_call", 0, 0, true, false, false,
- arm_handle_cmse_nonsecure_call, true },
- { NULL, 0, 0, false, false, false, NULL, false }
+ arm_handle_cmse_nonsecure_call, true, NULL },
+ { NULL, 0, 0, false, false, false, NULL, false, NULL }
};
/* Initialize the GCC target structure. */