aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-06-14[contrib] validate_failures.py: Add more verbosity levelsMaxim Kuvyrkov1-36/+46
... to control validate_failures.py output contrib/ChangeLog: * testsuite-management/validate_failures.py: Add more verbosity levels.
2023-06-14[contrib] validate_failures.py: Simplify GetManifestPath()Maxim Kuvyrkov1-8/+5
... and don't require a valid build directory when no data from it is necessary. contrib/ChangeLog: * testsuite-management/validate_failures.py: Simplify GetManifestPath().
2023-06-14[contrib] validate_failures.py: Read in manifest when comparing build dirsMaxim Kuvyrkov1-3/+11
This allows comparison of two build directories with a manifest listing known flaky tests on the side. contrib/ChangeLog: * testsuite-management/validate_failures.py (GetResults): Update. (CompareBuilds): Read in manifest.
2023-06-14[contrib] validate_failures.py: Support expiry attributes in manifestsMaxim Kuvyrkov1-1/+9
contrib/ChangeLog: * testsuite-management/validate_failures.py (ParseManifestWorker): Support expiry attributes in manifests. (ParseSummary): Add a comment.
2023-06-14[contrib] validate_failures.py: Avoid testsuite aliasingMaxim Kuvyrkov1-22/+115
This patch adds tracking of current testsuite "tool" and "exp" to the processing of .sum files. This avoids aliasing between tests from different testsuites with same name+description. E.g., this is necessary for testsuite/c-c++-common, which is ran for both gcc and g++ "tools". This patch changes manifest format from ... <cut> FAIL: gcc_test FAIL: g++_test </cut> ... to ... <cut> === gcc tests === Running gcc/foo.exp ... FAIL: gcc_test === gcc Summary == === g++ tests === Running g++/bar.exp ... FAIL: g++_test === g++ Summary == </cut>. The new format uses same formatting as DejaGnu's .sum files to specify which "tool" and "exp" the test belongs to. contrib/ChangeLog: * testsuite-management/validate_failures.py: Avoid testsuite aliasing.
2023-06-14c++: tweak c++17 ctor/conversion tiebreaker [DR2327]Jason Merrill3-36/+39
In discussion of this issue CWG decided that the change of behavior on well-formed code like overload-conv-4.C is undesirable. In further discussion of possible resolutions, we discovered that we can avoid that change while still getting the desired behavior on overload-conv-3.C by making this a tiebreaker after comparing conversions, rather than before. This also simplifies the implementation. The issue resolution has not yet been finalized, but this seems like a clear improvement. DR 2327 PR c++/86521 gcc/cp/ChangeLog: * call.cc (joust_maybe_elide_copy): Don't change cand. (joust): Move the elided tiebreaker later. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/overload-conv-4.C: Remove warnings. * g++.dg/cpp1z/elide7.C: New test.
2023-06-14libstdc++: Clarify manual demangle docJonny Grant2-8/+4
libstdc++-v3/ChangeLog: * doc/xml/manual/extensions.xml: Remove demangle exception description and include. * doc/html/manual/ext_demangling.html: Regenerate.
2023-06-14Align a 'OMP_TARGET_OFFLOAD=mandatory' diagnostic with othersThomas Schwinge2-3/+3
On 2023-06-14T11:42:22+0200, Tobias Burnus <tobias@codesourcery.com> wrote: > On 14.06.23 10:09, Thomas Schwinge wrote: >> Let me know if I should also adjust the new 'target { ! offload_device }' >> diagnostic "[...] MANDATORY but only the host device is available" to >> include a comma before 'but', for consistency with the other existing >> diagnostics (cited above)? > > I think it makes sense to be consistent. Thus: Yes, please add the commas. Fix-up for recent commit 18c8b56c7d67a9e37acf28822587786f0fc0efbc "OpenMP: Set default-device-var with OMP_TARGET_OFFLOAD=mandatory". libgomp/ * target.c (resolve_device): Align a 'OMP_TARGET_OFFLOAD=mandatory' diagnostic with others. * testsuite/libgomp.c/target-51.c: Adjust.
2023-06-14driver: Forward '-lgfortran', '-lm' to offloading compilationThomas Schwinge9-10/+82
..., so that users don't manually need to specify '-foffload-options=-lgfortran', '-foffload-options=-lm' in addition to '-lgfortran', '-lm' (specified manually, or implicitly by the driver). gcc/ * gcc.cc (driver_handle_option): Forward host '-lgfortran', '-lm' to offloading compilation. * config/gcn/mkoffload.cc (main): Adjust. * config/nvptx/mkoffload.cc (main): Likewise. * doc/invoke.texi (foffload-options): Update example. libgomp/ * testsuite/libgomp.fortran/fortran.exp (lang_link_flags): Don't set. * testsuite/libgomp.oacc-fortran/fortran.exp (lang_link_flags): Likewise. * testsuite/libgomp.c/simd-math-1.c: Remove '-foffload-options=-lm'. * testsuite/libgomp.fortran/fortran-torture_execute_math.f90: Likewise. * testsuite/libgomp.oacc-fortran/fortran-torture_execute_math.f90: Likewise.
2023-06-14Add 'libgomp.{,oacc-}fortran/fortran-torture_execute_math.f90'Thomas Schwinge3-2/+31
..., via 'include'ing the existing 'gfortran.fortran-torture/execute/math.f90', which therefore is enhanced for optional OpenACC 'serial', OpenMP 'target' usage. gcc/testsuite/ * gfortran.fortran-torture/execute/math.f90: Enhance for optional OpenACC 'serial', OpenMP 'target' usage. libgomp/ * testsuite/libgomp.fortran/fortran-torture_execute_math.f90: New. * testsuite/libgomp.oacc-fortran/fortran-torture_execute_math.f90: Likewise.
2023-06-14Tighten 'dg-warning' alternatives in ↵Thomas Schwinge3-8/+8
'c-c++-common/Wfree-nonheap-object{,-2,-3}.c' ..., added in commit fe7f75cf16783589eedbab597e6d0b8d35d7e470 "Correct/improve maybe_emit_free_warning (PR middle-end/98166, PR c++/57111, PR middle-end/98160)". These use alternatives like, for example, "AB|CDE|FG", but what really must've been meant is "A(B|C)D(E|F)G". The former variant also does "work": it matches any of "AB", or "CDE", or "FG", which are components of the latter variant. (That means, the former variant matches too loosely.) gcc/testsuite/ * c-c++-common/Wfree-nonheap-object-2.c: Tighten 'dg-warning' alternatives. * c-c++-common/Wfree-nonheap-object-3.c: Likewise. * c-c++-common/Wfree-nonheap-object.c: Likewise.
2023-06-14Remove 'gcc/testsuite/g++.dg/warn/Wfree-nonheap-object.s'Thomas Schwinge1-0/+0
..., which, presumably, was added by mistake in commit dce6c58db87ebf7f4477bd3126228e73e4eeee97 "Add support for detecting mismatched allocation/deallocation calls". gcc/testsuite/ * g++.dg/warn/Wfree-nonheap-object.s: Remove.
2023-06-14Fix typo in 'libgomp.c/target-51.c'Thomas Schwinge1-1/+1
..., and therefore, given 'target offload_device': PASS: libgomp.c/target-51.c (test for excess errors) PASS: libgomp.c/target-51.c execution test [-FAIL:-]{+PASS:+} libgomp.c/target-51.c output pattern test Fix-up for recent commit 18c8b56c7d67a9e37acf28822587786f0fc0efbc "OpenMP: Set default-device-var with OMP_TARGET_OFFLOAD=mandatory". libgomp/ * testsuite/libgomp.c/target-51.c: Fix typo.
2023-06-14Use x instead of v for alternative 2 (v, BH) in mov<mode>_internal.liuhongt2-1/+12
Since there's no evex version for vpcmpeq ymm, ymm, ymm. gcc/ChangeLog: PR target/110227 * config/i386/sse.md (mov<mode>_internal>): Use x instead of v for alternative 2 since there's no evex version for vpcmpeqd ymm, ymm, ymm. gcc/testsuite/ChangeLog: * gcc.target/i386/pr110227.c: New test.
2023-06-14OpenMP: Set default-device-var with OMP_TARGET_OFFLOAD=mandatoryTobias Burnus12-4/+242
OMP_TARGET_OFFLOAD=mandatory handling was before inconsistent. Hence, in OpenMP 5.2 it was clarified/extended by having implications on the default-device-var; additionally, omp_initial_device and omp_invalid_device enum values/PARAMETERs were added; support for it was added in r13-1066-g1158fe43407568 including aborting for omp_invalid_device and non-conforming device numbers. Only the mandatory handling was missing. Namely, while the default-device-var is usually initialized to value 0, with 'mandatory' it must have the value 'omp_invalid_device' if and only if zero non-host devices are available. (The OMP_DEFAULT_DEVICE env var overrides this as it comes semantically after the initialization.) To achieve this, default-device-var is now initialized to MIN_INT. If there is no 'mandatory', it is set to 0 directly after env var parsing. Otherwise, it is updated in gomp_target_init to either 0 or omp_invalid_device. To ensure INT_MIN is never seen by the user, both the omp_get_default_device API routine and omp_display_env (user call and OMP_DISPLAY_ENV env var) call gomp_init_targets_once() in that case. libgomp/ChangeLog: * env.c (gomp_default_icv_values): Init default_device_var to an nonconforming value - INT_MIN. (initialize_env): After env-var parsing, set default_device_var to device 0 unless OMP_TARGET_OFFLOAD=mandatory. (omp_display_env): If default_device_var is INT_MIN, call gomp_init_targets_once. * icv-device.c (omp_get_default_device): Likewise. * libgomp.texi (OMP_DEFAULT_DEVICE): Update init description. (OpenMP 5.2 Impl. Status): Mark OMP_TARGET_OFFLOAD=mandatory as 'Y'. * target.c (resolve_device): Improve error message device-num < 0 with 'mandatory' and no no-host devices available. (gomp_target_init): Set default-device-var if INT_MIN. * testsuite/libgomp.c/target-48.c: New test. * testsuite/libgomp.c/target-49.c: New test. * testsuite/libgomp.c/target-50.c: New test. * testsuite/libgomp.c/target-50a.c: New test. * testsuite/libgomp.c/target-51.c: New test. * testsuite/libgomp.c/target-52.c: New test. * testsuite/libgomp.c/target-53.c: New test. * testsuite/libgomp.c/target-54.c: New test.
2023-06-14Daily bump.GCC Administrator11-1/+654
2023-06-13modula2 Fixes to the error format specificationsGaius Mulley4-30/+164
This patch contains a python3 script to check the meta format error specifications. It also includes about 20 fixes to M2Quads.mod format specifications. gcc/m2/ChangeLog: * Make-lang.in (check-format-error): New rule. * gm2-compiler/M2MetaError.mod (op): Add calls InternalError if digits are detected. * gm2-compiler/M2Quads.mod (BuildForToByDo): Bugfix to format specifier. (BuildLengthFunction): Bugfix to format specifiers. (BuildOddFunction): Bugfix to format specifiers. (BuildAbsFunction): Bugfix to format specifiers. (BuildCapFunction): Bugfix to format specifiers. (BuildChrFunction): Bugfix to format specifiers. (BuildOrdFunction): Bugfix to format specifiers. (BuildMakeAdrFunction): Bugfix to format specifiers. (BuildSizeFunction): Bugfix to format specifiers. (BuildBitSizeFunction): Bugfix to format specifiers. * tools-src/checkmeta.py: New file. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-06-13c/c++: use positive tone in missing header notes [PR84890]David Malcolm14-145/+145
Quoting "How a computer should talk to people" (as quoted in "Concepts Error Messages for Humans"): "Various negative tones or actions are unfriendly: being manipulative, not giving a second chance, talking down, using fashionable slang, blaming. We must not seem to blame the person. We should avoid suggesting that the person is inadequate. Phrases like "you forgot" may seem harmless, but what if a computer said this to you four or five times in two minutes? Anyway, the person may disagree, so why risk offense?" gcc/c-family/ChangeLog: PR c/84890 * known-headers.cc (suggest_missing_header::~suggest_missing_header): Reword note to avoid negative tone of "forgetting". gcc/cp/ChangeLog: PR c/84890 * name-lookup.cc (missing_std_header::~missing_std_header): Reword note to avoid negative tone of "forgetting". gcc/testsuite/ChangeLog: PR c/84890 * g++.dg/cpp2a/srcloc3.C: Update expected message. * g++.dg/lookup/missing-std-include-2.C: Likewise. * g++.dg/lookup/missing-std-include-3.C: Likewise. * g++.dg/lookup/missing-std-include-6.C: Likewise. * g++.dg/lookup/missing-std-include.C: Likewise. * g++.dg/spellcheck-inttypes.C: Likewise. * g++.dg/spellcheck-stdint.C: Likewise. * g++.dg/spellcheck-stdlib.C: Likewise. * gcc.dg/spellcheck-inttypes.c: Likewise. * gcc.dg/spellcheck-stdbool.c: Likewise. * gcc.dg/spellcheck-stdint.c: Likewise. * gcc.dg/spellcheck-stdlib.c: Likewise. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2023-06-13c++: Fix templated convertion operator demanglingNathan Sidwell2-25/+30
Instantiations of templated conversion operators failed to demangle for cases such as 'operator X<int>', but worked for 'operator X<int> &', due to thinking the template instantiation of X was the instantiation of the conversion operator itself. libiberty/ * cp-demangle.c (d_print_conversion): Remove incorrect template instantiation handling. * testsuite/demangle-expected: Add testcases.
2023-06-13Fortran: add DATA statement testcaseFrancois-Xavier Coudert1-0/+26
gcc/testsuite/ * gfortran.dg/data_array_7.f90: New test.
2023-06-13Fortran: fix passing of zero-sized array arguments to procedures [PR86277]Harald Anlauf3-1/+296
gcc/fortran/ChangeLog: PR fortran/86277 * trans-array.cc (gfc_trans_allocate_array_storage): When passing a zero-sized array with fixed (= non-dynamic) size, allocate temporary by the caller, not by the callee. gcc/testsuite/ChangeLog: PR fortran/86277 * gfortran.dg/zero_sized_14.f90: New test. * gfortran.dg/zero_sized_15.f90: New test. Co-authored-by: Mikael Morin <mikael@gcc.gnu.org>
2023-06-13Remove a couple mudflap remnantsJeff Law1-2/+2
I happened to be digging into the specs to understand a build failure and spotted mflib and mfwrap. Those were used by the mudflap system which we ripped out years ago and we just missed these. I verified x86 still bootstraps after removing these bits. Pushed to the trunk as obvious, gcc/ * gcc.cc (LINK_COMMAND_SPEC): Remove mudflap spec handling.
2023-06-13Remove sh5media divtab codeJeff Law1-203/+0
Spurred by Akari Takahashi's patch to config/sh/divtab.cc, this removes divtab.cc completely. divtab.cc was used to calculate a division table for the sh5 media processor. GCC dropped support for that (unmanufactured) chip back in 2016 and this file simply got missed AFAICT. gcc/ * config/sh/divtab.cc: Remove.
2023-06-13i386: Fix up whitespace in assemblyJakub Jelinek1-3/+3
I've noticed that standard_sse_constant_opcode emits some spurious whitespace around tab, that isn't something which is done for any other instruction and looks wrong. 2023-06-13 Jakub Jelinek <jakub@redhat.com> * config/i386/i386.cc (standard_sse_constant_opcode): Remove superfluous spaces around \t for vpcmpeqd.
2023-06-13Avoid duplicate vector initializations during RTL expansion.Roger Sayle1-2/+5
This middle-end patch avoids some redundant RTL for vector initialization during RTL expansion. For the simple test case: typedef __int128 v1ti __attribute__ ((__vector_size__ (16))); __int128 key; v1ti foo() { return (v1ti){key}; } the middle-end currently expands: (set (reg:V1TI 85) (const_vector:V1TI [ (const_int 0) ])) (set (reg:V1TI 85) (mem/c:V1TI (symbol_ref:DI ("key")))) where we create a dead instruction that initializes the vector to zero, immediately followed by a set of the entire vector. This patch skips this zeroing instruction when the vector has only a single element. It also updates the code to indicate when we've cleared the vector, so that we don't need to initialize zero elements. 2023-06-13 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog * expr.cc (store_constructor) <case VECTOR_TYPE>: Don't bother clearing vectors with only a single element. Set CLEARED if the vector was initialized to zero.
2023-06-13RISC-V: Remove duplicate `#include "riscv-vector-switch.def"`Lehua Ding1-1/+2
Hi, This patch remove the duplicate `#include "riscv-vector-switch.def"` statement and add #undef for ENTRY and TUPLE_ENTRY macros later. Best, Lehua gcc/ChangeLog: * config/riscv/riscv-v.cc (struct mode_vtype_group): Remove duplicate #include. (ENTRY): Undef. (TUPLE_ENTRY): Undef.
2023-06-13RISC-V: Add comments of some functionsJuzhe-Zhong1-0/+7
gcc/ChangeLog: * config/riscv/riscv-v.cc (rvv_builder::single_step_npatterns_p): Add comment. (shuffle_generic_patterns): Ditto. (expand_vec_perm_const_1): Ditto.
2023-06-13RISC-V: Add more SLP testsJuzhe-Zhong10-0/+393
gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/partial/slp-10.c: New test. * gcc.target/riscv/rvv/autovec/partial/slp-11.c: New test. * gcc.target/riscv/rvv/autovec/partial/slp-13.c: New test. * gcc.target/riscv/rvv/autovec/partial/slp-14.c: New test. * gcc.target/riscv/rvv/autovec/partial/slp-15.c: New test. * gcc.target/riscv/rvv/autovec/partial/slp_run-10.c: New test. * gcc.target/riscv/rvv/autovec/partial/slp_run-11.c: New test. * gcc.target/riscv/rvv/autovec/partial/slp_run-13.c: New test. * gcc.target/riscv/rvv/autovec/partial/slp_run-14.c: New test. * gcc.target/riscv/rvv/autovec/partial/slp_run-15.c: New test.
2023-06-13RISC-V: Fix bug of VLA SLP auto-vectorizationJuzhe-Zhong3-4/+71
Sorry for producing bugs in the previous VLA SLP patch. Consider this following permutation: _85 = VEC_PERM_EXPR <{ 99, 17, ... }, { 11, 80, ... }, { 0, POLY_INT_CST [4, 4], 1, POLY_INT_CST [5, 4], 2, POLY_INT_CST [6, 4], ... }>; The correct result should be: _85 = { 99, 11, 17, 80, ... } However, I did wrong in the previous patch. Code sequence before this patch: set mask = { 0, 1, 0, 1, ... } set v0 = { 99, 17, 99, 17, ... } set v1 = { 11, 80, 11, 80, ... } set index = viota (mask) = { 0, 0, 1, 1, 2, 2, ... } set result = vrgather_mu (v0, v1, index, mask) = { 99, 11, 99, 80 } The result is incorrect. After this patch: set mask = { 0, 1, 0, 1, ... } set index = viota (mask) = { 0, 0, 1, 1, 2, 2, ... } set v0 = vrgather ({ 99, 17, 99, 17, ... }, index) = { 99, 99, 17, 17, ... } set v1 = { 11, 80, 11, 80, ... } set result = vrgather_mu (v0, v1, index, mask) = { 99, 11, 17, 80 } The result is what we expected. This issue was discovered in the test I appended in this patch with --param=riscv-autovec-lmul=2. gcc/ChangeLog: * config/riscv/riscv-v.cc (emit_vlmax_decompress_insn): Fix bug. (shuffle_decompress_patterns): Ditto. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/partial/slp-12.c: New test. * gcc.target/riscv/rvv/autovec/partial/slp_run-12.c: New test.
2023-06-13Fix memory leak in loop header copyingRichard Biener1-0/+1
* tree-ssa-loop-ch.cc (ch_base::copy_headers): Free loop BBs.
2023-06-13c++: mutable temps in rodataJason Merrill2-0/+19
If the type of a temporary has mutable members, we can't set TREE_READONLY on the VAR_DECL; this is parallel to the check in cp_apply_type_quals_to_decl. gcc/cp/ChangeLog: * tree.cc (build_target_expr): Check TYPE_HAS_MUTABLE_P. gcc/testsuite/ChangeLog: * g++.dg/tree-ssa/initlist-opt6.C: New test.
2023-06-13RISC-V: Add vector psabi checking.Yanzhang Wang26-19/+228
This patch adds support to check function's argument or return is vector type and throw warning if yes. There're two exceptions, - The vector_size attribute. - The intrinsic functions. Some cases that need to add -Wno-psabi to ignore the warning. gcc/ChangeLog: * config/riscv/riscv-protos.h (riscv_init_cumulative_args): Set warning flag if func is not builtin * config/riscv/riscv.cc (riscv_scalable_vector_type_p): Determine whether the type is scalable vector. (riscv_arg_has_vector): Determine whether the arg is vector type. (riscv_pass_in_vector_p): Check the vector type param is passed by value. (riscv_init_cumulative_args): The same as header. (riscv_get_arg_info): Add the checking. (riscv_function_value): Check the func return and set warning flag * config/riscv/riscv.h (INIT_CUMULATIVE_ARGS): Add a flag to determine whether warning psabi or not. gcc/testsuite/ChangeLog: * g++.target/riscv/rvv/base/pr109244.C: Add the -Wno-psabi. * g++.target/riscv/rvv/base/pr109535.C: Same * gcc.target/riscv/rvv/base/binop_vx_constraint-120.c: Same * gcc.target/riscv/rvv/base/integer_compare_insn_shortcut.c: Same * gcc.target/riscv/rvv/base/mask_insn_shortcut.c: Same * gcc.target/riscv/rvv/base/misc_vreinterpret_vbool_vint.c: Same * gcc.target/riscv/rvv/base/pr110109-2.c: Same * gcc.target/riscv/rvv/base/scalar_move-9.c: Same * gcc.target/riscv/rvv/base/spill-10.c: Same * gcc.target/riscv/rvv/base/spill-11.c: Same * gcc.target/riscv/rvv/base/spill-9.c: Same * gcc.target/riscv/rvv/base/vlmul_ext-1.c: Same * gcc.target/riscv/rvv/base/zero_base_load_store_optimization.c: Same * gcc.target/riscv/rvv/base/zvfh-intrinsic.c: Same * gcc.target/riscv/rvv/base/zvfh-over-zvfhmin.c: Same * gcc.target/riscv/rvv/base/zvfhmin-intrinsic.c: Same * gcc.target/riscv/rvv/vsetvl/vsetvl-1.c: Same * gcc.target/riscv/vector-abi-1.c: New test. * gcc.target/riscv/vector-abi-2.c: New test. * gcc.target/riscv/vector-abi-3.c: New test. * gcc.target/riscv/vector-abi-4.c: New test. * gcc.target/riscv/vector-abi-5.c: New test. * gcc.target/riscv/vector-abi-6.c: New test. Signed-off-by: Yanzhang Wang <yanzhang.wang@intel.com> Co-authored-by: Kito Cheng <kito.cheng@sifive.com>
2023-06-13libgomp/testsuite: Add requires-unified-addr-1.{c,f90} [PR109837]Tobias Burnus2-0/+185
Add a testcase for 'omp requires unified_address' that is currently supported by all devices but was not tested for. libgomp/ PR libgomp/109837 * testsuite/libgomp.c-c++-common/requires-unified-addr-1.c: New test. * testsuite/libgomp.fortran/requires-unified-addr-1.f90: New test.
2023-06-13arm: Extend -mtp= argumentsKyrylo Tkachov12-12/+93
After discussing the -mtp= option with Arm's LLVM developers we'd like to extend the functionality of the option somewhat. There are actually 3 system registers that can be accessed for the thread pointer in aarch32: tpidrurw, tpidruro, tpidrprw. They are all read through the CP15 co-processor mechanism. The current -mtp=cp15 option reads the tpidruro register. This patch extends -mtp to allow for the above three explicit tpidr names and keeps -mtp=cp15 as an alias of -mtp=tpidruro for backwards compatibility. Bootstrapped and tested on arm-none-linux-gnueabihf. gcc/ChangeLog: * config/arm/arm-opts.h (enum arm_tp_type): Remove TP_CP15. Add TP_TPIDRURW, TP_TPIDRURO, TP_TPIDRPRW values. * config/arm/arm-protos.h (arm_output_load_tpidr): Declare prototype. * config/arm/arm.cc (arm_option_reconfigure_globals): Replace TP_CP15 with TP_TPIDRURO. (arm_output_load_tpidr): Define. * config/arm/arm.h (TARGET_HARD_TP): Define in terms of TARGET_SOFT_TP. * config/arm/arm.md (load_tp_hard): Call arm_output_load_tpidr to output assembly. (reload_tp_hard): Likewise. * config/arm/arm.opt (tpidrurw, tpidruro, tpidrprw): New values for arm_tp_type. * doc/invoke.texi (Arm Options, mtp): Document new values. gcc/testsuite/ChangeLog: * gcc.target/arm/mtp.c: New test. * gcc.target/arm/mtp_1.c: New test. * gcc.target/arm/mtp_2.c: New test. * gcc.target/arm/mtp_3.c: New test. * gcc.target/arm/mtp_4.c: New test.
2023-06-13aarch64: Extend -mtp= argumentsKyrylo Tkachov9-8/+60
After discussing the -mtp= option with Arm's LLVM developers we'd like to extend the functionality of the option somewhat. First of all, there is another TPIDR register that can be used to read the thread pointer: TPIDRRO_EL0 (which can also be accessed by AArch32 under another name) so it makes sense to add -mtp=tpidrr0_el0. This makes the existing arguments el0, el1, el2, el3 somewhat inconsistent in their naming so this patch introduces the more "full" names tpidr_el0, tpidr_el1, tpidr_el2, tpidr_el3 and makes the above short names alias of these new ones. Long story short, we preserve backwards compatibility and add a new TPIDR register to access through -mtp that wasn't available previously. There is more relevant discussion of the options at https://reviews.llvm.org/D152433 if you're interested. Bootstrapped and tested on aarch64-none-linux-gnu. gcc/ChangeLog: PR target/108779 * config/aarch64/aarch64-opts.h (enum aarch64_tp_reg): Add AARCH64_TPIDRRO_EL0 value. * config/aarch64/aarch64.cc (aarch64_output_load_tp): Define. * config/aarch64/aarch64.opt (tpidr_el0, tpidr_el1, tpidr_el2, tpidr_el3, tpidrro_el3): New accepted values to -mtp=. * doc/invoke.texi (AArch64 Options): Document new -mtp= options. gcc/testsuite/ChangeLog: PR target/108779 * gcc.target/aarch64/mtp_5.c: New test. * gcc.target/aarch64/mtp_6.c: New test. * gcc.target/aarch64/mtp_7.c: New test. * gcc.target/aarch64/mtp_8.c: New test. * gcc.target/aarch64/mtp_9.c: New test.
2023-06-13fix frange_nextafter odr violationAlexandre Oliva1-3/+3
C++ requires inline functions to be declared inline and defined in every translation unit that uses them. frange_nextafter is used in gimple-range-op.cc but it's only defined as inline in range-op-float.cc. Drop the extraneous inline specifier. Other non-static inline functions in range-op-float.cc are not referenced elsewhere, so I'm making them static. for gcc/ChangeLog * range-op-float.cc (frange_nextafter): Drop inline. (frelop_early_resolve): Add static. (frange_float): Likewise.
2023-06-13middle-end/110232 - fix native interpret of vector <signed-boolean:1>Richard Biener2-7/+16
The following fixes native interpretation of a buffer as boolean vector with bit-precision elements such as AVX512 vectors. The check whether the buffer covers the whole vector was broken for bit-precision elements and the following instead implements it based on the vector type size. PR middle-end/110232 * fold-const.cc (native_interpret_vector): Use TYPE_SIZE_UNIT to check whether the buffer covers the whole vector. * gcc.target/i386/pr110232.c: New testcase.
2023-06-13Fix disambiguation against .MASK_LOADRichard Biener1-1/+4
Alias analysis was treating .MASK_LOAD as storing a full vector which means we disambiguate against decls of smaller than vector size. This complements the previous patch handling .MASK_STORE and fixes runtime execution FAILs of gfortran.dg/matmul_3.f90 and gfortran.dg/inline_sum_2.f90 when using AVX512 with full masked loop vectorization on Zen4. * tree-ssa-alias.cc (ref_maybe_used_by_call_p_1): For .MASK_LOAD and friends set the size of the access to unknown.
2023-06-13testsuite: Update powerpc test fold-vec-extract-int.p8.c“Ajit Kumar Agarwal”1-2/+2
Update powerpc tests with extra zero_extend removal with default ree pass. 2023-06-13 Ajit Kumar Agarwal <aagarwa1@linux.ibm.com> gcc/testsuite/ChangeLog: PR testsuite/109880 * gcc.target/powerpc/fold-vec-extract-int.p8.c: Update test.
2023-06-13testsuite: Check int128 effective target for pr109932-{1,2}.c [PR110230]Kewen Lin2-0/+2
This patch is to make newly added test cases pr109932-{1,2}.c check int128 effective target to avoid unsupported type error on 32-bit. I did hit this failure during testing and fixed it, but made a stupid mistake not updating the local formatted patch which was actually out of date. PR testsuite/110230 PR target/109932 gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr109932-1.c: Adjust with int128 effective target. * gcc.target/powerpc/pr109932-2.c: Ditto.
2023-06-13ada: Fix decoration of iterated component association for GNATprovePiotr Trojanek1-8/+1
This patch is an alternative solution for a recent fix in analysis of iterated component association. To recap, if the iterated expression is an aggregate, we want to propagate the component type downward with a call to Resolve_Aggr_Expr; otherwise we want this expression to be only preanalysed (since the association might need to be repeatedly evaluated), but also we need to apply predicate and range checks to the expression itself (these are required for GNATprove). It turns out that Resolve_Aggr_Expr already knows how to deal with a nested aggregate and also works for GNATprove, where it both preanalyzes the expression and applies necessary checks. In other words, expression of the iterated component association is now resolved just like expression of an ordinary array aggregate. gcc/ada/ * sem_aggr.adb (Resolve_Iterated_Component_Association): Simply resolve the expression.
2023-06-13ada: Add missing ss_mark/ss_release in quantified expressionsBob Duff1-0/+26
If a quantified expression says "for all ... of F(...)" where F(...) is a function call that returns on the secondary stack, we need to clean up the secondary stack. This patch adds the required ss_mark/ss_release in that case. gcc/ada/ * exp_ch4.adb (Expand_N_Quantified_Expression): Detect the secondary-stack case, and find the innermost scope where we should mark/release, and Set_Uses_Sec_Stack on that. Skip intermediate blocks and loops that are part of expansion.
2023-06-13ada: Recognize iterated_component_association as repeatedly evaluatedPiotr Trojanek1-1/+2
As iterated_component_association is an array_component_association (because of a grammar rule Ada 2022 RM 4.3.3(5/5)), its expression is repeatedly evaluated (because of Ada 2022 RM 6.1.1(22.14/5)). With this patch we will now get errors for both conjuncts in this code, which have semantically equivalent array aggregates that use an ordinary component association and iterated component association. procedure Iter (S : String) with Post => String'(for J in 1 .. 3 => S (S'First)'Old) = String'( 1 .. 3 => S (S'First)'Old); gcc/ada/ * sem_util.adb (Is_Repeatedly_Evaluated): Recognize iterated component association as repeatedly evaluated.
2023-06-13ada: Recognize iterated_component_association as potentially unevaluatedPiotr Trojanek1-4/+10
Routine Is_Potentially_Unevaluated was written for Ada 2012, but now we use it for Ada 2022 as well, so it must recognize iterated component associations (which were added by Ada 2022) as an array component association. gcc/ada/ * sem_util.adb (Is_Potentially_Unevaluated): Recognize iterated component association as potentially unevaluated.
2023-06-13ada: Disable inlining in potentially unevaluated contextsPiotr Trojanek1-15/+6
Instead of explicitly disabling inlining in quantified expressions, (which happen to be only preanalysed) and then disabling inlining in potentially unevaluated contexts that are fully analysed (which happen to include quantified expressions), we now simply disable inlining in all potentially unevaluated contexts, regardless of the full analysis mode. This also disables inlining in iterated component associations, which can be both preanalysed or fully analysed depending on their expression, but nevertheless are potentially unevaluated. gcc/ada/ * sem_res.adb (Resolve_Call): Replace early call to In_Quantified_Expression with a call to Is_Potentially_Unevaluated that was only done when Full_Analysis is true.
2023-06-13ada: Implement new aspect Always_Terminates for SPARKPiotr Trojanek17-24/+295
This patch allows subprograms to be annotated with aspect Always_Terminates that requires a boolean expression. When this expression evaluates to True, the subprogram is required to terminate or raise an exception, but not loop infinitely. This aspect is only meant to be used by GNATprove and it has no meaningful run-time semantics: either the annotated subprogram terminates and then the aspect expression doesn't matter, or the subprogram loops infinitely and there is nothing we can do. (We could also evaluate the aspect expression just to detect run-time errors in the expression itself, but this can be implemented later, after a backend support for the aspect is added to GNATprove.) Implementation of this aspect is heavily based on the implementation of Subprogram_Variant, which in turn is heavily based on the implementation of Contract_Cases. Since the new aspect is not yet expanded, there is no corresponding assertion kind that would control the expansion. gcc/ada/ * aspects.ads (Aspect_Id): Add new aspect. (Implementation_Defined_Aspect): New aspect is implementation-defined. (Aspect_Argument): New aspect has an expression argument. (Is_Representation_Aspect): New aspect is not a representation aspect. (Aspect_Names): Link new aspect identifier with a name. (Aspect_Delay): New aspect is never delayed. * contracts.adb (Expand_Subprogram_Contract): Mention new aspect in comment. (Add_Contract_Item): Attach pragma corresponding to the new aspect to contract items. (Analyze_Entry_Or_Subprogram_Contract): Analyze pragma corresponding to the new aspect that appears with subprogram spec. (Analyze_Subprogram_Body_Stub_Contract): Expand pragma corresponding to the new aspect. * contracts.ads (Add_Contract_Item, Analyze_Entry_Or_Subprogram_Contract) (Analyze_Entry_Or_Subprogram_Body_Contract) (Analyze_Subprogram_Body_Stub_Contract): Mention new aspect in comment. * einfo-utils.adb (Get_Pragma): Return pragma attached to contract. * einfo-utils.ads (Get_Pragma): Mention new contract in comment. * exp_prag.adb (Expand_Pragma_Always_Terminates): Placeholder for possibly expanding new aspect. * exp_prag.ads (Expand_Pragma_Always_Terminates): Dedicated routine for expansion of the new aspect. * inline.adb (Remove_Aspects_And_Pragmas): Remove aspect from inlined bodies. * par-prag.adb (Prag): Postpone checking of the pragma until analysis. * sem_ch12.adb: Mention new aspect in explanation of handling contracts on generic units. * sem_ch13.adb (Analyze_Aspect_Specifications): Convert new aspect into a corresponding pragma. (Check_Aspect_At_Freeze_Point): Don't expect new aspect. * sem_prag.adb (Analyze_Always_Terminates_In_Decl_Part): Analyze pragma corresponding to the new aspect. (Analyze_Pragma): Handle pragma corresponding to the new aspect. (Is_Non_Significant_Pragma_Reference): Handle references appearing within new aspect. * sem_prag.ads (Aspect_Specifying_Pragma): New aspect can be emulated with a pragma. (Assertion_Expression_Pragma): New aspect has an assertion expression. (Pragma_Significant_To_Subprograms): New aspect is significant to subprograms. (Analyze_Always_Terminates_In_Decl_Part): Add spec for routine that analyses new aspect. (Find_Related_Declaration_Or_Body): Mention new aspect in comment. * sem_util.adb (Is_Subprogram_Contract_Annotation): New aspect is a subprogram contract annotation. * sem_util.ads (Is_Subprogram_Contract_Annotation): Mention new aspect in comment. * sinfo.ads (Is_Generic_Contract_Pragma): New pragma is a generic contract. (Contract): Explain attaching new pragma to subprogram contract. * snames.ads-tmpl (Name_Always_Terminates): New name for the new contract. (Pragma_Always_Terminates): New pragma identifier.
2023-06-13ada: Skip elaboration checks for abstract subprograms on derived typesPiotr Trojanek1-1/+4
Elaboration checks skip abstract subprogram declarations, which have no body that could be examined. Now these checks also skip abstract subprograms of a derived type, which have no body either. gcc/ada/ * sem_elab.adb (Check_Overriding_Primitive): Prevent Corresponding_Body to be called with entity of an abstract subprogram.
2023-06-13ada: Fix another case of missing Has_Private_View flagEric Botcazou1-1/+1
It occurs for the case of a function call first parsed as an identifier. gcc/ada/ * sem_ch12.adb (Save_References_In_Identifier): In the case where the identifier has been turned into a function call by analysis, call Set_Global_Type on the entity if it is global.
2023-06-13ada: Fix iterated component initializationMarc Poulhiès1-3/+8
The call to Resolve_Aggr_Expr may leave references to temporary entities used to check for the construct legality and meant to be removed. Using Preanalyze_And_Resolve correctly guarantees that there is no visible occurrence of such entities. gcc/ada/ * sem_aggr.adb (Resolve_Iterated_Component_Association): Call Preanalyze_And_Resolve instead of Resolve_Aggr_Expr except for aggregate. Co-authored-by: Ed Schonberg <schonberg@adacore.com>
2023-06-13ada: Fix exception raised on invalid contract in generic packageEric Botcazou1-10/+21
This lets the compiler give a proper error message instead. gcc/ada/ * contracts.adb (Contract_Error): New exception. (Add_Contract_Item): Raise Contract_Error instead of Program_Error. (Add_Generic_Contract_Pragma): Deal with Contract_Error.