diff options
Diffstat (limited to 'gcc/c-family/c-common.c')
-rw-r--r-- | gcc/c-family/c-common.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 6cf8c610b4e..d6572f71d0d 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -7989,9 +7989,14 @@ handle_alias_ifunc_attribute (bool is_alias, tree *node, tree name, tree args, TREE_STATIC (decl) = 1; if (!is_alias) - /* ifuncs are also aliases, so set that attribute too. */ - DECL_ATTRIBUTES (decl) - = tree_cons (get_identifier ("alias"), args, DECL_ATTRIBUTES (decl)); + { + /* ifuncs are also aliases, so set that attribute too. */ + DECL_ATTRIBUTES (decl) + = tree_cons (get_identifier ("alias"), args, + DECL_ATTRIBUTES (decl)); + DECL_ATTRIBUTES (decl) = tree_cons (get_identifier ("ifunc"), + NULL, DECL_ATTRIBUTES (decl)); + } } else { @@ -9583,7 +9588,7 @@ parse_optimize_options (tree args, bool attr_p) &decoded_options_count); decode_options (&global_options, &global_options_set, decoded_options, decoded_options_count, - input_location, global_dc); + input_location, global_dc, NULL); targetm.override_options_after_change(); @@ -10725,10 +10730,9 @@ sync_resolve_size (tree function, vec<tree, va_gc> *params, bool fetch) } argtype = type = TREE_TYPE ((*params)[0]); - if (TREE_CODE (type) == ARRAY_TYPE) + if (TREE_CODE (type) == ARRAY_TYPE && c_dialect_cxx ()) { /* Force array-to-pointer decay for C++. */ - gcc_assert (c_dialect_cxx()); (*params)[0] = default_conversion ((*params)[0]); type = TREE_TYPE ((*params)[0]); } @@ -10890,10 +10894,9 @@ get_atomic_generic_size (location_t loc, tree function, /* Get type of first parameter, and determine its size. */ type_0 = TREE_TYPE ((*params)[0]); - if (TREE_CODE (type_0) == ARRAY_TYPE) + if (TREE_CODE (type_0) == ARRAY_TYPE && c_dialect_cxx ()) { /* Force array-to-pointer decay for C++. */ - gcc_assert (c_dialect_cxx()); (*params)[0] = default_conversion ((*params)[0]); type_0 = TREE_TYPE ((*params)[0]); } @@ -10932,6 +10935,12 @@ get_atomic_generic_size (location_t loc, tree function, /* __atomic_compare_exchange has a bool in the 4th position, skip it. */ if (n_param == 6 && x == 3) continue; + if (TREE_CODE (type) == ARRAY_TYPE && c_dialect_cxx ()) + { + /* Force array-to-pointer decay for C++. */ + (*params)[x] = default_conversion ((*params)[x]); + type = TREE_TYPE ((*params)[x]); + } if (!POINTER_TYPE_P (type)) { error_at (loc, "argument %d of %qE must be a pointer type", x + 1, |