Marek Polacek [Fri, 20 Dec 2019 23:30:04 +0000 (23:30 +0000)]
PR c++/92745 - bogus error when initializing array of vectors.
In r268428 I changed reshape_init_r in such a way that when it sees
a nested { } in a CONSTRUCTOR with missing braces, it just returns
the initializer:
+ else if (COMPOUND_LITERAL_P (stripped_init)
...
+ ++d->cur;
+ gcc_assert (!BRACE_ENCLOSED_INITIALIZER_P (stripped_init));
+ return init;
But as this test shows, that's incorrect: if TYPE is an array, we need
to proceed to reshape_init_array_1 which will iterate over the array
initializers:
6006 /* Loop until there are no more initializers. */
6007 for (index = 0;
6008 d->cur != d->end && (!sized_array_p || index <= max_index_cst);
6009 ++index)
6010 {
and update d.cur accordingly. In other words, when reshape_init gets
we recurse on the first element:
{col[0][0], col[1][0], col[2][0], col[3][0]}
and we can't just move d.cur to point to
{col[0][1], col[1][1], col[2][1], col[3][1]}
and return; we need to iterate, so that d.cur ends up being properly
updated, and after all initializers have been seen, points to d.end.
Currently we skip the loop, wherefore we hit this:
6502 /* Make sure all the element of the constructor were used. Otherwise,
6503 issue an error about exceeding initializers. */
6504 if (d.cur != d.end)
6505 {
6506 if (complain & tf_error)
6507 error ("too many initializers for %qT", type);
6508 return error_mark_node;
6509 }
* decl.c (reshape_init_r): For a nested compound literal, do
call reshape_init_{class,array,vector}.
Marek Polacek [Fri, 20 Dec 2019 23:25:44 +0000 (23:25 +0000)]
PR c++/92974 - bogus location for enum and non-enum in ?: warning.
build_min_non_dep wasn't setting any location so when we were emitting the
warning in the following test while instantiating a template, its location
was UNKNOWN_LOCATION. Rather than adding a location_t parameter, let's use
the location from the original expression.
* tree.c (build_min_non_dep): Use the location of NON_DEP when
building the expression.
Michael Meissner [Fri, 20 Dec 2019 19:27:47 +0000 (19:27 +0000)]
Rename signed integer 16/34-bit macros.
2019-12-20 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/predicates.md (cint34_operand): Use
SIGNED_INTEGER_34BIT_P macro.
* config/rs6000/rs6000.c (num_insns_constant_gpr): Use the
SIGNED_INTEGER_16BIT_P and SIGNED_INTEGER_34BIT_P macros.
(address_to_insn_form): Use the SIGNED_INTEGER_16BIT_P and
SIGNED_INTEGER_34BIT_P macros.
* config/rs6000/rs6000.h (SIGNED_INTEGER_NBIT_P): New macro.
(SIGNED_INTEGER_16BIT_P): Rename SIGNED_16BIT_OFFSET_P to be
SIGNED_INTEGER_34BIT_P.
(SIGNED_INTEGER_34BIT_P): Rename SIGNED_34BIT_OFFSET_P to be
SIGNED_INTEGER_34BIT_P.
Jonathan Wakely [Fri, 20 Dec 2019 17:10:18 +0000 (17:10 +0000)]
libstdc++: Add inline to maybe-constexpr functions (PR 92927)
Originally these functions were always inline. I changed them in r277342
to be always constexpr, then in r277588 changed them to be constexpr for
C++14, but I didn't restore the 'inline' for C++11. That leads to linker
errors when libstdc++.so is built unoptimized, because those functions
don't get instantiated in src/c++11/string-inst.o
Julian Brown [Fri, 20 Dec 2019 01:39:49 +0000 (01:39 +0000)]
Fortran polymorphic class-type support for OpenACC
gcc/fortran/
* openmp.c (resolve_oacc_data_clauses): Don't disallow allocatable
polymorphic types for OpenACC.
* trans-openmp.c (gfc_trans_omp_clauses): Support polymorphic class
types.
libgomp/
* testsuite/libgomp.oacc-fortran/class-ptr-param.f95: New test.
* testsuite/libgomp.oacc-fortran/classtypes-1.f95: New test.
* testsuite/libgomp.oacc-fortran/classtypes-2.f95: New test.
Julian Brown [Fri, 20 Dec 2019 01:39:46 +0000 (01:39 +0000)]
OpenACC 2.6 deep copy: Fortran execution tests
libgomp/
* testsuite/libgomp.oacc-fortran/deep-copy-1.f90: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-2.f90: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-3.f90: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-4.f90: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-5.f90: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-6.f90: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-7.f90: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-8.f90: New test.
* testsuite/libgomp.oacc-fortran/derived-type-1.f90: New test.
* testsuite/libgomp.oacc-fortran/derivedtype-1.f95: New test.
* testsuite/libgomp.oacc-fortran/derivedtype-2.f95: New test.
* testsuite/libgomp.oacc-fortran/multidim-slice.f95: New test.
* testsuite/libgomp.oacc-fortran/update-2.f90: New test.
Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>
From-SVN: r279630
Julian Brown [Fri, 20 Dec 2019 01:39:42 +0000 (01:39 +0000)]
OpenACC 2.6 deep copy: C and C++ execution tests
libgomp/
* testsuite/libgomp.oacc-c-c++-common/deep-copy-1.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-2.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-4.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-6.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-7.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-8.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-9.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-10.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-11.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-14.c: New test.
* testsuite/libgomp.oacc-c++/deep-copy-12.C: New test.
* testsuite/libgomp.oacc-c++/deep-copy-13.C: New test.
Julian Brown [Fri, 20 Dec 2019 01:20:38 +0000 (01:20 +0000)]
OpenACC 2.6 deep copy: C and C++ front-end parts
gcc/c-family/
* c-common.h (c_omp_map_clause_name): Add prototype.
* c-omp.c (c_omp_map_clause_name): New function.
* c-pragma.h (pragma_omp_clause): Add PRAGMA_OACC_CLAUSE_ATTACH and
PRAGMA_OACC_CLAUSE_DETACH.
gcc/c/
* c-parser.c (c_parser_omp_clause_name): Add parsing of attach and
detach clauses.
(c_parser_omp_variable_list): Add ALLOW_DEREF optional parameter.
Allow deref (->) in variable lists if true.
(c_parser_omp_var_list_parens): Add ALLOW_DEREF optional parameter.
Pass to c_parser_omp_variable_list.
(c_parser_oacc_data_clause): Support attach and detach clauses. Update
call to c_parser_omp_variable_list.
(c_parser_oacc_all_clauses): Support attach and detach clauses.
(OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK,
OACC_KERNELS_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK,
OACC_SERIAL_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_ATTACH.
(OACC_EXIT_DATA_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_DETACH.
* c-typeck.c (handle_omp_array_sections_1): Reject subarrays for attach
and detach. Support deref.
(handle_omp_array_sections): Use GOMP_MAP_ATTACH_DETACH instead of
GOMP_MAP_ALWAYS_POINTER for OpenACC.
(c_oacc_check_attachments): New function.
(c_finish_omp_clauses): Check attach/detach arguments for being
pointers using above. Support deref.
gcc/cp/
* parser.c (cp_parser_omp_clause_name): Support attach and detach
clauses.
(cp_parser_omp_var_list_no_open): Add ALLOW_DEREF optional parameter.
Parse deref if true.
(cp_parser_omp_var_list): Add ALLOW_DEREF optional parameter. Pass to
cp_parser_omp_var_list_no_open.
(cp_parser_oacc_data_clause): Support attach and detach clauses.
Update call to cp_parser_omp_var_list_no_open.
(cp_parser_oacc_all_clauses): Support attach and detach.
(OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK,
OACC_KERNELS_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK,
OACC_SERIAL_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_ATTACH.
(OACC_EXIT_DATA_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_DETACH.
* semantics.c (handle_omp_array_sections_1): Reject subarrays for
attach and detach.
(handle_omp_array_sections): Use GOMP_MAP_ATTACH_DETACH instead of
GOMP_MAP_ALWAYS_POINTER for OpenACC.
(cp_oacc_check_attachments): New function.
(finish_omp_clauses): Use above function. Allow structure fields and
class members to appear in OpenACC data clauses. Support
GOMP_MAP_ATTACH_DETACH. Support deref.
gcc/testsuite/
* c-c++-common/goacc/deep-copy-arrayofstruct.c: New test.
* c-c++-common/goacc/mdc-1.c: New test.
* c-c++-common/goacc/mdc-2.c: New test.
* gcc.dg/goacc/mdc.C: New test.
Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>
From-SVN: r279627
Julian Brown [Fri, 20 Dec 2019 01:20:33 +0000 (01:20 +0000)]
OpenACC 2.6 deep copy: middle-end parts
gcc/
* gimplify.c (gimplify_omp_var_data): Add GOVD_MAP_HAS_ATTACHMENTS.
(insert_struct_comp_map): Support derived-type member mappings
for arrays with descriptors which use GOMP_MAP_TO_PSET. Support
GOMP_MAP_ATTACH_DETACH.
(gimplify_scan_omp_clauses): Tidy up OACC_ENTER_DATA/OACC_EXIT_DATA
mappings. Handle attach/detach clauses and component references.
(gimplify_adjust_omp_clauses_1): Skip adjustments for explicit
attach/detach clauses.
(gimplify_omp_target_update): Handle struct mappings and finalize for
detach operations.
* omp-low.c (lower_omp_target): Support GOMP_MAP_ATTACH,
GOMP_MAP_DETACH, GOMP_MAP_FORCE_DETACH.
* tree-pretty-print.c (dump_omp_clause): Likewise, plus
GOMP_MAP_ATTACH_DETACH.
libgomp/
* libgomp.h (struct target_var_desc): Add do_detach flag.
* oacc-init.c (acc_shutdown_1): Free aux block if present.
* oacc-mem.c (find_group_last): Add SIZES parameter. Support
struct components. Tidy up and add some new checks.
(goacc_enter_data_internal): Update call to find_group_last.
(goacc_exit_data_internal): Support detach operations and
GOMP_MAP_STRUCT.
(GOACC_enter_exit_data): Handle initial GOMP_MAP_STRUCT or
GOMP_MAP_FORCE_PRESENT in finalization detection code. Handle
attach/detach in enter/exit data detection code.
* target.c (gomp_map_vars_existing): Initialise do_detach field of
tgt_var_desc.
(gomp_map_vars_internal): Support attach.
(gomp_unmap_vars_internal): Support detach.
Julian Brown [Fri, 20 Dec 2019 01:20:13 +0000 (01:20 +0000)]
Use aux struct in libgomp for infrequently-used/API-specific data
libgomp/
* libgomp.h (struct splay_tree_aux): New.
(struct splay_tree_key_s): Replace link_key field with aux pointer.
* target.c (gomp_map_vars_internal): Adjust for link_key being moved
to aux struct.
(gomp_remove_var_internal): Free aux block if present.
(gomp_load_image_to_device): Zero-initialise aux field instead of
link_key field.
(omp_target_associate_pointer): Zero-initialise aux field.
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
From-SVN: r279620
Andrew Stubbs [Thu, 19 Dec 2019 16:14:50 +0000 (16:14 +0000)]
Use V64SI for all amdgcn add-with-carry insns
2019-12-19 Andrew Stubbs <ams@codesourcery.com>
gcc/
* config/gcn/gcn-valu.md (*plus_carry_dpp_shr_<mode>): Rename to ...
(*plus_carry_dpp_shr_v64si): ... this, and replace all
VEC_1REG_INT_MODE with V64SI.
Mark Eggleston [Thu, 19 Dec 2019 15:13:25 +0000 (15:13 +0000)]
Prevent conversion of character data in array constructors.
Fix for PR fortran/92896 [10 Regression] [DEC] ICE in reduce_unary, at
fortran/arith.c:1283.
This was caused by an unintended side affect of "Allow CHARACTER literals
in assignments and data statements" (revision 277975). If the conversion
occurs in a array constructor it is rejected.
David Malcolm [Thu, 19 Dec 2019 14:59:14 +0000 (14:59 +0000)]
gimple const-correctness fixes
This patch converts various "gimple *" to "const gimple *" and similar
fixes for gimple subclasses, adding is_a_helper for gimple subclasses
to support the const form of as_a, and adding a few "const" overloads
of accessors.
This is enough to make pp_gimple_stmt_1's stmt const.
[AArch64] Fix handling of npatterns>1 constants for partial SVE modes
For partial SVE vectors of element X, we want to treat duplicates
of single X elements in the same way as for full vectors of X.
But if a constant instead contains a repeating pattern of X elements,
the transition from one value to the next must happen at container
boundaries rather than element boundaries. E.g. a VNx4HI should
in that case contain the same number of constants as a VNx4SI.
Fixing this means that we need a reinterpret from the container-based
mode to the partial mode; e.g. in the above example we need a
reinterpret from VNx4SI to VNx4HI. We can't use subregs for that
because they're forbidden by aarch64_can_change_class_mode; we should
handle them in the same way as for big-endian instead.
2019-12-19 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* config/aarch64/aarch64.c (aarch64_simd_valid_immediate): When
handling partial SVE vectors, use the container mode rather than
the element mode if the constant isn't a single-element duplicate.
* config/aarch64/aarch64-sve.md (@aarch64_sve_reinterpret<mode>):
Check targetm.can_change_mode_class instead of BYTES_BIG_ENDIAN.
gcc/testsuite/
* gcc.target/aarch64/sve/mixed_size_9.c: New test.
Jason Merrill [Thu, 19 Dec 2019 14:07:22 +0000 (09:07 -0500)]
PR c++/52320 - EH cleanups for partially constructed arrays.
This testcase wasn't fixed by the 66139 patch; split_nonconstant_init_1 was
failing to add a cleanup for an array member of a class (e.g. e1) that will
run if initializing a later member (e.g. e2) throws.
* typeck2.c (split_nonconstant_init_1): Add nested parm.
Add cleanup for whole array if true.
Jason Merrill [Thu, 19 Dec 2019 14:06:45 +0000 (09:06 -0500)]
PR c++/66139 - EH cleanups for partially constructed aggregates.
There were several overlapping PRs about failure to clean up fully
constructed subobjects when an exception is thrown during aggregate
initialization of a temporary. I fixed this for non-temporaries in the
context of 57510, but that fix didn't handle temporaries. So this patch
does split_nonconstant_init at gimplification time, which is much smaller
than alternatives I tried.
Andrew Stubbs [Thu, 19 Dec 2019 13:59:05 +0000 (13:59 +0000)]
Implement sub-dword add/sub on amdgcn
2019-12-19 Andrew Stubbs <ams@codesourcery.com>
gcc/
* config/gcn/gcn-valu.md (addv64si3<exec_clobber>): Rename to ...
(add<mode>3<exec_clobber>): ... this, and use VEC_ALL1REG_INT_MODE.
(addv64si3_dup<exec_clobber>): Rename to ...
(add<mode>3_dup<exec_clobber>): ... this, and use VEC_ALL1REG_INT_MODE.
(subv64si3<exec_clobber>): Rename to ...
(sub<mode>3<exec_clobber>): ... this, and use VEC_ALL1REG_INT_MODE.
[AArch64] Reject invalid subregs involving partial SVE modes
When adding partial SVE modes, I'd remembered to handle reloads
in a similar way to full big-endian SVE vectors, but forgot the
just-as-important mode-change rules.
2019-12-19 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* config/aarch64/aarch64.c (aarch64_can_change_mode_class):
Don't allow changes between partial SVE modes and other kinds
of mode. Don't allow changes between two partial SVE modes
if they have different container or element sizes.
gcc/testsuite/
* gcc.target/aarch64/sve/mixed_size_8.c: New test.
[AArch64] Handle arguments and return types with partial SVE modes
Partial SVE modes can be picked up and used by the vector_size(N)
attribute.[*] This means that we need to cope with arguments and return
values with partial SVE modes, which previously triggered asserts like:
/* Generic vectors that map to SVE modes with -msve-vector-bits=N are
passed by reference, not by value. */
gcc_assert (!aarch64_sve_mode_p (mode));
The ABI for these types is fixed from pre-SVE days, and must in any case
be the same for all -msve-vector-bits=N values. All we need to do is
ensure that the vectors are passed and returned in the traditional way.
[*] Advanced SIMD always wins for 64-bit and 128-bit vectors though.
2019-12-19 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* config/aarch64/aarch64.c (aarch64_function_value_1): New function,
split out from...
(aarch64_function_value): ...here. Handle partial SVE modes by
pretending that they have the associated/traditional integer mode,
then wrap the result in the real mode.
(aarch64_layout_arg): Take an orig_mode argument and pass it to
aarch64_function_arg_alignment. Handle partial SVE modes analogously
to aarch64_function_value.
(aarch64_function_arg): Update call accordingly.
(aarch64_function_arg_advance): Likewise.
gcc/testsuite/
* gcc.target/aarch64/sve/pcs/gnu_vectors_3.c: New test.
Don't mangle attributes that have a space in their name
The SVE port needs to maintain a different type identity for
GNU vectors and "SVE vectors" even during LTO, since the types
use different ABIs. The easiest way of doing that seemed to be
to use type attributes. However, these type attributes shouldn't
be user-facing; they're just a convenient way of representing the
types internally in GCC.
There are already several internal-only attributes, such as "fn spec"
and "omp declare simd". They're distinguished from normal user-facing
attributes by having a space in their name, which means that it isn't
possible to write them directly in C or C++.
Taking the same approach mostly works well for SVE. The only snag
I've hit so far is that the new attribute needs to (and only exists to)
affect type identity. This means that it would normally get included
in mangled names, to distinguish it from types without the attribute.
However, the SVE ABI specifies a separate mangling for SVE vector types,
rather than using an attribute mangling + a normal vector mangling.
So we need some way of suppressing the attribute mangling for this case.
There are currently no other target-independent or target-specific
internal-only attributes that affect type identity, so this patch goes
for the simplest fix of skipping mangling for attributes whose names
contain a space. Other options I thought about were:
(1) Also make sure that targetm.mangled_type returns nonnull.
(2) Check directly for the target-specific name.
(3) Add a new target hook.
(4) Add new information to attribute_spec. This would be very invasive
at this stage, but maybe we should consider replacing all the boolean
fields with flags? That should make the tables slightly easier to
read and would make adding new flags much simpler in future.
2019-12-19 Richard Sandiford <richard.sandiford@arm.com>
gcc/cp/
* mangle.c (write_CV_qualifiers_for_type): Don't mangle attributes
that contain a space.
Jan Hubicka [Thu, 19 Dec 2019 10:03:48 +0000 (11:03 +0100)]
Fix symver attribute with LTO
* cgraph.c (cgraph_node_cannot_be_local_p_1): Prevent targets of
symver attributes to be localized.
* ipa-visibility.c (cgraph_externally_visible_p,
varpool_node::externally_visible_p): Likewise.
* symtab.c (symtab_node::verify_base): Check visibility of symbol
versions.
* lto-common.c (read_cgraph_and_symbols): Work around binutils
PR25424
Co-Authored-By: Xi Ruoyao <xry111@mengyan1223.wang>
From-SVN: r279566
Feng Xue [Thu, 19 Dec 2019 02:54:40 +0000 (02:54 +0000)]
Handle aggregate pass-through for self-recursive call (PR ipa/92794)
2019-12-19 Feng Xue <fxue@os.amperecomputing.com>
PR ipa/92794
* ipa-cp.c (self_recursive_agg_pass_through_p): New function.
(intersect_with_plats): Use error_mark_node as place holder
when aggregate jump function is simple pass-through for
self-recursive call.
(intersect_with_agg_replacements): Likewise.
(intersect_aggregates_with_edge): Likewise.
(find_aggregate_values_for_callers_subset): Likewise.
Jason Merrill [Thu, 19 Dec 2019 00:10:47 +0000 (19:10 -0500)]
PR c++/91165 follow-on tweak
I talked in the PR about possibly stripping the location from the args in
the hash table, since if we use the cache the locations would be wrong, but
didn't actually do anything about that. Then I noticed that there's already
unshare_expr_without_location...
* constexpr.c (cxx_eval_call_expression): Use
unshare_expr_without_location.
David Malcolm [Wed, 18 Dec 2019 23:58:49 +0000 (23:58 +0000)]
Add diagnostic_metadata and CWE support
This patch adds support for associating a diagnostic message with an
optional diagnostic_metadata object, so that plugins can add extra data
to their diagnostics (e.g. mapping a diagnostic to a taxonomy or coding
standard such as from CERT or MISRA).
Currently this only supports associating a CWE identifier with a
diagnostic (which is what I'm using for the warnings in the analyzer
patch kit), but adding a diagnostic_metadata class allows for future
growth in this area without an explosion of further "warning_at"
overloads for all of the different kinds of custom data that a plugin
might want to add.
This version of the patch renames the overly-general
-fdiagnostics-show-metadata to -fdiagnostics-show-cwe and adds test
coverage for it via a plugin.
It also adds a note to the documentation that no GCC diagnostics
currently use this; it's a feature for plugins (and, at some point,
I hope, the analyzer).
gcc/ChangeLog:
* common.opt (fdiagnostics-show-cwe): Add.
* diagnostic-core.h (class diagnostic_metadata): New forward decl.
(warning_at): Add overload taking a const diagnostic_metadata &.
(emit_diagnostic_valist): Add overload taking a
const diagnostic_metadata *.
* diagnostic-format-json.cc: Include "diagnostic-metadata.h".
(json_from_metadata): New function.
(json_end_diagnostic): Call it to add "metadata" child for
diagnostics with metadata.
(diagnostic_output_format_init): Clear context->show_cwe.
* diagnostic-metadata.h: New file.
* diagnostic.c: Include "diagnostic-metadata.h".
(diagnostic_impl): Add const diagnostic_metadata * param.
(diagnostic_n_impl): Likewise.
(diagnostic_initialize): Initialize context->show_cwe.
(diagnostic_set_info_translated): Initialize diagnostic->metadata.
(get_cwe_url): New function.
(print_any_cwe): New function.
(diagnostic_report_diagnostic): Call print_any_cwe if the
diagnostic has non-NULL metadata.
(emit_diagnostic): Pass NULL as the metadata in the call to
diagnostic_impl.
(emit_diagnostic_valist): Likewise.
(emit_diagnostic_valist): New overload taking a
const diagnostic_metadata *.
(inform): Pass NULL as the metadata in the call to
diagnostic_impl.
(inform_n): Likewise for diagnostic_n_impl.
(warning): Likewise.
(warning_at): Likewise. Add overload that takes a
const diagnostic_metadata &.
(warning_n): Pass NULL as the metadata in the call to
diagnostic_n_impl.
(pedwarn): Likewise for diagnostic_impl.
(permerror): Likewise.
(error): Likewise.
(error_n): Likewise.
(error_at): Likewise.
(sorry): Likewise.
(sorry_at): Likewise.
(fatal_error): Likewise.
(internal_error): Likewise.
(internal_error_no_backtrace): Likewise.
* diagnostic.h (diagnostic_info::metadata): New field.
(diagnostic_context::show_cwe): New field.
* doc/invoke.texi (-fno-diagnostics-show-cwe): New option.
* opts.c (common_handle_option): Handle OPT_fdiagnostics_show_cwe.
* toplev.c (general_init): Initialize global_dc->show_cwe.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic-test-metadata.c: New test.
* gcc.dg/plugin/diagnostic_plugin_test_metadata.c: New test plugin.
* gcc.dg/plugin/plugin.exp (plugin_test_list): Add them.
Jakub Jelinek [Wed, 18 Dec 2019 23:27:28 +0000 (00:27 +0100)]
re PR middle-end/86416 ([OpenMP] Offloading - better lto1 error message if mode not supported on offloading target)
PR middle-end/86416
* testsuite/libgomp.c/pr86416-1.c (main): Use L suffixes rather than
q or none.
* testsuite/libgomp.c/pr86416-2.c (main): Use Q suffixes rather than
L or none.
Julian Brown [Wed, 18 Dec 2019 23:10:08 +0000 (23:10 +0000)]
Add OpenACC 2.6's no_create
The clause makes any device code use the local memory address for each
of the variables specified unless the given variable is already present
on the current device.
2019-12-19 Julian Brown <julian@codesourcery.com>
Maciej W. Rozycki <macro@codesourcery.com>
Tobias Burnus <tobias@codesourcery.com>
Thomas Schwinge <thomas@codesourcery.com>
gcc/
* omp-low.c (lower_omp_target): Support GOMP_MAP_NO_ALLOC.
* tree-pretty-print.c (dump_omp_clause): Likewise.
include/
* gomp-constants.h (gomp_map_kind): Support GOMP_MAP_NO_ALLOC.
libgomp/
* target.c (gomp_map_vars_async): Support GOMP_MAP_NO_ALLOC.
* testsuite/libgomp.oacc-c-c++-common/no_create-1.c: New test.
* testsuite/libgomp.oacc-c-c++-common/no_create-2.c: New test.
* testsuite/libgomp.oacc-c-c++-common/no_create-3.c: New test.
* testsuite/libgomp.oacc-c-c++-common/no_create-4.c: New test.
* testsuite/libgomp.oacc-c-c++-common/no_create-5.c: New test.
* testsuite/libgomp.oacc-fortran/no_create-1.f90: New test.
* testsuite/libgomp.oacc-fortran/no_create-2.f90: New test.
* testsuite/libgomp.oacc-fortran/no_create-3.F90: New test.
Reviewed-by: Thomas Schwinge <thomas@codesourcery.com> Co-Authored-By: Maciej W. Rozycki <macro@codesourcery.com> Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com> Co-Authored-By: Tobias Burnus <tobias@codesourcery.com>
From-SVN: r279551
Thomas Schwinge [Wed, 18 Dec 2019 17:02:37 +0000 (18:02 +0100)]
[OpenACC] Refactor 'goacc_enter_data' so that it can be called from 'goacc_insert_pointer', "present" case, and simplify
No functional changes.
libgomp/
* oacc-mem.c (goacc_enter_data): Refactor, so that it can be
called...
(goacc_insert_pointer): ... from here, "present" case.
(goacc_insert_pointer): Inline function into...
(GOACC_enter_exit_data): ... here, and simplify.
Thomas Schwinge [Wed, 18 Dec 2019 17:01:11 +0000 (18:01 +0100)]
[PR92726, PR92970, PR92984] [OpenACC] Clarify 'acc_delete' etc. for 'NULL'-in, non-present data, or size zero
PR92970 "OpenACC 2.5: 'acc_delete' etc. on non-present data is a no-op" is an
actual bug fix, and the other ones are fall-out, currently undefined behavior.
libgomp/
PR libgomp/92726
PR libgomp/92970
PR libgomp/92984
* oacc-mem.c (delete_copyout): No-op behavior if 'lookup_host'
fails.
(GOACC_enter_exit_data): Simplify accordingly.
* testsuite/libgomp.oacc-c-c++-common/pr92970-1.c: New file,
subsuming...
* testsuite/libgomp.oacc-c-c++-common/lib-17.c: ... this file...
* testsuite/libgomp.oacc-c-c++-common/lib-18.c: ..., and this
file.
* testsuite/libgomp.oacc-c-c++-common/pr92984-1.c: New file,
subsuming...
* testsuite/libgomp.oacc-c-c++-common/lib-21.c: ... this file...
* testsuite/libgomp.oacc-c-c++-common/lib-29.c: ..., and this
file.
* testsuite/libgomp.oacc-c-c++-common/pr92726-1.c: New file,
subsuming...
* testsuite/libgomp.oacc-c-c++-common/lib-28.c: ... this file.
Wilco Dijkstra [Wed, 18 Dec 2019 16:11:52 +0000 (16:11 +0000)]
[AArch64] Fixup core tunings
Several tuning settings in cores.def are not consistent.
Set the tuning for Cortex-A76AE and Cortex-A77 to neoversen1 so
it is the same as for Cortex-A76 and Neoverse N1.
Set the tuning for Neoverse E1 to cortexa73 so it's the same as for
Cortex-A65. Set the scheduler for Cortex-A65 and Cortex-A65AE to
cortexa53.
gcc/
* config/aarch64/aarch64-cores.def:
("cortex-a76ae"): Use neoversen1 tuning.
("cortex-a77"): Likewise.
("cortex-a65"): Use cortexa53 scheduler.
("cortex-a65ae"): Likewise.
("neoverse-e1"): Use cortexa73 tuning.
Jason Merrill [Wed, 18 Dec 2019 12:44:34 +0000 (07:44 -0500)]
PR c++/12333 - X::~X() with implicit this->.
this->X::~X() is handled by finish_class_member_access_expr and its
lookup_destructor subroutine; let's use it in cp_parser_lookup_name for the
case where this-> is implicit.
I tried replacing the other destructor code here with just the call to
lookup_destructor, but that regressed handling of naming the destructor
outside a non-static member function.
* parser.c (cp_parser_lookup_name): Use lookup_destructor.
* typeck.c (lookup_destructor): No longer static.
Eric Botcazou [Wed, 18 Dec 2019 09:51:14 +0000 (09:51 +0000)]
trans.c (Pragma_to_gnu): Push a diagnostics state for pragma Warnings (Off) before turning off all the...
* gcc-interface/trans.c (Pragma_to_gnu) <Pragma_Warnings>: Push a
diagnostics state for pragma Warnings (Off) before turning off all
the warnings and only pop it for pragma Warnings (On).
Justin Squirek [Wed, 18 Dec 2019 07:16:22 +0000 (07:16 +0000)]
[Ada] Missing accessibility check on access discriminants
2019-12-18 Justin Squirek <squirek@adacore.com>
gcc/ada/
* sem_ch6.adb (Analyze_Function_Return): Modify handling of
extended return statements to check accessibility of access
discriminants.
(Check_Aggregate_Accessibility): Removed.
(Check_Return_Obj_Accessibility): Added to centralize checking
of return aggregates and subtype indications in the case of an
extended return statement.
Arnaud Charlet [Wed, 18 Dec 2019 07:15:52 +0000 (07:15 +0000)]
[Ada] Simplify Big_Integer and Big_Real interface
2019-12-18 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* libgnat/a-nbnbin.ads, libgnat/a-nbnbin.adb,
libgnat/a-nbnbre.ads, libgnat/a-nbnbre.adb: Replace
Optional_Big_* types by a simple check and exception raise in
Get_Bignum.
(Set_Bignum): Arg should be 'out' and not 'in out'.
(Invalid_Big_Integer, No_Big_Real): Removed.
(Is_Valid): Now convention Intrinsic.
Gary Dismukes [Wed, 18 Dec 2019 07:14:59 +0000 (07:14 +0000)]
[Ada] Missing accessibility actuals on calls to interface conversion functions
2019-12-18 Gary Dismukes <dismukes@adacore.com>
gcc/ada/
* sem_res.adb (Resolve_Type_Conversion): Add handling for access
types with designated operand and target types that are
referenced in places that have a limited view of an interface
type by retrieving the nonlimited view when it exists. Add ???
comments related to missing limited_with_clause handling for
Target (in the non-access case).
Ed Schonberg [Wed, 18 Dec 2019 07:14:54 +0000 (07:14 +0000)]
[Ada] AI12-0282: shared variable control aspects on formal types
2019-12-18 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada_2020
the keyword WITH can indicate the start of aspect specifications
and not a private type extension.
* sem_ch12.adb (Analyze_Formal_Type): Indicate that it is a
first subtype.
(Instantiate_Type): New procedure
Check_Shared_Variable_Control_Aspects to verify matching rules
between formal and actual types. Note that an array type with
aspect Atomic_Components is considered compatible with an array
type whose component type is Atomic, even though the array types
do not carry the same aspect.
* sem_ch13.adb (Analyze_One_Aspect): Allow shared variable
control aspects to appear on formal types.
(Rep_Item_Too_Early): Exclude aspects on formal types.
* sem_prag.adb (Mark_Type): Handle properly pragmas that come
from aspects on formal types.
(Analyze_Pragma, case Atomic_Components): Handle formal types.