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. From-SVN: r255469
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
pb_ds | Loading commit data... | |
algorithm | Loading commit data... | |
aligned_buffer.h | Loading commit data... | |
alloc_traits.h | Loading commit data... | |
array_allocator.h | Loading commit data... | |
atomicity.h | Loading commit data... | |
bitmap_allocator.h | Loading commit data... | |
cast.h | Loading commit data... | |
cmath | Loading commit data... | |
codecvt_specializations.h | Loading commit data... | |
concurrence.h | Loading commit data... | |
debug_allocator.h | Loading commit data... | |
enc_filebuf.h | Loading commit data... | |
extptr_allocator.h | Loading commit data... | |
functional | Loading commit data... | |
iterator | Loading commit data... | |
malloc_allocator.h | Loading commit data... | |
memory | Loading commit data... | |
mt_allocator.h | Loading commit data... | |
new_allocator.h | Loading commit data... | |
numeric | Loading commit data... | |
numeric_traits.h | Loading commit data... | |
pod_char_traits.h | Loading commit data... | |
pointer.h | Loading commit data... | |
pool_allocator.h | Loading commit data... | |
random | Loading commit data... | |
random.tcc | Loading commit data... | |
rb_tree | Loading commit data... | |
rc_string_base.h | Loading commit data... | |
rope | Loading commit data... | |
ropeimpl.h | Loading commit data... | |
slist | Loading commit data... | |
sso_string_base.h | Loading commit data... | |
stdio_filebuf.h | Loading commit data... | |
stdio_sync_filebuf.h | Loading commit data... | |
string_conversions.h | Loading commit data... | |
throw_allocator.h | Loading commit data... | |
type_traits.h | Loading commit data... | |
typelist.h | Loading commit data... | |
vstring.h | Loading commit data... | |
vstring.tcc | Loading commit data... | |
vstring_fwd.h | Loading commit data... | |
vstring_util.h | Loading commit data... |