aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-01-11Fix problematic interaction between bitfields, unions, SSO and SRAEric Botcazou2-1/+69
The handling of bitfields by the SRA pass is peculiar and this must be taken into account to support the scalar_storage_order attribute. gcc/ PR tree-optimization/108199 * tree-sra.cc (sra_modify_expr): Deal with reverse storage order for bit-field references. gcc/testsuite/ * gcc.dg/sso-17.c: New test.
2023-01-11strlen: do not use cond_expr for boundariesMartin Liska2-6/+15
PR tree-optimization/108137 gcc/ChangeLog: * tree-ssa-strlen.cc (get_range_strlen_phi): Reject anything different from INTEGER_CST. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr108137.c: New test. (cherry picked from commit ee6f262b87fef590729e96e999f1c3b207c251c0)
2023-01-11Daily bump.GCC Administrator3-1/+41
2023-01-10Fix memory constraint on MVE v[ld/st][2/4] instructions [PR107714]Stam Markianos-Wright6-4/+332
In the M-Class Arm-ARM: https://developer.arm.com/documentation/ddi0553/bu/?lang=en these MVE instructions only have '!' writeback variant and at: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107714 we found that the Um constraint would also allow through a register offset writeback, resulting in an assembler error. Here I have added a new constraint and predicate for these instructions, which (uniquely, AFAICT), only support a `!` writeback increment by the data size (inside the compiler this is a POST_INC). No regressions in arm-none-eabi with MVE and MVE.FP. gcc/ChangeLog: PR target/107714 * config/arm/arm-protos.h (mve_struct_mem_operand): New protoype. * config/arm/arm.cc (mve_struct_mem_operand): New function. * config/arm/constraints.md (Ug): New constraint. * config/arm/mve.md (mve_vst4q<mode>): Change constraint. (mve_vst2q<mode>): Likewise. (mve_vld4q<mode>): Likewise. (mve_vld2q<mode>): Likewise. * config/arm/predicates.md (mve_struct_operand): New predicate. gcc/testsuite/ChangeLog: PR target/107714 * gcc.target/arm/mve/intrinsics/vldst24q_reg_offset.c: New test. (cherry picked from commit 4269a6567eb991e6838f40bda5be9e3a7972530c)
2023-01-10aarch64: PR target/108140 Handle NULL target in data intrinsic expansionKyrylo Tkachov2-1/+16
In this PR we ICE when expanding the __rbit builtin with a NULL target rtx. I *think* that only happens when the result is unused and hence maybe we shouldn't be expanding any RTL at all, but the ICE here is easily fixed by deriving the mode from the type of the expression rather than the target. This patch does that. Bootstrapped and tested on aarch64-none-linux-gnu. gcc/ChangeLog: PR target/108140 * config/aarch64/aarch64-builtins.cc (aarch64_expand_builtin_data_intrinsic): Handle NULL target. gcc/testsuite/ChangeLog: PR target/108140 * gcc.target/aarch64/acle/pr108140.c: New test. (cherry picked from commit 98756bcbe27647f263f2b312d1d933d70cf56ba9)
2023-01-10Daily bump.GCC Administrator2-1/+5
2023-01-09Update cpplib eo.poJoseph Myers1-39/+28
* eo.po: Update.
2023-01-09openmp: Fix up finish_omp_target_clauses [PR108286]Jakub Jelinek4-1/+49
The comment in the loop says that we shouldn't add a map clause if such a clause exists already, but the loop was actually using OMP_CLAUSE_DECL on any clause. Target construct can have various clauses which don't have OMP_CLAUSE_DECL at all (e.g. nowait, device or if) or clause where it means something different (e.g. privatization clauses, allocate, depend). So, only check OMP_CLAUSE_DECL on OMP_CLAUSE_MAP clauses. 2023-01-05 Jakub Jelinek <jakub@redhat.com> PR c++/108286 * semantics.cc (finish_omp_target_clauses): Ignore clauses other than OMP_CLAUSE_MAP. * testsuite/libgomp.c++/pr108286.C: New test. (cherry picked from commit 29c3218618ef6177dc33871b26c8fbd9b21eabe1)
2023-01-09Merge branch 'releases/gcc-12' into devel/omp/gcc-12Tobias Burnus27-32/+387
Merge up to r12-9034-g4494965932fc5d005e2482bbe58cf9e138c830bd (9th Jan 2023)
2023-01-09Daily bump.GCC Administrator1-1/+1
2023-01-08Daily bump.GCC Administrator1-1/+1
2023-01-07Daily bump.GCC Administrator1-1/+1
2023-01-06Daily bump.GCC Administrator4-1/+34
2023-01-05libstdc++: Fix std::chrono::hh_mm_ss with unsigned rep [PR108265]Jonathan Wakely2-13/+79
libstdc++-v3/ChangeLog: PR libstdc++/108265 * include/std/chrono (hh_mm_ss): Do not use chrono::abs if duration rep is unsigned. Remove incorrect noexcept-specifier. * testsuite/std/time/hh_mm_ss/1.cc: Check unsigned rep. Check floating-point representations. Check default construction. (cherry picked from commit e36e57b032b2d70eaa1294d5921e4fd8ce12a74d)
2023-01-04rs6000: Raise error for __vector_{quad,pair} uses without MMA enabled [PR106736]Kewen Lin8-3/+140
As PR106736 shows, it's unexpected to use __vector_quad and __vector_pair types without MMA support, it would cause ICE when expanding the corresponding assignment. We can't guard these built-in types registering under MMA support as Peter pointed out in that PR, because the registering is global, it doesn't work for target pragma/attribute support with MMA enabled. The existing verify_type_context mentioned in [2] can help to make the diagnostics invalid built-in type uses better, but as Richard pointed out in [4], it can't deal with all cases. As the discussions in [1][3], this patch is to check the invalid use of built-in types __vector_quad and __vector_pair in mov pattern of OOmode and XOmode, on the currently being expanded gimple assignment statement. It still puts an assertion in else arm rather than just makes it go through, it's to ensure we can catch any other possible unexpected cases in time if there are. [1] https://gcc.gnu.org/pipermail/gcc/2022-December/240218.html [2] https://gcc.gnu.org/pipermail/gcc/2022-December/240220.html [3] https://gcc.gnu.org/pipermail/gcc/2022-December/240223.html [4] https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608083.html PR target/106736 gcc/ChangeLog: * config/rs6000/mma.md (define_expand movoo): Call function rs6000_opaque_type_invalid_use_p to check and emit error message for the invalid use of opaque type. (define_expand movxo): Likewise. * config/rs6000/rs6000-protos.h (rs6000_opaque_type_invalid_use_p): New function declaration. (currently_expanding_gimple_stmt): New extern declaration. * config/rs6000/rs6000.cc (rs6000_opaque_type_invalid_use_p): New function. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr106736-1.c: New test. * gcc.target/powerpc/pr106736-2.c: Likewise. * gcc.target/powerpc/pr106736-3.c: Likewise. * gcc.target/powerpc/pr106736-4.c: Likewise. * gcc.target/powerpc/pr106736-5.c: Likewise.
2023-01-05Daily bump.GCC Administrator5-1/+41
2023-01-04c++: mark_single_function and SFINAE [PR108282]Patrick Palka2-1/+20
We typically ignore mark_used failure when in a non-SFINAE context for sake of better error recovery. But in mark_single_function we're instead ignoring mark_used failure in a SFINAE context, which ends up causing the second static_assert here to incorrectly fail. PR c++/108282 gcc/cp/ChangeLog: * decl2.cc (mark_single_function): Ignore mark_used failure only in a non-SFINAE context rather than in a SFINAE one. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-requires34.C: New test. (cherry picked from commit 238e292cf5d822f3bd12d9b58eb04cf377758b2a)
2023-01-04libiberty: Fix C89-isms in configure testsFlorian Weimer2-6/+22
libiberty/ * acinclude.m4 (ac_cv_func_strncmp_works): Add missing int return type and parameter list to the definition of main. Include <stdlib.h> and <string.h> for prototypes. (ac_cv_c_stack_direction): Add missing int return type and parameter list to the definitions of main, find_stack_direction. Include <stdlib.h> for exit prototype. * configure: Regenerate. (cherry picked from commit 885b6660c17fb91980b5682514ef54668e544b02)
2023-01-04libsanitizer: Avoid implicit function declaration in configure testFlorian Weimer2-1/+3
libsanitizer/ * configure.ac (sanitizer_supported): Include <unistd.h> for syscall prototype. * configure: Regenerate. (cherry picked from commit 6be2672e4ee41c566a9e072088cccca263bab5f7)
2023-01-04OpenMP: GC unused SIMD clonesSandra Loosemore8-11/+90
SIMD clones are created during the IPA phase when it is not known whether or not the vectorizer can use them. Clones for functions with external linkage are part of the ABI, but local clones can be GC'ed if no calls are found in the compilation unit after vectorization. gcc/ChangeLog * cgraph.h (struct cgraph_node): Add gc_candidate bit, modify default constructor to initialize it. * cgraphunit.cc (expand_all_functions): Save gc_candidate functions for last and iterate to handle recursive calls. Delete leftover candidates at the end. * omp-simd-clone.cc (simd_clone_create): Set gc_candidate bit on local clones. * tree-vect-stmts.cc (vectorizable_simd_clone_call): Clear gc_candidate bit when a clone is used. gcc/testsuite/ChangeLog * g++.dg/gomp/target-simd-clone-1.C: Tweak to test that the unused clone is GC'ed. * gcc.dg/gomp/target-simd-clone-1.c: Likewise. (cherry picked from commit 0425ae780fb2b055d985b5719af5edfaaad5e980)
2023-01-04Daily bump.GCC Administrator1-1/+1
2023-01-03Daily bump.GCC Administrator1-1/+1
2023-01-02Daily bump.GCC Administrator1-1/+1
2023-01-01Daily bump.GCC Administrator1-1/+1
2022-12-31Daily bump.GCC Administrator1-1/+1
2022-12-30Daily bump.GCC Administrator1-1/+1
2022-12-29Daily bump.GCC Administrator3-1/+20
2022-12-28Fortran: incorrect array bounds when bound intrinsic used in decl [PR108131]Harald Anlauf3-7/+30
gcc/fortran/ChangeLog: PR fortran/108131 * array.cc (match_array_element_spec): Avoid too early simplification of matched array element specs that can lead to a misinterpretation when used as array bounds in array declarations. gcc/testsuite/ChangeLog: PR fortran/108131 * gfortran.dg/pr103505.f90: Adjust expected patterns. * gfortran.dg/pr108131.f90: New test. (cherry picked from commit 6a95f0e0a06d78d94138d4c3dd64d41591197281)
2022-12-28Daily bump.GCC Administrator1-1/+1
2022-12-27Merge branch 'releases/gcc-12' into devel/omp/gcc-12Tobias Burnus13-70/+201
Merge up to r12-9015-ga3fbfc1027e9edcd14bb290b5702504d80d9e8fe (27th Dec 2022)
2022-12-27Daily bump.GCC Administrator1-1/+1
2022-12-26Daily bump.GCC Administrator1-1/+1
2022-12-25Daily bump.GCC Administrator2-1/+7
2022-12-24Skip guality tests on hppa-hpux.John David Anglin3-0/+12
The guality check command hangs. This causes TCL errors in other tests and slows testsuite execution. 2022-11-13 John David Anglin <danglin@gcc.gnu.org> gcc/testsuite/ChangeLog: * g++.dg/guality/guality.exp: Skip on hppa*-*-hpux*. * gcc.dg/guality/guality.exp: Likewise. * gfortran.dg/guality/guality.exp: Likewise.
2022-12-24Daily bump.GCC Administrator1-1/+1
2022-12-23Daily bump.GCC Administrator2-1/+31
2022-12-22bootstrap/106482 - document minimal GCC versionRichard Biener1-2/+4
There's no explicit mention of what GCC compiler supports C++11 and the cross compiler build requirement mentions GCC 4.8 but not GCC 4.8.3 which is the earliest known version to not run into C++11 implementation bugs. The following adds explicit wording. PR bootstrap/106482 * doc/install.texi (ISO C++11 Compiler): Document GCC version known to work. (cherry picked from commit b97c33fbd28e74a206c81c96a9b0b9fa3c8545d6)
2022-12-22lto: support --jobserver-style=fifo for recent GNU makeMartin Liska2-2/+17
gcc/ChangeLog: * opts-jobserver.h: Add one member. * opts-common.cc (jobserver_info::jobserver_info): Parse FIFO format of --jobserver-auth. (cherry picked from commit 53e3b2bf16a486c15c20991c6095f7be09012b55)
2022-12-22Factor out jobserver_active_p.Martin Liska4-67/+99
gcc/ChangeLog: * gcc.cc (driver::detect_jobserver): Remove and move to jobserver.h. * lto-wrapper.cc (jobserver_active_p): Likewise. (run_gcc): Likewise. * opts-jobserver.h: New file. * opts-common.cc (jobserver_info::jobserver_info): New function. (cherry picked from commit 1270ccda70ca09f7d4fe76b5156dca8992bd77a6)
2022-12-22Daily bump.GCC Administrator3-1/+35
2022-12-21Merge branch 'releases/gcc-12' into devel/omp/gcc-12Tobias Burnus13-159/+323
Merge up to r12-9005-g52daccd82cd71bd065826784ebb6eb04fa9b42af (21st Dec 2022)
2022-12-21nvptx: reimplement libgomp barriers [PR99555]Chung-Lin Tang3-103/+147
Instead of trying to have the GPU do CPU-with-OS-like things, this new barriers implementation for NVPTX uses simplistic bar.* synchronization instructions. Tasks are processed after threads have joined, and only if team->task_count != 0 It is noted that: there might be a little bit of performance forfeited for cases where earlier arriving threads could've been used to process tasks ahead of other threads, but that has the requirement of implementing complex futex-wait/wake like behavior, which is what we're try to avoid with this patch. It is deemed that task processing is not what GPU target offloading is usually used for. Implementation highlight notes: 1. gomp_team_barrier_wake() is now an empty function (threads never "wake" in the usual manner) 2. gomp_team_barrier_cancel() now uses the "exit" PTX instruction. 3. gomp_barrier_wait_last() now is implemented using "bar.arrive" 4. gomp_team_barrier_wait_end()/gomp_team_barrier_wait_cancel_end(): The main synchronization is done using a 'bar.red' instruction. This reduces across all threads the condition (team->task_count != 0), to enable the task processing down below if any thread created a task. (this bar.red usage means that this patch is dependent on the prior NVPTX bar.red GCC patch) PR target/99555 libgomp/ChangeLog: * config/nvptx/bar.c (generation_to_barrier): Remove. (futex_wait,futex_wake,do_spin,do_wait): Remove. (GOMP_WAIT_H): Remove. (#include "../linux/bar.c"): Remove. (gomp_barrier_wait_end): New function. (gomp_barrier_wait): Likewise. (gomp_barrier_wait_last): Likewise. (gomp_team_barrier_wait_end): Likewise. (gomp_team_barrier_wait): Likewise. (gomp_team_barrier_wait_final): Likewise. (gomp_team_barrier_wait_cancel_end): Likewise. (gomp_team_barrier_wait_cancel): Likewise. (gomp_team_barrier_cancel): Likewise. * config/nvptx/bar.h (gomp_barrier_t): Remove waiters, lock fields. (gomp_barrier_init): Remove init of waiters, lock fields. (gomp_team_barrier_wake): Remove prototype, add new static inline function. (cherry picked from commit fdc7469cf597ec11229ddfc3e9c7a06f3d0fba9d)
2022-12-21nvptx: support bar.red instructionChung-Lin Tang3-0/+152
This patch adds support for the PTX 'bar.red' (i.e. "barrier reduction") instruction, in the form of nvptx-specific __builtin_nvptx_bar_red_[and/or/popc] built-in functions. gcc/ChangeLog: * config/nvptx/nvptx.cc (nvptx_print_operand): Add 'p' case, adjust comments. (enum nvptx_builtins): Add NVPTX_BUILTIN_BAR_RED_AND, NVPTX_BUILTIN_BAR_RED_OR, and NVPTX_BUILTIN_BAR_RED_POPC. (nvptx_expand_bar_red): New function. (nvptx_init_builtins): Add DEFs of __builtin_nvptx_bar_red_[and/or/popc]. (nvptx_expand_builtin): Use nvptx_expand_bar_red to expand NVPTX_BUILTIN_BAR_RED_[AND/OR/POPC] cases. * config/nvptx/nvptx.md (define_c_enum "unspecv"): Add UNSPECV_BARRED_AND, UNSPECV_BARRED_OR, and UNSPECV_BARRED_POPC. (BARRED): New int iterator. (barred_op,barred_mode,barred_ptxtype): New int attrs. (nvptx_barred_<barred_op>): New define_insn. (cherry picked from commit 623daaf8a229fcb58f84448d954f8c71191ca486)
2022-12-21openmp: Don't try to destruct DECL_OMP_PRIVATIZED_MEMBER vars [PR108180]Jakub Jelinek4-0/+77
DECL_OMP_PRIVATIZED_MEMBER vars are artificial vars with DECL_VALUE_EXPR of this->field used just during gimplification and omp lowering/expansion to privatize individual fields in methods when needed. As the following testcase shows, when not in templates, they were handled right, but in templates we actually called cp_finish_decl on them and that can result in their destruction, which is obviously undesirable, we should only destruct the privatized copies of them created in omp lowering. Fixed thusly. 2022-12-21 Jakub Jelinek <jakub@redhat.com> PR c++/108180 * pt.cc (tsubst_expr): Don't call cp_finish_decl on DECL_OMP_PRIVATIZED_MEMBER vars. * testsuite/libgomp.c++/pr108180.C: New test. (cherry picked from commit 1119902b6c7c1c50123ed85ec1def8be4772d68c)
2022-12-21OpenMP: Duplicate checking for map clauses in Fortran (PR107214)Julian Brown12-26/+384
This patch adds duplicate checking for OpenMP "map" clauses, taking some cues from the implementation for C in c-typeck.cc:c_finish_omp_clauses (and similar for C++). In addition to the existing use of the "mark" and "comp_mark" bitfields in the gfc_symbol structure, the patch adds several new bits handling duplicate checking within various categories of clause types. If "mark" is being used for map clauses, we need to use different bits for other clauses for cases where "map" and some other clause can refer to the same symbol (e.g. "map(n) shared(n)"). 2022-12-06 Julian Brown <julian@codesourcery.com> gcc/fortran/ PR fortran/107214 * gfortran.h (gfc_symbol): Add data_mark, dev_mark, gen_mark and reduc_mark bitfields. * openmp.cc (resolve_omp_clauses): Use above bitfields to improve duplicate clause detection. gcc/testsuite/ PR fortran/107214 * gfortran.dg/gomp/pr107214.f90: New test. * gfortran.dg/gomp/pr107214-2.f90: New test. * gfortran.dg/gomp/pr107214-3.f90: New test. * gfortran.dg/gomp/pr107214-4.f90: New test. * gfortran.dg/gomp/pr107214-5.f90: New test. * gfortran.dg/gomp/pr107214-6.f90: New test. * gfortran.dg/gomp/pr107214-7.f90: New test. * gfortran.dg/gomp/pr107214-8.f90: New test. (cherry picked from commit 330b9a8d87dd73e10539da618496ad4964fee26d)
2022-12-21OpenMP/Fortran: Combined directives with map/firstprivate of same symbolJulian Brown4-2/+92
This patch fixes a case where a combined directive (e.g. "!$omp target parallel ...") contains both a map and a firstprivate clause for the same variable. When the combined directive is split into two nested directives, the outer "target" gets the "map" clause, and the inner "parallel" gets the "firstprivate" clause, like so: !$omp target parallel map(x) firstprivate(x) --> !$omp target map(x) !$omp parallel firstprivate(x) ... When there is no map of the same variable, the firstprivate is distributed to both directives, e.g. for 'y' in: !$omp target parallel map(x) firstprivate(y) --> !$omp target map(x) firstprivate(y) !$omp parallel firstprivate(y) ... This is not a recent regression, but appear to fix a long-standing ICE. (The included testcase is based on one by Tobias.) 2022-12-06 Julian Brown <julian@codesourcery.com> gcc/fortran/ * trans-openmp.cc (gfc_add_firstprivate_if_unmapped): New function. (gfc_split_omp_clauses): Call above. libgomp/ * testsuite/libgomp.fortran/combined-directive-splitting-1.f90: New test. (cherry picked from commit 9316ad3b4354cbf2980f86902e54884e918c472a)
2022-12-21libstdc++: Fix unsafe use of dirent::d_name [PR107814]Jonathan Wakely1-13/+22
Copy the fix for PR 104731 to the equivalent experimental::filesystem test. libstdc++-v3/ChangeLog: PR libstdc++/107814 * testsuite/experimental/filesystem/iterators/error_reporting.cc: Use a static buffer with space after it. (cherry picked from commit 1cac00d013856fea4cee0f13c4959c8e21afd2d9)
2022-12-21libstdc++: Fixes for std::expectedJonathan Wakely4-14/+152
This fixes some bugs in the swap functions for std::expected. It also disables the noexcept-specifiers for equality operators, because those are problematic when querying whether a std::expected is equality comparable. The operator==(const expected<T,E>&, const U&) function is not constrained, so is viable for comparing expected<T,E> with expected<void,G>, but then we get an error from the noexcept-specifier. libstdc++-v3/ChangeLog: * include/std/expected (expected::_M_swap_val_unex): Guard the correct object. (expected::swap): Move is_swappable requirement from static_assert to constraint. (swap): Likewise. (operator==): Remove noexcept-specifier. * testsuite/20_util/expected/swap.cc: Check swapping of types without non-throwing move constructor. Check constraints on swap. * testsuite/20_util/expected/unexpected.cc: Check constraints on swap. * testsuite/20_util/expected/equality.cc: New test. (cherry picked from commit 59822c39207c9e8be576e9d6c3370bd85ddaf886)
2022-12-21libgfortran's ISO_Fortran_binding.c: Use GCC11 version for backward-only ↵Tobias Burnus1-129/+22
code [PR108056] Since GCC 12, the conversion between the array descriptors formats - the internal (GFC) and the C binding one (CFI) - moved to the compiler itself such that the cfi_desc_to_gfc_desc/gfc_desc_to_cfi_desc functions are only used with older code (GCC 9 to 11). The newly added checks caused asserts as older code did not pass the proper values (e.g. real(4) as effective argument arrived as BT_ASSUME type as the effective type got lost inbetween). As proposed in the PR, revert to the GCC 11 version - known bugs is better than some fixes and new issues. Still, GCC 12 is much better in terms of TS29113 support and should really be used. This patch uses the current libgomp version of the GCC 11 branch, except it fixes the GFC version number (which is 0), uses calloc instead of malloc, and sets the lower bound to 1 instead of keeping it as is for CFI_attribute_other. (cherry picked from commit e205ec03f0794aeac3e8a89e947c12624d5a274e) (This cherry pick excludes an accidentally committed file, which was removed in follow-up commit 18af26fc375398f0a7cd7bae5aabebd447f8c899.) libgfortran/ChangeLog: PR libfortran/108056 * runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc, gfc_desc_to_cfi_desc): Mostly revert to GCC 11 version for those backward-compatiblity-only functions.
2022-12-21Daily bump.GCC Administrator2-1/+15