diff options
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 63 | ||||
-rw-r--r-- | gcc/c/c-decl.cc | 1 | ||||
-rw-r--r-- | gcc/c/c-objc-common.cc | 5 | ||||
-rw-r--r-- | gcc/c/c-parser.cc | 19 | ||||
-rw-r--r-- | gcc/c/c-typeck.cc | 17 |
5 files changed, 95 insertions, 10 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index f24c084..7f5b0b8 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,66 @@ +2025-06-03 Martin Uecker <uecker@tugraz.at> + + * c-typeck.cc (composite_type_internal,composite_type): Move + checking assertions. + +2025-06-03 Martin Uecker <uecker@tugraz.at> + + PR c/116892 + * c-decl.cc (finish_enum): Propagate TYPE_PACKED. + +2025-06-02 Sandra Loosemore <sloosemore@baylibre.com> + + * c-parser.cc (c_parser_omp_context_selector): Call + convert_lvalue_to_rvalue and c_objc_common_truthvalue_conversion + on the expression for OMP_TRAIT_PROPERTY_BOOL_EXPR. + +2025-06-01 Martin Uecker <uecker@tugraz.at> + + PR c/120380 + * c-objc-common.cc (get_aka_type): Ignore attributes for tagged types. + +2025-05-30 Qing Zhao <qing.zhao@oracle.com> + + PR c/120354 + * c-decl.cc (finish_struct): Or the results for TYPE_INCLUDES_FLEXARRAY. + +2025-05-30 Qing Zhao <qing.zhao@oracle.com> + + PR c/120353 + * c-decl.cc (finish_struct): Copy TYPE_INCLUDES_FLEXARRAY marking + to all the variant types of the current structure type. + +2025-05-30 Julian Brown <julian@codesourcery.com> + + * c-decl.cc (c_omp_mapper_id, c_omp_mapper_decl, c_omp_mapper_lookup, + c_omp_extract_mapper_directive, c_omp_map_array_section, + c_omp_scan_mapper_bindings_r, c_omp_scan_mapper_bindings): New + functions. + * c-objc-common.h (LANG_HOOKS_OMP_FINISH_MAPPER_CLAUSES, + LANG_HOOKS_OMP_MAPPER_LOOKUP, LANG_HOOKS_OMP_EXTRACT_MAPPER_DIRECTIVE, + LANG_HOOKS_OMP_MAP_ARRAY_SECTION): Define langhooks for C. + * c-parser.cc (c_parser_omp_clause_map): Add declare_mapper_p + parameter; handle mapper modifier. + (c_parser_omp_all_clauses): Update call to c_parser_omp_clause_map. + (c_parser_omp_target): Instantiate explicit mappers and record bindings + for implicit mappers. + (c_parser_omp_declare_mapper): Parse "declare mapper" directives. + (c_parser_omp_declare): Support "declare mapper". + (c_parser_omp_declare_reduction): Use inform not error_at. + * c-tree.h (c_omp_finish_mapper_clauses, c_omp_mapper_lookup, + c_omp_extract_mapper_directive, c_omp_map_array_section, + c_omp_mapper_id, c_omp_mapper_decl, c_omp_scan_mapper_bindings, + c_omp_instantiate_mappers): Add prototypes. + * c-typeck.cc (c_finish_omp_clauses): Handle GOMP_MAP_PUSH_MAPPER_NAME + and GOMP_MAP_POP_MAPPER_NAME. + (c_omp_finish_mapper_clauses): New function (langhook). + +2025-05-30 Martin Uecker <uecker@tugraz.at> + + PR c/120381 + * c-typeck.cc (composite_type_internal): Stop recursion for + swapped pairs. + 2025-05-29 Sandra Loosemore <sloosemore@baylibre.com> * c-parser.cc (c_parser_skip_to_closing_brace): New, copied from diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc index 1008bca..2b0bd66 100644 --- a/gcc/c/c-decl.cc +++ b/gcc/c/c-decl.cc @@ -10293,6 +10293,7 @@ finish_enum (tree enumtype, tree values, tree attributes) TYPE_UNSIGNED (tem) = TYPE_UNSIGNED (enumtype); TYPE_LANG_SPECIFIC (tem) = TYPE_LANG_SPECIFIC (enumtype); ENUM_UNDERLYING_TYPE (tem) = ENUM_UNDERLYING_TYPE (enumtype); + TYPE_PACKED (tem) = TYPE_PACKED (enumtype); } /* Finish debugging output for this type. */ diff --git a/gcc/c/c-objc-common.cc b/gcc/c/c-objc-common.cc index 2016eae..d574bc7 100644 --- a/gcc/c/c-objc-common.cc +++ b/gcc/c/c-objc-common.cc @@ -216,6 +216,11 @@ get_aka_type (tree type) return canonical ? canonical : type; } } + /* For tagged types ignore attributes because they will otherwise + be ignored later causing a warning inside diagnostics which leads + to an ICE. */ + if (RECORD_OR_UNION_TYPE_P (type) || TREE_CODE (type) == ENUMERAL_TYPE) + return build_qualified_type (result, TYPE_QUALS (type)); return build_type_attribute_qual_variant (result, TYPE_ATTRIBUTES (type), TYPE_QUALS (type)); } diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc index cc0ab12..85580c5 100644 --- a/gcc/c/c-parser.cc +++ b/gcc/c/c-parser.cc @@ -26966,17 +26966,30 @@ c_parser_omp_context_selector (c_parser *parser, enum omp_tss_code set, break; case OMP_TRAIT_PROPERTY_DEV_NUM_EXPR: case OMP_TRAIT_PROPERTY_BOOL_EXPR: - t = c_parser_expr_no_commas (parser, NULL).value; + { + c_expr texpr = c_parser_expr_no_commas (parser, NULL); + texpr = convert_lvalue_to_rvalue (token->location, texpr, + true, true); + t = texpr.value; + } if (t == error_mark_node) return error_mark_node; mark_exp_read (t); - t = c_fully_fold (t, false, NULL); - if (!INTEGRAL_TYPE_P (TREE_TYPE (t))) + if (property_kind == OMP_TRAIT_PROPERTY_BOOL_EXPR) + { + t = c_objc_common_truthvalue_conversion (token->location, + t, + boolean_type_node); + if (t == error_mark_node) + return error_mark_node; + } + else if (!INTEGRAL_TYPE_P (TREE_TYPE (t))) { error_at (token->location, "property must be integer expression"); return error_mark_node; } + t = c_fully_fold (t, false, NULL); properties = make_trait_property (NULL_TREE, t, properties); break; case OMP_TRAIT_PROPERTY_CLAUSE_LIST: diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc index 2f243ca..b59b5c8a 100644 --- a/gcc/c/c-typeck.cc +++ b/gcc/c/c-typeck.cc @@ -846,12 +846,7 @@ composite_type_internal (tree t1, tree t2, struct composite_cache* cache) n = finish_struct (input_location, n, fields, attributes, NULL, &expr); - n = qualify_type (n, t1); - - gcc_checking_assert (!TYPE_NAME (n) || comptypes (n, t1)); - gcc_checking_assert (!TYPE_NAME (n) || comptypes (n, t2)); - - return n; + return qualify_type (n, t1); } /* FALLTHRU */ case ENUMERAL_TYPE: @@ -1004,7 +999,15 @@ tree composite_type (tree t1, tree t2) { struct composite_cache cache = { }; - return composite_type_internal (t1, t2, &cache); + tree n = composite_type_internal (t1, t2, &cache); + /* For function and arrays there are some cases where qualifiers do + not match. See PR120510. */ + if (FUNCTION_TYPE != TREE_CODE (n) && ARRAY_TYPE != TREE_CODE (n)) + { + gcc_checking_assert (comptypes (n, t1)); + gcc_checking_assert (comptypes (n, t2)); + } + return n; } /* Return the type of a conditional expression between pointers to |