diff options
author | Ian Lance Taylor <iant@golang.org> | 2020-12-03 12:12:10 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-12-03 12:12:10 -0800 |
commit | f012991e2db06cc95f7aac8ecb74a1ac5f51f3d2 (patch) | |
tree | 582e5d7b377b6e973666a71960b28a7d11d72b07 /gcc/c | |
parent | 8d703821c69062c0cd255787d793e44f1a95d463 (diff) | |
parent | 3089f5feef36810c625b5813370a97b4ecc841f8 (diff) | |
download | gcc-f012991e2db06cc95f7aac8ecb74a1ac5f51f3d2.zip gcc-f012991e2db06cc95f7aac8ecb74a1ac5f51f3d2.tar.gz gcc-f012991e2db06cc95f7aac8ecb74a1ac5f51f3d2.tar.bz2 |
Merge from trunk revision 3089f5feef36810c625b5813370a97b4ecc841f8
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 89 | ||||
-rw-r--r-- | gcc/c/Make-lang.in | 3 | ||||
-rw-r--r-- | gcc/c/c-aux-info.c | 1 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 7 | ||||
-rw-r--r-- | gcc/c/c-parser.c | 27 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 14 |
6 files changed, 115 insertions, 26 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 5b0d42c..b97fb74 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,92 @@ +2020-11-26 Martin Uecker <muecker@gwdg.de> + + PR c/65455 + PR c/92935 + * c-parser.c (c_parser_declaration_or_fndef): Remove + redundant code to drop qualifiers of _Atomic types for __auto_type. + (c_parser_typeof_specifier): Do not drop qualifiers of _Atomic + types for __typeof__. + +2020-11-24 Jakub Jelinek <jakub@redhat.com> + + PR c/97958 + * c-parser.c (c_parser_binary_expression): For omp atomic binary + expressions, use make_node instead of build2 to avoid checking build2 + performs. + +2020-11-23 Joseph Myers <joseph@codesourcery.com> + + PR c/95630 + * c-typeck.c (build_binary_op): Use pedwarn_c99 with OPT_Wpedantic + for comparisons of complete and incomplete pointers. + +2020-11-21 Aaron Sawdey <acsawdey@linux.ibm.com> + + * c-aux-info.c (gen_type): Support opaque types. + +2020-11-20 Martin Sebor <msebor@redhat.com> + + PR middle-end/97879 + * c-decl.c (start_function): Set ATTR_FLAG_INTERNAL in flags. + +2020-11-20 Jakub Jelinek <jakub@redhat.com> + + PR other/97911 + * Make-lang.in (c.serial): Change from goal to a variable. + (.PHONY): Drop c.serial. + +2020-11-20 Martin Uecker <muecker@gwdg.de> + + * c-typeck.c (convert_lvalue_to_rvalue): Drop qualifiers. + +2020-11-19 Jakub Jelinek <jakub@redhat.com> + + PR c/97860 + * c-decl.c (get_parm_array_spec): Bail out of nelts is + error_operand_p. + +2020-11-18 Jakub Jelinek <jakub@redhat.com> + + * Make-lang.in (c.serial): New goal. + (.PHONY): Add c.serial c.prev. + (cc1$(exeext)): Call LINK_PROGRESS. + +2020-11-13 Vladimir N. Makarov <vmakarov@redhat.com> + + * c-parser.c (c_parser_asm_statement): Parse outputs for asm + goto too. + * c-typeck.c (build_asm_expr): Remove an assert checking output + absence for asm goto. + +2020-11-13 Jakub Jelinek <jakub@redhat.com> + + * c-typeck.c (c_finish_omp_clauses): Don't clear + OMP_CLAUSE_REDUCTION_INSCAN unless reduction_seen == -2. + +2020-11-13 Iain Sandoe <iain@sandoe.co.uk> + + PR objc/77404 + * c-parser.c (c_parser_objc_class_definition): Pass the + location of the class name to the interface declaration. + +2020-11-10 Strager Neds <strager.nds@gmail.com> + + * c-decl.c (merge_decls): Use new overload of + set_decl_section_name. + +2020-11-10 Chung-Lin Tang <cltang@codesourcery.com> + + * c-parser.c (c_parser_omp_target_data): Add use of + new c_omp_adjust_map_clauses function. Add GOMP_MAP_ATTACH_DETACH as + handled map clause kind. + (c_parser_omp_target_enter_data): Likewise. + (c_parser_omp_target_exit_data): Likewise. + (c_parser_omp_target): Likewise. + * c-typeck.c (handle_omp_array_sections): Adjust COMPONENT_REF case to + use GOMP_MAP_ATTACH_DETACH map kind for C_ORT_OMP region type. + (c_finish_omp_clauses): Adjust bitmap checks to allow struct decl and + same struct field access to co-exist on OpenMP construct. + 2020-11-07 Martin Uecker <muecker@gwdg.de> * c-parser.c (c_parser_label): Implement mixing of labels and code. diff --git a/gcc/c/Make-lang.in b/gcc/c/Make-lang.in index 7efc7c2..4b2e616 100644 --- a/gcc/c/Make-lang.in +++ b/gcc/c/Make-lang.in @@ -37,6 +37,7 @@ # # Define the names for selecting c in LANGUAGES. c: cc1$(exeext) +c.serial = cc1$(exeext) # Tell GNU make to ignore these if they exist. .PHONY: c gcc @@ -82,8 +83,10 @@ cc1-checksum.c : build/genchecksum$(build_exeext) checksum-options \ fi cc1$(exeext): $(C_OBJS) cc1-checksum.o $(BACKEND) $(LIBDEPS) + @$(call LINK_PROGRESS,$(INDEX.c),start) +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) \ cc1-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS) + @$(call LINK_PROGRESS,$(INDEX.c),end) cc1.fda: ../stage1-gcc/cc1$(exeext) ../prev-gcc/$(PERF_DATA) $(CREATE_GCOV) -binary ../stage1-gcc/cc1$(exeext) -gcov cc1.fda -profile ../prev-gcc/$(PERF_DATA) -gcov_version 1 diff --git a/gcc/c/c-aux-info.c b/gcc/c/c-aux-info.c index ffc8099..bdeef52 100644 --- a/gcc/c/c-aux-info.c +++ b/gcc/c/c-aux-info.c @@ -409,6 +409,7 @@ gen_type (const char *ret_val, tree t, formals_style style) data_type = concat ("unsigned ", data_type, NULL); break; + case OPAQUE_TYPE: case REAL_TYPE: data_type = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (t))); break; diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index f19c82c..27f7722 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -2884,7 +2884,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) || TREE_PUBLIC (olddecl) || TREE_STATIC (olddecl)) && DECL_SECTION_NAME (newdecl) != NULL) - set_decl_section_name (olddecl, DECL_SECTION_NAME (newdecl)); + set_decl_section_name (olddecl, newdecl); /* This isn't quite correct for something like int __thread x attribute ((tls_model ("local-exec"))); @@ -5775,6 +5775,8 @@ get_parm_array_spec (const struct c_parm *parm, tree attrs) type = TREE_TYPE (type)) { tree nelts = array_type_nelts (type); + if (error_operand_p (nelts)) + return attrs; if (TREE_CODE (nelts) != INTEGER_CST) { /* Each variable VLA bound is represented by the dollar @@ -9596,7 +9598,8 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, current_function_decl = pushdecl (decl1); if (tree access = build_attr_access_from_parms (parms, false)) - decl_attributes (¤t_function_decl, access, 0, old_decl); + decl_attributes (¤t_function_decl, access, ATTR_FLAG_INTERNAL, + old_decl); push_scope (); declare_parm_level (); diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 377914c..87ee8f4 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -2224,10 +2224,6 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, " initializer"); init = convert_lvalue_to_rvalue (init_loc, init, true, true); tree init_type = TREE_TYPE (init.value); - /* As with typeof, remove all qualifiers from atomic types. */ - if (init_type != error_mark_node && TYPE_ATOMIC (init_type)) - init_type - = c_build_qualified_type (init_type, TYPE_UNQUALIFIED); bool vm_type = variably_modified_type_p (init_type, NULL_TREE); if (vm_type) @@ -3743,11 +3739,6 @@ c_parser_typeof_specifier (c_parser *parser) if (was_vm) ret.expr = c_fully_fold (expr.value, false, &ret.expr_const_operands); pop_maybe_used (was_vm); - /* For use in macros such as those in <stdatomic.h>, remove all - qualifiers from atomic types. (const can be an issue for more macros - using typeof than just the <stdatomic.h> ones.) */ - if (ret.spec != error_mark_node && TYPE_ATOMIC (ret.spec)) - ret.spec = c_build_qualified_type (ret.spec, TYPE_UNQUALIFIED); } parens.skip_until_found_close (parser); return ret; @@ -7144,10 +7135,7 @@ c_parser_asm_statement (c_parser *parser) switch (section) { case 0: - /* For asm goto, we don't allow output operands, but reserve - the slot for a future extension that does allow them. */ - if (!is_goto) - outputs = c_parser_asm_operands (parser); + outputs = c_parser_asm_operands (parser); break; case 1: inputs = c_parser_asm_operands (parser); @@ -7868,9 +7856,13 @@ c_parser_binary_expression (c_parser *parser, struct c_expr *after, && stack[1].expr.value != error_mark_node \ && (c_tree_equal (stack[0].expr.value, omp_atomic_lhs) \ || c_tree_equal (stack[1].expr.value, omp_atomic_lhs))) \ - stack[0].expr.value \ - = build2 (stack[1].op, TREE_TYPE (stack[0].expr.value), \ - stack[0].expr.value, stack[1].expr.value); \ + { \ + tree t = make_node (stack[1].op); \ + TREE_TYPE (t) = TREE_TYPE (stack[0].expr.value); \ + TREE_OPERAND (t, 0) = stack[0].expr.value; \ + TREE_OPERAND (t, 1) = stack[1].expr.value; \ + stack[0].expr.value = t; \ + } \ else \ stack[sp - 1].expr = parser_build_binary_op (stack[sp].loc, \ stack[sp].op, \ @@ -10801,6 +10793,7 @@ c_parser_objc_class_definition (c_parser *parser, tree attributes) return; } id1 = c_parser_peek_token (parser)->value; + location_t loc1 = c_parser_peek_token (parser)->location; c_parser_consume_token (parser); if (c_parser_next_token_is (parser, CPP_OPEN_PAREN)) { @@ -10860,7 +10853,7 @@ c_parser_objc_class_definition (c_parser *parser, tree attributes) tree proto = NULL_TREE; if (c_parser_next_token_is (parser, CPP_LESS)) proto = c_parser_objc_protocol_refs (parser); - objc_start_class_interface (id1, superclass, proto, attributes); + objc_start_class_interface (id1, loc1, superclass, proto, attributes); } else objc_start_class_implementation (id1, superclass); diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index df1dad4..cdc491a 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -2080,6 +2080,9 @@ convert_lvalue_to_rvalue (location_t loc, struct c_expr exp, exp = default_function_array_conversion (loc, exp); if (!VOID_TYPE_P (TREE_TYPE (exp.value))) exp.value = require_complete_type (loc, exp.value); + if (convert_p && !error_operand_p (exp.value) + && (TREE_CODE (TREE_TYPE (exp.value)) != ARRAY_TYPE)) + exp.value = convert (build_qualified_type (TREE_TYPE (exp.value), TYPE_UNQUALIFIED), exp.value); if (really_atomic_lvalue (exp.value)) { vec<tree, va_gc> *params; @@ -10666,10 +10669,6 @@ build_asm_expr (location_t loc, tree string, tree outputs, tree inputs, TREE_VALUE (tail) = input; } - /* ASMs with labels cannot have outputs. This should have been - enforced by the parser. */ - gcc_assert (outputs == NULL || labels == NULL); - args = build_stmt (loc, ASM_EXPR, string, outputs, inputs, clobbers, labels); /* asm statements without outputs, including simple ones, are treated @@ -12267,8 +12266,8 @@ build_binary_op (location_t location, enum tree_code code, result_type = common_pointer_type (type0, type1); if (!COMPLETE_TYPE_P (TREE_TYPE (type0)) != !COMPLETE_TYPE_P (TREE_TYPE (type1))) - pedwarn (location, 0, - "comparison of complete and incomplete pointers"); + pedwarn_c99 (location, OPT_Wpedantic, + "comparison of complete and incomplete pointers"); else if (TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE) pedwarn (location, OPT_Wpedantic, "ISO C forbids " "ordered comparisons of pointers to functions"); @@ -15199,7 +15198,8 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort) OMP_CLAUSE_LINEAR_STEP (c)); remove = true; } - else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION) + else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION + && reduction_seen == -2) OMP_CLAUSE_REDUCTION_INSCAN (c) = 0; if (remove) |