From b18dea91101707b401e5b3ca079facc135ce4201 Mon Sep 17 00:00:00 2001 From: msebor Date: Thu, 1 Sep 2016 22:47:49 +0000 Subject: gcc/c-family/ChangeLog: * c-ada-spec.c (dump_ada_function_declaration): Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. gcc/cp/ChangeLog: * mangle.c: Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. gcc/go/ChangeLog: * gofrontend/expressions.cc: Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. gcc/java/ChangeLog: * decl.c (give_name_to_locals): Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. * mangle_name.c (append_unicode_mangled_name): Same. gcc/ChangeLog: * genmatch.c (parser::parse_expr): Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. * gcc/genmodes.c (parser::parse_expr): Same. * gimplify.c (gimplify_asm_expr): Same. * passes.c (pass_manager::register_one_dump_file): Same. * print-tree.c (print_node): Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239949 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/gimplify.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/gimplify.c') diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 288b4727dd8..21e1c093385 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -5346,7 +5346,8 @@ gimplify_asm_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) flexibility, split it into separate input and output operands. */ tree input; - char buf[10]; + /* Buffer big enough to format a 32-bit UINT_MAX into. */ + char buf[11]; /* Turn the in/out constraint into an output constraint. */ char *p = xstrdup (constraint); @@ -5356,7 +5357,7 @@ gimplify_asm_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) /* And add a matching input constraint. */ if (allows_reg) { - sprintf (buf, "%d", i); + sprintf (buf, "%u", i); /* If there are multiple alternatives in the constraint, handle each of them individually. Those that allow register -- cgit v1.2.1 From 0b80c4b2d7a168c3da186901ff8f4b9b53eaab4a Mon Sep 17 00:00:00 2001 From: jakub Date: Fri, 2 Sep 2016 18:38:07 +0000 Subject: PR c/65467 * gimplify.c (gimplify_adjust_omp_clauses_1): Diagnose implicit map and firstprivate clauses on target construct for _Atomic qualified decls. (gimplify_adjust_omp_clauses): Diagnose explicit firstprivate clauses on target construct for _Atomic qualified decls. * omp-low.c (use_pointer_for_field): Return true for _Atomic qualified decls. * omp-simd-clone.c (simd_clone_clauses_extract): Warn and give up for _Atomic qualified arguments not mentioned in uniform clause. c/ * c-parser.c (c_parser_declspecs): Don't sorry about _Atomic if flag_openmp. (c_parser_omp_variable_list): Use convert_lvalue_to_rvalue instead of mark_exp_read on low_bound/length expression. (c_parser_omp_clause_num_gangs, c_parser_omp_clause_num_threads, c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize, c_parser_omp_clause_priority, c_parser_omp_clause_hint, c_parser_omp_clause_num_workers, c_parser_oacc_shape_clause, c_parser_oacc_clause_tile, c_parser_omp_clause_schedule, c_parser_omp_clause_vector_length, c_parser_omp_clause_num_teams, c_parser_omp_clause_thread_limit, c_parser_omp_clause_aligned, c_parser_omp_clause_linear, c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen, c_parser_omp_clause_device, c_parser_omp_clause_dist_schedule): Use convert_lvalue_to_rvalue instead of mark_expr_read. (c_parser_omp_declare_reduction): Reject _Atomic qualified types. * c-objc-common.h (LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP): Redefine. * c-tree.h (c_omp_clause_copy_ctor): New prototype. * c-typeck.c (handle_omp_array_sections_1): Diagnose _Atomic qualified array section bases outside of depend clause, for depend clause use convert_lvalue_to_rvalue on the base. (c_finish_omp_clauses): Reject _Atomic qualified vars in reduction, linear, aligned, map, to and from clauses. (c_omp_clause_copy_ctor): New function. c-family/ * c-omp.c (c_finish_omp_atomic): Reject _Atomic qualified expressions. (c_finish_omp_for): Reject _Atomic qualified iterators. testsuite/ * gcc.dg/gomp/_Atomic-1.c: New test. * gcc.dg/gomp/_Atomic-2.c: New test. * gcc.dg/gomp/_Atomic-3.c: New test. * gcc.dg/gomp/_Atomic-4.c: New test. * gcc.dg/gomp/_Atomic-5.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239964 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/gimplify.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'gcc/gimplify.c') diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 21e1c093385..2f0dd88ebd6 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -7911,7 +7911,15 @@ gimplify_adjust_omp_clauses_1 (splay_tree_node n, void *data) if (private_debug) code = OMP_CLAUSE_PRIVATE; else if (flags & GOVD_MAP) - code = OMP_CLAUSE_MAP; + { + code = OMP_CLAUSE_MAP; + if ((gimplify_omp_ctxp->region_type & ORT_ACC) == 0 + && TYPE_ATOMIC (strip_array_types (TREE_TYPE (decl)))) + { + error ("%<_Atomic%> %qD in implicit % clause", decl); + return 0; + } + } else if (flags & GOVD_SHARED) { if (is_global_var (decl)) @@ -7935,7 +7943,17 @@ gimplify_adjust_omp_clauses_1 (splay_tree_node n, void *data) else if (flags & GOVD_PRIVATE) code = OMP_CLAUSE_PRIVATE; else if (flags & GOVD_FIRSTPRIVATE) - code = OMP_CLAUSE_FIRSTPRIVATE; + { + code = OMP_CLAUSE_FIRSTPRIVATE; + if ((gimplify_omp_ctxp->region_type & ORT_TARGET) + && (gimplify_omp_ctxp->region_type & ORT_ACC) == 0 + && TYPE_ATOMIC (strip_array_types (TREE_TYPE (decl)))) + { + error ("%<_Atomic%> %qD in implicit % clause on " + "% construct", decl); + return 0; + } + } else if (flags & GOVD_LASTPRIVATE) code = OMP_CLAUSE_LASTPRIVATE; else if (flags & GOVD_ALIGNED) @@ -8090,9 +8108,21 @@ gimplify_adjust_omp_clauses (gimple_seq *pre_p, gimple_seq body, tree *list_p, switch (OMP_CLAUSE_CODE (c)) { + case OMP_CLAUSE_FIRSTPRIVATE: + if ((ctx->region_type & ORT_TARGET) + && (ctx->region_type & ORT_ACC) == 0 + && TYPE_ATOMIC (strip_array_types + (TREE_TYPE (OMP_CLAUSE_DECL (c))))) + { + error_at (OMP_CLAUSE_LOCATION (c), + "%<_Atomic%> %qD in % clause on " + "% construct", OMP_CLAUSE_DECL (c)); + remove = true; + break; + } + /* FALLTHRU */ case OMP_CLAUSE_PRIVATE: case OMP_CLAUSE_SHARED: - case OMP_CLAUSE_FIRSTPRIVATE: case OMP_CLAUSE_LINEAR: decl = OMP_CLAUSE_DECL (c); n = splay_tree_lookup (ctx->variables, (splay_tree_key) decl); -- cgit v1.2.1 From 3bb45f768ac518fea4baca349f976a2f30503478 Mon Sep 17 00:00:00 2001 From: vries Date: Sat, 10 Sep 2016 14:38:56 +0000 Subject: Make canonical_va_list_type more strict 2016-09-10 Tom de Vries PR C/71602 * builtins.c (std_canonical_va_list_type): Strictly return non-null for va_list type only. * config/i386/i386.c (ix86_canonical_va_list_type): Same. * gimplify.c (gimplify_va_arg_expr): Handle &va_list. * c-common.c (build_va_arg): Handle more strict targetm.canonical_va_list_type. Replace first argument type error with assert. * c-c++-common/va-arg-va-list-type.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240072 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/gimplify.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/gimplify.c') diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 2f0dd88ebd6..e378ed0d1cb 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -11990,6 +11990,11 @@ gimplify_va_arg_expr (tree *expr_p, gimple_seq *pre_p, if (have_va_type == error_mark_node) return GS_ERROR; have_va_type = targetm.canonical_va_list_type (have_va_type); + if (have_va_type == NULL_TREE + && TREE_CODE (valist) == ADDR_EXPR) + /* Handle 'Case 1: Not an array type' from c-common.c/build_va_arg. */ + have_va_type + = targetm.canonical_va_list_type (TREE_TYPE (TREE_TYPE (valist))); gcc_assert (have_va_type != NULL_TREE); /* Generate a diagnostic for requesting data of a type that cannot -- cgit v1.2.1