aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2022-05-31Correct spelling of DW_AT_namelist_itemAlan Modra1-1/+1
include/ * dwarf2.def: Correct spelling of DW_AT_namelist_item. gcc/ * dwarf2out.cc (gen_namelist_decl): Adjust to suit correct spelling of DW_AT_namelist_item.
2022-05-25Daily bump.GCC Administrator1-0/+4
2022-05-24libiberty: remove FINAL and OVERRIDE from ansidecl.hDavid Malcolm1-41/+0
libiberty's ansidecl.h provides macros FINAL and OVERRIDE to allow virtual functions to be labelled with the C++11 "final" and "override" specifiers, but with empty implementations on pre-C++11 C++ compilers. We've used the macros in many places in GCC, but as of as of GCC 11 onwards GCC has required a C++11 compiler, such as GCC 4.8 or later. On the assumption that any such compiler correctly implements "final" and "override", I've simplified GCC's codebase by replacing all uses of the FINAL and OVERRIDE macros in GCC's source tree with the lower-case specifiers (via commits r13-690-gff171cb13df671 and r13-716-g8473ef7be60443) The macros are reportedly not used anywhere in binutils-gdb. This patch completes this transition for GCC by eliminating the macros from ansidecl.h. include/ChangeLog: * ansidecl.h: Drop macros OVERRIDE and FINAL. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2022-05-24Daily bump.GCC Administrator1-0/+4
2022-05-23demangler: C++ modules supportNathan Sidwell1-1/+6
This adds demangling support for C++ modules. A new 'W' component along with augmented behaviour of 'S' components. include/ * demangle.h (enum demangle_component_type): Add module components. libiberty/ * cp-demangle.c (d_make_comp): Adjust. (d_name, d_prefix): Adjust subst handling. Add module handling. (d_maybe_module_name): New. (d_unqualified_name): Add incoming module parm. Handle it. Adjust all callers. (d_special_name): Add 'GI' support. (d_count_template_scopes): Adjust. (d_print_comp_inner): Print module. * testsuite/demangle-expected: New test cases
2022-05-19Daily bump.GCC Administrator1-0/+12
2022-05-18'include/cuda/cuda.h': Add parts necessary for nvptx-tools 'nvptx-run'Thomas Schwinge1-1/+10
include/ * cuda/cuda.h (enum CUjit_option): Add 'CU_JIT_GENERATE_DEBUG_INFO', 'CU_JIT_GENERATE_LINE_INFO'. (enum CUlimit): Add 'CU_LIMIT_STACK_SIZE', 'CU_LIMIT_MALLOC_HEAP_SIZE'. (cuCtxSetLimit, cuGetErrorName): Add.
2022-05-18'include/cuda/cuda.h': For C++, wrap in 'extern "C"'Thomas Schwinge1-0/+8
include/ * cuda/cuda.h: For C++, wrap in 'extern "C"'.
2022-05-18Daily bump.GCC Administrator1-0/+9
2022-05-17demangler: Structured BindingsNathan Sidwell1-1/+3
C++ Structured bindings have a mangling that has yet to be formally documented. However, it's been around for a while and shows up for module support. include/ * demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_STRUCTURED_BINDING. libiberty/ * cp-demangle.c (d_make_comp): Adjust. (d_unqualified_name): Add 'DC' support. (d_count_template_scopes): Adjust. (d_print_comp_inner): Add structured binding. * testsuite/demangle-expected: Add testcases.
2022-05-17openmp: Add support for inoutset depend-kindJakub Jelinek1-0/+1
This patch adds support for inoutset depend-kind in depend clauses. It is very similar to the in depend-kind in that a task with a dependency with that depend-kind is dependent on all previously created sibling tasks with matching address unless they have the same depend-kind. In the in depend-kind case everything is dependent except for in -> in dependency, for inoutset everything is dependent except for inoutset -> inoutset dependency. mutexinoutset is also similar (everything is dependent except for mutexinoutset -> mutexinoutset dependency), but there is also the additional restriction that only one task with mutexinoutset for each address can be scheduled at once (i.e. mutual exclusitivty). For now we support mutexinoutset the same as inout/out, but the inoutset support is full. In order not to bump the ABI for dependencies each time (we've bumped it already once, the old ABI supports only inout/out and in depend-kind, the new ABI supports inout/out, mutexinoutset, in and depobj), this patch arranges for inoutset to be at least for the time being always handled as if it was specified through depobj even when it is not. So it uses the new ABI for that and inoutset are represented like depobj - pointer to a pair of pointers where the first one will be the actual address of the object mentioned in depend clause and second pointer will be (void *) GOMP_DEPEND_INOUTSET. 2022-05-17 Jakub Jelinek <jakub@redhat.com> gcc/ * tree-core.h (enum omp_clause_depend_kind): Add OMP_CLAUSE_DEPEND_INOUTSET. * tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_DEPEND_INOUTSET. * gimplify.cc (gimplify_omp_depend): Likewise. * omp-low.cc (lower_depend_clauses): Likewise. gcc/c-family/ * c-omp.cc (c_finish_omp_depobj): Handle OMP_CLAUSE_DEPEND_INOUTSET. gcc/c/ * c-parser.cc (c_parser_omp_clause_depend): Parse inoutset depend-kind. (c_parser_omp_depobj): Likewise. gcc/cp/ * parser.cc (cp_parser_omp_clause_depend): Parse inoutset depend-kind. (cp_parser_omp_depobj): Likewise. * cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle OMP_CLAUSE_DEPEND_INOUTSET. gcc/testsuite/ * c-c++-common/gomp/all-memory-1.c (boo): Add test with inoutset depend-kind. * c-c++-common/gomp/all-memory-2.c (boo): Likewise. * c-c++-common/gomp/depobj-1.c (f1): Likewise. (f2): Adjusted expected diagnostics. * g++.dg/gomp/depobj-1.C (f4): Adjust expected diagnostics. include/ * gomp-constants.h (GOMP_DEPEND_INOUTSET): Define. libgomp/ * libgomp.h (struct gomp_task_depend_entry): Change is_in type from bool to unsigned char. * task.c (gomp_task_handle_depend): Handle GOMP_DEPEND_INOUTSET. Ignore dependencies where task->depend[i].is_in && task->depend[i].is_in == ent->is_in rather than just task->depend[i].is_in && ent->is_in. Remember whether GOMP_DEPEND_IN loop is needed and guard the loop with that conditional. (gomp_task_maybe_wait_for_dependencies): Handle GOMP_DEPEND_INOUTSET. Ignore dependencies where elem.is_in && elem.is_in == ent->is_in rather than just elem.is_in && ent->is_in. * testsuite/libgomp.c-c++-common/depend-1.c (test): Add task with inoutset depend-kind. * testsuite/libgomp.c-c++-common/depend-2.c (test): Likewise. * testsuite/libgomp.c-c++-common/depend-3.c (test): Likewise. * testsuite/libgomp.c-c++-common/depend-inoutset-1.c: New test.
2022-05-11Daily bump.GCC Administrator1-0/+12
2022-05-10Remove non-ANSI C macros in ansidecl.h.Martin Liska1-26/+2
include/ChangeLog: * ansidecl.h (PTR): Remove. (const): Likewise. (volatile): Likewise. (signed): Likewise.
2022-05-10libiberty: stop using PTR macroMartin Liska1-2/+2
include/ChangeLog: * hashtab.h (HTAB_EMPTY_ENTRY): Use void * instead PTR. (HTAB_DELETED_ENTRY): Likewise. libiberty/ChangeLog: * alloca.c (C_alloca): Use void * instead PTR. * calloc.c (malloc): Likewise. (bzero): Likewise. (calloc): Likewise. * hashtab.c (find_empty_slot_for_expand): Likewise. (eq_pointer): Likewise. (htab_create_alloc_ex): Likewise. (htab_create_typed_alloc): Likewise. (htab_set_functions_ex): Likewise. (htab_delete): Likewise. (htab_empty): Likewise. (htab_expand): Likewise. (htab_find_with_hash): Likewise. (htab_find): Likewise. (htab_find_slot_with_hash): Likewise. (htab_find_slot): Likewise. (htab_remove_elt): Likewise. (htab_remove_elt_with_hash): Likewise. (htab_clear_slot): Likewise. (htab_traverse_noresize): Likewise. (htab_traverse): Likewise. (htab_hash_string): Likewise. (iterative_hash): Likewise. (hash_pointer): Likewise. * memchr.c (memchr): Likewise. * memcmp.c (memcmp): Likewise. * memcpy.c (memcpy): Likewise. * memmove.c (memmove): Likewise. * mempcpy.c (memcpy): Likewise. (mempcpy): Likewise. * memset.c (memset): Likewise. * objalloc.c (malloc): Likewise. (free): Likewise. (objalloc_create): Likewise. (_objalloc_alloc): Likewise. (objalloc_free_block): Likewise. * random.c (PTR): Likewise. (void): Likewise. (initstate): Likewise. (setstate): Likewise. * regex.c: Likewise. * spaces.c (malloc): Likewise. (free): Likewise. * stpcpy.c (memcpy): Likewise. * strdup.c (malloc): Likewise. (memcpy): Likewise. * strerror.c (malloc): Likewise. (memset): Likewise. * strndup.c (malloc): Likewise. (memcpy): Likewise. * strsignal.c (malloc): Likewise. (memset): Likewise. * vasprintf.c (malloc): Likewise. * vprintf-support.c: Likewise. * xatexit.c (malloc): Likewise. * xmalloc.c (xmalloc): Likewise. (xcalloc): Likewise. (xrealloc): Likewise. * xmemdup.c (xmemdup): Likewise.
2022-05-10Daily bump.GCC Administrator1-0/+4
2022-05-09Remove non-ANSI C path in ansidecl.h.Martin Liska1-17/+0
include/ChangeLog: * ansidecl.h (PTR): Remove Not ANCI C part.
2022-05-05Daily bump.GCC Administrator1-0/+5
2022-05-04LTO plugin: modernize a bit.Martin Liska1-34/+34
include/ChangeLog: * plugin-api.h (enum ld_plugin_tag): Do not set implicit enum values. lto-plugin/ChangeLog: * lto-plugin.c (struct plugin_objfile): Use bool for offset field. (exec_lto_wrapper): Assign true/false to bool variables. (process_offload_section): Likewise. (claim_file_handler): Likewise. (onload): Likewise.
2022-04-07Daily bump.GCC Administrator1-0/+4
2022-04-06Move 'libgomp/plugin/cuda/cuda.h' to 'include/cuda/cuda.h'Thomas Schwinge1-0/+194
... so that it may be used by other projects that inherit GCC's 'include' directory. include/ * cuda/cuda.h: New file. libgomp/ * plugin/cuda/cuda.h: Remove file. * plugin/plugin-nvptx.c [PLUGIN_NVPTX_DYNAMIC]: Include "cuda/cuda.h" instead of <cuda.h>. * plugin/configfrag.ac <PLUGIN_NVPTX_DYNAMIC>: Don't set 'PLUGIN_NVPTX_CPPFLAGS'. * configure: Regenerate.
2022-03-20Daily bump.GCC Administrator1-0/+6
2022-03-19rename floatformat_ia64_quad_{big, little} to floatformat_ieee_quad_{big, ↵Tiezhu Yang1-3/+3
little} I submitted a GDB patch [1] to rename floatformats_ia64_quad to floatformats_ieee_quad to reflect the reality, and then we can clean up the related code. As GDB Global Maintainer Tom Tromey said [2]: These files are maintained in gcc and then imported into the binutils-gdb repository, so any changes to them will have to be proposed there first. this GCC patch is preparation for the GDB patch, no functionality change. [1] https://sourceware.org/pipermail/gdb-patches/2022-March/186452.html [2] https://sourceware.org/pipermail/gdb-patches/2022-March/186569.html Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> include/ * floatformat.h (floatformat_ieee_quad_big): Renamed from floatformat_ia64_quad_big. (floatformat_ieee_quad_little): Similarly. libiberty/ * floatformat.c (floatformat_ieee_quad_big): Renamed from floatformat_ia64_quad_big. (floatformat_ieee_quad_little): Similarly.
2022-01-03Update copyright years.Jakub Jelinek40-40/+40
2021-12-13Daily bump.GCC Administrator1-0/+4
2021-12-12Replace gnu::unique_ptr with std::unique_ptrJonathan Wakely1-405/+0
Now that GCC is compiled as C++11 there is no need to keep the C++03 implementation of gnu::unique_ptr. This removes the unique-ptr.h header and replaces it with <memory> in system.h, and changes the INCLUDE_UNIQUE_PTR macro to INCLUDE_MEMORY. Uses of gnu::unique_ptr and gnu::move can be replaced with std::unique_ptr and std::move. There are no uses of unique_xmalloc_ptr or xmalloc_deleter in GCC. gcc/analyzer/ChangeLog: * engine.cc: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR. gcc/c-family/ChangeLog: * known-headers.cc: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR. * name-hint.h: Likewise. (class name_hint): Use std::unique_ptr instead of gnu::unique_ptr. gcc/c/ChangeLog: * c-decl.c: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR. * c-parser.c: Likewise. gcc/cp/ChangeLog: * error.c: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR. * lex.c: Likewise. * name-lookup.c: Likewise. (class namespace_limit_reached): Use std::unique_ptr instead of gnu::unique_ptr. (suggest_alternatives_for): Use std::move instead of gnu::move. (suggest_alternatives_in_other_namespaces): Likewise. * parser.c: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR. gcc/ChangeLog: * Makefile.in: Remove unique-ptr-tests.o. * selftest-run-tests.c (selftest::run_tests): Remove unique_ptr_tests_cc_tests. * selftest.h (unique_ptr_tests_cc_tests): Remove. * system.h: Check INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR and include <memory> instead of "unique-ptr.h". * unique-ptr-tests.cc: Removed. include/ChangeLog: * unique-ptr.h: Removed.
2021-12-11Daily bump.GCC Administrator1-0/+4
2021-12-10amdgcn: Change offload variable table discoveryAndrew Stubbs1-1/+1
Up to now the libgomp GCN plugin has been finding the offload variables by using a symbol lookup, but the AMD runtime requires that the symbols are global for that to work. This was ensured by mkoffload as a post-procssing step, but the LLVM 13 assembler no longer accepts this in the case where the variable was previously declared differently. This patch switches to locating the symbols directly from the offload_var_table, which means that only one symbol needs to be forced global. This changes breaks the libgomp image compatibility so GOMP_VERSION_GCN has also been bumped. gcc/ChangeLog: * config/gcn/mkoffload.c (process_asm): Process the variable table completely differently. (process_obj): Encode the varaible data differently. include/ChangeLog: * gomp-constants.h (GOMP_VERSION_GCN): Bump. libgomp/ChangeLog: * plugin/plugin-gcn.c (struct gcn_image_desc): Remove global_variables. (GOMP_OFFLOAD_load_image): Locate the offload variables via the table, not individual symbols.
2021-12-09Daily bump.GCC Administrator1-0/+9
2021-12-08openmp: Improve OpenMP target support for C++ (PR92120)Chung-Lin Tang1-1/+13
This patch implements several C++ specific mapping capabilities introduced for OpenMP 5.0, including implicit mapping of this[:1] for non-static member functions, zero-length array section mapping of pointer-typed members, lambda captured variable access in target regions, and use of lambda objects inside target regions. Several adjustments to the C/C++ front-ends to allow more member-access syntax as valid is also included. PR middle-end/92120 gcc/cp/ChangeLog: * cp-tree.h (finish_omp_target): New declaration. (finish_omp_target_clauses): Likewise. * parser.c (cp_parser_omp_clause_map): Adjust call to cp_parser_omp_var_list_no_open to set 'allow_deref' argument to true. (cp_parser_omp_target): Factor out code, adjust into calls to new function finish_omp_target. * pt.c (tsubst_expr): Add call to finish_omp_target_clauses for OMP_TARGET case. * semantics.c (handle_omp_array_sections_1): Add handling to create 'this->member' from 'member' FIELD_DECL. Remove case of rejecting 'this' when not in declare simd. (handle_omp_array_sections): Likewise. (finish_omp_clauses): Likewise. Adjust to allow 'this[]' in OpenMP map clauses. Handle 'A->member' case in map clauses. Remove case of rejecting 'this' when not in declare simd. (struct omp_target_walk_data): New struct for walking over target-directive tree body. (finish_omp_target_clauses_r): New function for tree walk. (finish_omp_target_clauses): New function. (finish_omp_target): New function. gcc/c/ChangeLog: * c-parser.c (c_parser_omp_clause_map): Set 'allow_deref' argument in call to c_parser_omp_variable_list to 'true'. * c-typeck.c (handle_omp_array_sections_1): Add strip of MEM_REF in array base handling. (c_finish_omp_clauses): Handle 'A->member' case in map clauses. gcc/ChangeLog: * gimplify.c ("tree-hash-traits.h"): Add include. (gimplify_scan_omp_clauses): Change struct_map_to_clause to type hash_map<tree_operand, tree> *. Adjust struct map handling to handle cases of *A and A->B expressions. Under !DECL_P case of GOMP_CLAUSE_MAP handling, add STRIP_NOPS for indir_p case, add to struct_deref_set for map(*ptr_to_struct) cases. Add MEM_REF case when handling component_ref_p case. Add unshare_expr and gimplification when created GOMP_MAP_STRUCT is not a DECL. Add code to add firstprivate pointer for *pointer-to-struct case. (gimplify_adjust_omp_clauses): Move GOMP_MAP_STRUCT removal code for exit data directives code to earlier position. * omp-low.c (lower_omp_target): Handle GOMP_MAP_ATTACH_ZERO_LENGTH_ARRAY_SECTION, and GOMP_MAP_POINTER_TO_ZERO_LENGTH_ARRAY_SECTION map kinds. * tree-pretty-print.c (dump_omp_clause): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/gomp/target-3.c: New testcase. * g++.dg/gomp/target-3.C: New testcase. * g++.dg/gomp/target-lambda-1.C: New testcase. * g++.dg/gomp/target-lambda-2.C: New testcase. * g++.dg/gomp/target-this-1.C: New testcase. * g++.dg/gomp/target-this-2.C: New testcase. * g++.dg/gomp/target-this-3.C: New testcase. * g++.dg/gomp/target-this-4.C: New testcase. * g++.dg/gomp/target-this-5.C: New testcase. * g++.dg/gomp/this-2.C: Adjust testcase. include/ChangeLog: * gomp-constants.h (enum gomp_map_kind): Add GOMP_MAP_ATTACH_ZERO_LENGTH_ARRAY_SECTION, and GOMP_MAP_POINTER_TO_ZERO_LENGTH_ARRAY_SECTION map kinds. (GOMP_MAP_POINTER_P): Include GOMP_MAP_POINTER_TO_ZERO_LENGTH_ARRAY_SECTION. libgomp/ChangeLog: * libgomp.h (gomp_attach_pointer): Add bool parameter. * oacc-mem.c (acc_attach_async): Update call to gomp_attach_pointer. (goacc_enter_data_internal): Likewise. * target.c (gomp_map_vars_existing): Update assert condition to include GOMP_MAP_ATTACH_ZERO_LENGTH_ARRAY_SECTION. (gomp_map_pointer): Add 'bool allow_zero_length_array_sections' parameter, add support for mapping a pointer with NULL target. (gomp_attach_pointer): Add 'bool allow_zero_length_array_sections' parameter, add support for attaching a pointer with NULL target. (gomp_map_vars_internal): Update calls to gomp_map_pointer and gomp_attach_pointer, add handling for GOMP_MAP_ATTACH_ZERO_LENGTH_ARRAY_SECTION, and GOMP_MAP_POINTER_TO_ZERO_LENGTH_ARRAY_SECTION cases. * testsuite/libgomp.c++/target-23.C: New testcase. * testsuite/libgomp.c++/target-lambda-1.C: New testcase. * testsuite/libgomp.c++/target-lambda-2.C: New testcase. * testsuite/libgomp.c++/target-this-1.C: New testcase. * testsuite/libgomp.c++/target-this-2.C: New testcase. * testsuite/libgomp.c++/target-this-3.C: New testcase. * testsuite/libgomp.c++/target-this-4.C: New testcase. * testsuite/libgomp.c++/target-this-5.C: New testcase.
2021-11-13Daily bump.GCC Administrator1-0/+8
2021-11-12openmp: Relax handling of implicit map vs. existing device mappingsChung-Lin Tang1-0/+14
This patch implements relaxing the requirements when a map with the implicit attribute encounters an overlapping existing map. As the OpenMP 5.0 spec describes on page 320, lines 18-27 (and 5.1 spec, page 352, lines 13-22): "If a single contiguous part of the original storage of a list item with an implicit data-mapping attribute has corresponding storage in the device data environment prior to a task encountering the construct that is associated with the map clause, only that part of the original storage will have corresponding storage in the device data environment as a result of the map clause." 2021-11-12 Chung-Lin Tang <cltang@codesourcery.com> include/ChangeLog: * gomp-constants.h (GOMP_MAP_FLAG_SPECIAL_3): Define special bit macro. (GOMP_MAP_IMPLICIT): New special map kind bits value. (GOMP_MAP_FLAG_SPECIAL_BITS): Define helper mask for whole set of special map kind bits. (GOMP_MAP_IMPLICIT_P): New predicate macro for implicit map kinds. gcc/ChangeLog: * tree.h (OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P): New access macro for 'implicit' bit, using 'base.deprecated_flag' field of tree_node. * tree-pretty-print.c (dump_omp_clause): Add support for printing implicit attribute in tree dumping. * gimplify.c (gimplify_adjust_omp_clauses_1): Set OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P to 1 if map clause is implicitly created. (gimplify_adjust_omp_clauses): Adjust place of adding implicitly created clauses, from simple append, to starting of list, after non-map clauses. * omp-low.c (lower_omp_target): Add GOMP_MAP_IMPLICIT bits into kind values passed to libgomp for implicit maps. gcc/testsuite/ChangeLog: * c-c++-common/gomp/target-implicit-map-1.c: New test. * c-c++-common/goacc/combined-reduction.c: Adjust scan test pattern. * c-c++-common/goacc/firstprivate-mappings-1.c: Likewise. * c-c++-common/goacc/mdc-1.c: Likewise. * g++.dg/goacc/firstprivate-mappings-1.C: Likewise. libgomp/ChangeLog: * target.c (gomp_map_vars_existing): Add 'bool implicit' parameter, add implicit map handling to allow a "superset" existing map as valid case. (get_kind): Adjust to filter out GOMP_MAP_IMPLICIT bits in return value. (get_implicit): New function to extract implicit status. (gomp_map_fields_existing): Adjust arguments in calls to gomp_map_vars_existing, and add uses of get_implicit. (gomp_map_vars_internal): Likewise. * testsuite/libgomp.c-c++-common/target-implicit-map-1.c: New test.
2021-11-06Daily bump.GCC Administrator1-0/+5
2021-11-05include: Allow for our md5.h to defer to the system headerGerald Pfeifer1-0/+6
This came up in the context of libsanitizer, where platform-specific support for FreeBSD relies on aspects provided by FreeBSD's own md5.h. Address this by allowing GCC's md5.h to pull in the system header instead, controlled by a new macro USE_SYSTEM_MD5. 2021-11-05 Gerald Pfeifer <gerald@pfeifer.com> Jakub Jelinek <jakub@redhat.com> include/ * md5.h (USE_SYSTEM_MD5): Introduce.
2021-09-28Daily bump.GCC Administrator1-0/+4
2021-09-27Update pathname for IBM long double description.Vincent Lefevre1-1/+1
include/ * floatformat.h: Update pathname for IBM long double description.
2021-09-23Daily bump.GCC Administrator1-0/+5
2021-09-22obstack.h __PTR_ALIGN vs. ubsanAlan Modra1-3/+3
Current ubsan complains on every use of __PTR_ALIGN (when ptrdiff_t is as large as a pointer), due to making calculations relative to a NULL pointer. This patch avoids the problem by extracting out and simplifying __BPTR_ALIGN for the usual case. I've continued to use ptrdiff_t here, where it might be better to throw away __BPTR_ALIGN entirely and just assume uintptr_t exists. * obstack.h (__PTR_ALIGN): Expand and simplify __BPTR_ALIGN rather than calculating relative to a NULL pointer.
2021-08-24Daily bump.GCC Administrator1-0/+4
2021-08-23openmp: Add support for strict modifier on grainsize/num_tasks clausesJakub Jelinek1-0/+1
With strict: modifier on these clauses, the standard is explicit about how many iterations (and which) each generated task of taskloop directive should contain. For num_tasks it actually matches what we were already implementing, but for grainsize it does not (and even violates the old rule - without strict it requires that the number of iterations (unspecified which exactly) handled by each generated task is >= grainsize argument and < 2 * grainsize argument, with strict: it requires that each generated task handles exactly == grainsize argument iterations, except for the generated task handling the last iteration which can handles <= grainsize iterations). The following patch implements it for C and C++. 2021-08-23 Jakub Jelinek <jakub@redhat.com> gcc/ * tree.h (OMP_CLAUSE_GRAINSIZE_STRICT): Define. (OMP_CLAUSE_NUM_TASKS_STRICT): Define. * tree-pretty-print.c (dump_omp_clause) <case OMP_CLAUSE_GRAINSIZE, case OMP_CLAUSE_NUM_TASKS>: Print strict: modifier. * omp-expand.c (expand_task_call): Use GOMP_TASK_FLAG_STRICT in iflags if either grainsize or num_tasks clause has the strict modifier. gcc/c/ * c-parser.c (c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize): Parse the optional strict: modifier. gcc/cp/ * parser.c (cp_parser_omp_clause_num_tasks, cp_parser_omp_clause_grainsize): Parse the optional strict: modifier. include/ * gomp-constants.h (GOMP_TASK_FLAG_STRICT): Define. libgomp/ * taskloop.c (GOMP_taskloop): Handle GOMP_TASK_FLAG_STRICT. * testsuite/libgomp.c-c++-common/taskloop-4.c (main): Fix up comment. * testsuite/libgomp.c-c++-common/taskloop-5.c: New test.
2021-07-25Daily bump.GCC Administrator1-0/+6
2021-07-24include: Fix -Wundef warnings in ansidecl.hMarek Polacek1-3/+3
This quashes -Wundef warnings in ansidecl.h when compiled in C or C++. In C, __cpp_constexpr and __cplusplus aren't defined so we evaluate them to 0; conversely, __STDC_VERSION__ is not defined in C++. This has caused grief when -Wundef is used with -Werror. I've also tested -traditional-cpp. include/ChangeLog: * ansidecl.h: Check if __cplusplus is defined before checking the value of __cpp_constexpr and __cplusplus. Don't check __STDC_VERSION__ in C++.
2021-07-03Daily bump.GCC Administrator1-0/+7
2021-07-02BTF: Support for BTF_KIND_FLOATDavid Faust1-4/+5
Add BTF_KIND_FLOAT, a new BTF type kind which has recently stabilized in the linux kernel [1]. This kind is used for encoding floating point types, and is of particular use when generating BTF for some s390 arch-specific kernel headers. Also update some BTF tests which previously used floating point types to check correct behavior for types with no BTF representation. [1]: https://github.com/torvalds/linux/commit/b1828f0b04828aa8cccadf00a702f459caefeed9 include/ChangeLog: * btf.h (struct btf_type): Update bit usage comment. (BTF_INFO_KIND): Update bit mask. (BTF_KIND_FLOAT): New define. (BTF_KIND_MAX): Update. gcc/ChangeLog: * btfout.c (get_btf_kind): Support BTF_KIND_FLOAT. (btf_asm_type): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/debug/btf/btf-float-1.c: New test. * gcc.dg/debug/btf/btf-function-3.c: Use different unrepresentable type. * gcc.dg/debug/btf/btf-struct-2.c: Likewise. * gcc.dg/debug/btf/btf-variables-2.c: Likewise.
2021-06-29Daily bump.GCC Administrator1-0/+8
2021-06-28CTF/BTF debug formatsIndu Bhagat2-0/+716
This commit introduces support for generating CTF debugging information and BTF debugging information from GCC. 2021-06-28 Indu Bhagat <indu.bhagat@oracle.com> David Faust <david.faust@oracle.com> Jose E. Marchesi <jose.marchesi@oracle.com> Weimin Pan <weimin.pan@oracle.com> gcc/ * Makefile.in: Add ctfc.*, ctfout.c and btfout.c files to GTFILES. Add new object files. * common.opt: Add CTF and BTF debug info options. * btfout.c: New file. * ctfc.c: Likewise. * ctfc.h: Likewise. * ctfout.c: Likewise. * dwarf2ctf.c: Likewise. * dwarf2ctf.h: Likewise. * dwarf2cfi.c (dwarf2out_do_frame): Acknowledge CTF_DEBUG and BTF_DEBUG. * dwarf2out.c (dwarf2out_source_line): Likewise. (dwarf2out_finish): Skip emitting DWARF if CTF or BTF are to be generated. (debug_format_do_cu): New function. (dwarf2out_early_finish): Traverse DIEs and emit CTF/BTF for them if requested. Include dwarf2ctf.c. * final.c (dwarf2_debug_info_emitted_p): Acknowledge DWARF-based debug formats. * flag-types.h (enum debug_info_type): Add CTF_DEBUG and BTF_DEBUG. (CTF_DEBUG): New bitmask. (BTF_DEBUG): Likewise. (enum ctf_debug_info_levels): New enum. * gengtype.c (open_base_files): Handle ctfc.h. (main): Handle uint32_t type. * flags.h (btf_debuginfo_p): New definition. (dwarf_based_debuginfo_p): Likewise. * opts.c (debug_type_names): Add entries for CTF and BTF. (btf_debuginfo_p): New function. (dwarf_based_debuginfo_p): Likewise. (common_handle_option): Handle -gctfN and -gbtf options. (set_debug_level): Set CTF_DEBUG, BTF_DEBUG whenever appropriate. * toplev.c (process_options): Inform the user and ignore -gctfLEVEL if frontend is not C. include/ * ctf.h: New file. * btf.h: Likewise. libiberty/ * simple-object.c (handle_lto_debug_sections): Copy over .ctf sections.
2021-05-07Daily bump.GCC Administrator1-0/+4
2021-05-06libiberty: add htab_eq_stringTom Tromey1-0/+3
The libiberty hash table includes a helper function for strings, but no equality function. Consequently, this equality function has been reimplemented a number of times in both the gcc and binutils-gdb source trees. This patch adds the function to the libiberty hash table, as a step toward the goal of removing all the copies. One change to gcc is included here. Normally I would have put this in the next patch, but gensupport.c used the most natural name for its reimplementation of this function, and this can't coexist with the extern function in libiberty. include * hashtab.h (htab_eq_string): Declare. libiberty * hashtab.c (htab_eq_string): New function. gcc * gensupport.c (htab_eq_string): Remove.
2021-04-01Daily bump.GCC Administrator1-0/+6
2021-03-30c++: Adjust mangling of __alignof__ [PR88115]Patrick Palka1-0/+3
r11-4926 made __alignof__ get mangled differently from alignof, encoding __alignof__ as a vendor extended operator. But this mangling is problematic for the reasons mentioned in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88115#c6. This patch changes our mangling of __alignof__ to instead use the new "vendor extended expression" syntax that's proposed in https://github.com/itanium-cxx-abi/cxx-abi/issues/112. Clang does the same thing already, so after this patch Clang and GCC agree about the mangling of __alignof__(type) and __alignof__(expr). gcc/cp/ChangeLog: PR c++/88115 * mangle.c (write_expression): Adjust the mangling of __alignof__. include/ChangeLog: PR c++/88115 * demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_VENDOR_EXPR. libiberty/ChangeLog: PR c++/88115 * cp-demangle.c (d_dump, d_make_comp, d_expression_1) (d_count_templates_scopes): Handle DEMANGLE_COMPONENT_VENDOR_EXPR. (d_print_comp_inner): Likewise. <case DEMANGLE_COMPONENT_EXTENDED_OPERATOR>: Revert r11-4926 change. <case DEMANGLE_COMPONENT_UNARY>: Likewise. * testsuite/demangle-expected: Adjust __alignof__ tests. gcc/testsuite/ChangeLog: PR c++/88115 * g++.dg/cpp0x/alignof7.C: Adjust expected mangling.
2021-01-17Daily bump.GCC Administrator1-0/+4