Re: [PATCH 1/6] aarch64: Sync system register information with Binutils

2023-10-05 Thread Richard Earnshaw
On 03/10/2023 16:18, Victor Do Nascimento wrote: This patch adds the `aarch64-sys-regs.def' file to GCC, teaching the compiler about system registers known to the assembler and how these can be used. The macros used to hold system register information reflect those in use by binutils, a desig

Re: [PATCH 2/6] aarch64: Add support for aarch64-sys-regs.def

2023-10-05 Thread Richard Earnshaw
On 03/10/2023 16:18, Victor Do Nascimento wrote: This patch defines the structure of a new .def file used for representing the aarch64 system registers, what information it should hold and the basic framework in GCC to process this file. Entries in the aarch64-system-regs.def file should be a

Re: [PATCH 3/6] aarch64: Implement system register validation tools

2023-10-05 Thread Richard Earnshaw
On 03/10/2023 16:18, Victor Do Nascimento wrote: Given the implementation of a mechanism of encoding system registers into GCC, this patch provides the mechanism of validating their use by the compiler. In particular, this involves: 1. Ensuring a supplied string corresponds to a known sys

Re: [PATCH 4/6] aarch64: Add basic target_print_operand support for CONST_STRING

2023-10-05 Thread Richard Earnshaw
On 03/10/2023 16:18, Victor Do Nascimento wrote: Motivated by the need to print system register names in output assembly, this patch adds the required logic to `aarch64_print_operand' to accept rtxs of type CONST_STRING and process these accordingly. Consequently, an rtx such as: (set (re

Re: [PATCH 5/6] aarch64: Implement system register r/w arm ACLE intrinsic functions

2023-10-05 Thread Richard Earnshaw
On 03/10/2023 16:18, Victor Do Nascimento wrote: Implement the aarch64 intrinsics for reading and writing system registers with the following signatures: uint32_t __arm_rsr(const char *special_register); uint64_t __arm_rsr64(const char *special_register); void* __arm_r

Re: [PATCH 6/6] aarch64: Add front-end argument type checking for target builtins

2023-10-05 Thread Richard Earnshaw
On 03/10/2023 16:18, Victor Do Nascimento wrote: In implementing the ACLE read/write system register builtins it was observed that leaving argument type checking to be done at expand-time meant that poorly-formed function calls were being "fixed" by certain optimization passes, meaning bad cod

Re: [PATCH 4/6] aarch64: Add basic target_print_operand support for CONST_STRING

2023-10-05 Thread Richard Earnshaw
On 05/10/2023 13:26, Richard Earnshaw wrote: On 03/10/2023 16:18, Victor Do Nascimento wrote: Motivated by the need to print system register names in output assembly, this patch adds the required logic to `aarch64_print_operand' to accept rtxs of type CONST_STRING and process

Re: [PATCH 1/2] arm: Use deltas for Arm switch tables

2023-10-19 Thread Richard Earnshaw
On 28/09/2023 14:26, Richard Ball wrote: For normal optimization for the Arm state in gcc we get an uncompressed table of jump targets. This is in the middle of the text segment far larger than necessary, especially at -Os. This patch compresses the table to use deltas in a similar manner to T

Re: [PATCH 2/2] arm: move the switch tables for Arm to the RO data section.

2023-10-19 Thread Richard Earnshaw
On 28/09/2023 14:29, Richard Ball wrote: Follow up patch to arm: Use deltas for Arm switch tables This patch moves the switch tables for Arm from the .text section into the .rodata section. gcc/ChangeLog: * config/arm/aout.h: Change to use the Lrtx label. * config/arm/arm.h (

[PATCH 0/7] Mitigation against unsafe data speculation (CVE-2017-5753)

2018-07-09 Thread Richard Earnshaw
lf. There appear to be a number of tricky issues with more complex edges so I'd like a second opinion on that code in case I've missed an important case. R. Richard Earnshaw (7): Add __builtin_speculation_safe_value Arm - add speculation_barrier pattern AArch64 - add speculati

[PATCH 2/7] Arm - add speculation_barrier pattern

2018-07-09 Thread Richard Earnshaw
This patch defines a speculation barrier for AArch32. * config/arm/unspecs.md (unspecv): Add VUNSPEC_SPECULATION_BARRIER. * config/arm/arm.md (speculation_barrier): New expand. (speculation_barrier_insn): New pattern. --- gcc/config/arm/arm.md | 21 +++

[PATCH 3/7] AArch64 - add speculation barrier

2018-07-09 Thread Richard Earnshaw
Similar to Arm, this adds an unconditional speculation barrier for AArch64. * config/aarch64.md (unspecv): Add UNSPECV_SPECULAION_BARRIER. (speculation_barrier): New insn. --- gcc/config/aarch64/aarch64.md | 10 ++ 1 file changed, 10 insertions(+) diff --git a/gcc/config

[PATCH 4/7] AArch64 - Add new option -mtrack-speculation

2018-07-09 Thread Richard Earnshaw
This patch doesn't do anything useful, it simply adds a new command-line option -mtrack-speculation to AArch64. Subsequent patches build on this. * config/aarch64/aarch64.opt (mtrack-speculation): New target option. --- gcc/config/aarch64/aarch64.opt | 4 1 file changed, 4 insertio

[PATCH 1/7] Add __builtin_speculation_safe_value

2018-07-09 Thread Richard Earnshaw
This patch defines a new intrinsic function __builtin_speculation_safe_value. A generic default implementation is defined which will attempt to use the backend pattern "speculation_safe_barrier". If this pattern is not defined, or if it is not available, then the compiler will emit a warning, bu

[PATCH 7/7] AArch64 - use CSDB based sequences if speculation tracking is enabled

2018-07-09 Thread Richard Earnshaw
In this final patch, now that we can track speculation through conditional branches, we can use this information to use a less expensive CSDB based speculation barrier. * config/aarch64/iterators.md (ALLI_TI): New iterator. * config/aarch64/aarch64.md (despeculate_copy): New

[PATCH 6/7] AArch64 - new pass to add conditional-branch speculation tracking

2018-07-09 Thread Richard Earnshaw
This patch is the main part of the speculation tracking code. It adds a new target-specific pass that is run just before the final branch reorg pass (so that it can clean up any new edge insertions we make). The pass is only run with -mtrack-speculation is passed on the command line. One thing t

[PATCH 5/7] AArch64 - disable CB[N]Z TB[N]Z when tracking speculation

2018-07-09 Thread Richard Earnshaw
The CB[N]Z and TB[N]Z instructions do not expose the comparison through the condition code flags. This makes it impossible to track speculative execution through such a branch. We can handle this relatively easily by simply disabling the patterns in this case. A side effect of this is that the

[PATCH 03/11] AArch64 - add speculation barrier

2018-07-27 Thread Richard Earnshaw
Similar to Arm, this adds an unconditional speculation barrier for AArch64. * config/aarch64.md (unspecv): Add UNSPECV_SPECULAION_BARRIER. (speculation_barrier): New insn. --- gcc/config/aarch64/aarch64.md | 10 ++ 1 file changed, 10 insertions(+) diff --git a/gcc/config

[PATCH 00/11] (v2) Mitigation against unsafe data speculation (CVE-2017-5753)

2018-07-27 Thread Richard Earnshaw
ew from someone more familiar with the branch edge code than myself. There appear to be a number of tricky issues with more complex edges so I'd like a second opinion on that code in case I've missed an important case. R. Richard Earnshaw (11): Add __builtin_speculation_safe_value

[PATCH 02/11] Arm - add speculation_barrier pattern

2018-07-27 Thread Richard Earnshaw
This patch defines a speculation barrier for AArch32. * config/arm/unspecs.md (unspecv): Add VUNSPEC_SPECULATION_BARRIER. * config/arm/arm.md (speculation_barrier): New expand. (speculation_barrier_insn): New pattern. --- gcc/config/arm/arm.md | 21 +++

[PATCH 06/11] AArch64 - new pass to add conditional-branch speculation tracking

2018-07-27 Thread Richard Earnshaw
This patch is the main part of the speculation tracking code. It adds a new target-specific pass that is run just before the final branch reorg pass (so that it can clean up any new edge insertions we make). The pass is only run with -mtrack-speculation is passed on the command line. One thing t

[PATCH 01/11] Add __builtin_speculation_safe_value

2018-07-27 Thread Richard Earnshaw
This patch defines a new intrinsic function __builtin_speculation_safe_value. A generic default implementation is defined which will attempt to use the backend pattern "speculation_safe_barrier". If this pattern is not defined, or if it is not available, then the compiler will emit a warning, bu

[PATCH 07/11] AArch64 - use CSDB based sequences if speculation tracking is enabled

2018-07-27 Thread Richard Earnshaw
In this final patch, now that we can track speculation through conditional branches, we can use this information to use a less expensive CSDB based speculation barrier. * config/aarch64/iterators.md (ALLI_TI): New iterator. * config/aarch64/aarch64.md (despeculate_copy): New

[PATCH 09/11] pdp11 - example of a port not needing a speculation barrier

2018-07-27 Thread Richard Earnshaw
This patch is intended as an example of all that is needed if the target system doesn't support CPUs that have speculative execution. I've chosen the pdp11 port on the basis that it's old enough that this is likely to be true for all existing implementations and that there is also little chance of

[PATCH 10/11] x86 - add speculation_barrier pattern

2018-07-27 Thread Richard Earnshaw
This patch adds a speculation barrier for x86, based on my understanding of the required mitigation for that CPU, which is to use an lfence instruction. This patch needs some review by an x86 expert and if adjustments are needed, I'd appreciate it if they could be picked up by the port maintainer

[PATCH 08/11] targhooks - provide an alternative hook for targets that never execute speculatively

2018-07-27 Thread Richard Earnshaw
This hook adds an alternative implementation for the target hook TARGET_HAVE_SPECULATION_SAFE_VALUE; it can be used by targets that have no CPU implementations that execute code speculatively. All that is needed for such targets now is to add: #undef TARGET_HAVE_SPECULATION_SAFE_VALUE #define

[PATCH 05/11] AArch64 - disable CB[N]Z TB[N]Z when tracking speculation

2018-07-27 Thread Richard Earnshaw
The CB[N]Z and TB[N]Z instructions do not expose the comparison through the condition code flags. This makes it impossible to track speculative execution through such a branch. We can handle this relatively easily by simply disabling the patterns in this case. A side effect of this is that the

[PATCH 04/11] AArch64 - Add new option -mtrack-speculation

2018-07-27 Thread Richard Earnshaw
This patch doesn't do anything useful, it simply adds a new command-line option -mtrack-speculation to AArch64. Subsequent patches build on this. * config/aarch64/aarch64.opt (mtrack-speculation): New target option. --- gcc/config/aarch64/aarch64.opt | 4 1 file changed, 4 insertio

[PATCH 11/11] rs6000 - add speculation_barrier pattern

2018-07-27 Thread Richard Earnshaw
This patch reworks the existing rs6000_speculation_barrier pattern to work with the new __builtin_sepculation_safe_value() intrinsic. The change is trivial as it simply requires renaming the existing speculation barrier pattern. So the total patch is to delete 14 characters! * config/rs

Re: [PATCH] AArch64: Improve immediate generation

2023-10-20 Thread Richard Earnshaw
On 19/10/2023 13:43, Wilco Dijkstra wrote: Further improve immediate generation by adding support for 2-instruction MOV/EOR bitmask immediates. This reduces the number of 3/4-instruction immediates in SPECCPU2017 by ~2%. Passes regress, OK for commit? gcc/ChangeLog: * config/aarch64

Re: [PATCH] aarch64: [PR110986] Emit csinv again for `a ? ~b : b`

2023-10-20 Thread Richard Earnshaw
On 20/10/2023 13:13, Richard Sandiford wrote: +(define_insn_and_split "*cmov_insn_insv" + [(set (match_operand:GPI 0 "register_operand" "=r") +(xor:GPI +(neg:GPI + (match_operator:GPI 1 "aarch64_comparison_operator" + [(match_operand 2 "cc_register" "") (const

Re: [PATCH v2] ARM: Block predication on atomics [PR111235]

2023-10-20 Thread Richard Earnshaw
On 02/10/2023 18:12, Wilco Dijkstra wrote: Hi Ramana, I used --target=arm-none-linux-gnueabihf --host=arm-none-linux-gnueabihf --build=arm-none-linux-gnueabihf --with-float=hard. However it seems that the default armhf settings are incorrect. I shouldn't need the --with-float=hard since tha

Re: [PATCH] testsuite: Fix gcc.target/arm/mve/mve_vadcq_vsbcq_fpscr_overwrite.c

2023-10-24 Thread Richard Earnshaw
On 08/09/2023 09:43, Christophe Lyon via Gcc-patches wrote: The test was declaring 'int *carry;' and wrote to '*carry' without initializing 'carry' first, leading to an attempt to write at address zero, and a crash. Fix by declaring 'int carry;' and passing '&carrry' instead of 'carry' as par

Re: [PATCH] config, aarch64: Use a more compatible sed invocation.

2023-10-25 Thread Richard Earnshaw
On 24/10/2023 16:53, Iain Sandoe wrote: Although this came up initially when working on the Darwin Arm64 port, it also breaks cross-compilers on platforms with non-GNU sed. Tested on x86_64-darwin X aarch64-linux-gnu, aarch64-darwin, aarch64-linux-gnu and x86_64-linux-gnu. OK for master? tha

Re: [PATCH v2] AArch64: Improve immediate generation

2023-10-25 Thread Richard Earnshaw
On 24/10/2023 18:27, Wilco Dijkstra wrote: v2: Use check-function-bodies in tests Further improve immediate generation by adding support for 2-instruction MOV/EOR bitmask immediates. This reduces the number of 3/4-instruction immediates in SPECCPU2017 by ~2%. Passes regress, OK for commit?

Re: [PATCH 2/2 v2] arm: move the switch tables for Arm to the RO data section

2023-10-30 Thread Richard Earnshaw
On 27/10/2023 15:55, Richard Ball wrote: v2: Formatting and nits fixed. Follow up patch to arm: Use deltas for Arm switch tables This patch moves the switch tables for Arm from the .text section into the .rodata section. gcc/ChangeLog: * config/arm/aout.h: Change to use the Lrtx lab

Re: [PR47785] COLLECT_AS_OPTIONS

2019-10-28 Thread Richard Earnshaw
On 28/10/2019 21:52, Bernhard Reutner-Fischer wrote: > On Mon, 28 Oct 2019 11:53:06 +1100 > Kugan Vivekanandarajah wrote: > >> On Wed, 23 Oct 2019 at 23:07, Richard Biener >> wrote: > >>> Did you try this with multiple assembler options? I see you stream >>> them as -Wa,-mfpu=xyz,-mthumb but

Re: [wwwdocs] Recommend reviewing local changes before pushing them

2020-01-14 Thread Richard Earnshaw
On 14/01/2020 13:37, Jonathan Wakely wrote: > I really think people should be reviewing what they're about to push > before doing it. > > OK for wwwdocs? > I'd recommend git push origin HEAD: rather than just 'git push' Otherwise, OK. R.

Re: [wwwdocs] Fix indentation of .ssh/config snippet

2020-01-14 Thread Richard Earnshaw
On 14/01/2020 13:18, Jonathan Wakely wrote: > OK for wwwdocs? > > OK.

[PATCH] arm: correct constraints on movsi_compare0 [PR91913]

2020-02-10 Thread Richard Earnshaw
The peephole that detects a mov of one register to another followed by a comparison of the original register against zero is only used in Arm state; but the instruction that matches this is generic to all 32-bit compilation states. That instruction lacks support for SP which is permitted in Arm s

[PATCH] arm: check for low register before applying peephole [PR113510]

2024-03-05 Thread Richard Earnshaw
For thumb1, when using a peephole to fuse mov reg, #const add reg, reg, SP into add reg, SP, #const we must first check that reg is a low register, otherwise we will ICE when trying to recognize the resulting insn. gcc/ChangeLog: PR target/113510 * con

[PATCH] gomp: testsuite: improve compatibility of bad-array-section-3.c [PR113428]

2024-03-06 Thread Richard Earnshaw
This test generates different warnings on ilp32 targets because the size of an integer matches the size of a pointer. Avoid this by using signed char. gcc/testsuite: PR testsuite/113428 * gcc.dg/gomp/bad-array-section-c-3.c: Use signed char instead of int. --- I think t

[COMMITTED] arm: testsuite: tweak bics_3.c [PR113542]

2024-03-08 Thread Richard Earnshaw
This test was too simple, which meant that the compiler was sometimes able to find a better optimization of the code than using a BICS instruction. Fix this by changing the test slightly to produce a sequence where BICS should always be the preferred solution. gcc/testsuite: PR target/11

Re: [PATCH] [testsuite] Fixup dg-options in {gcc, g++, gfortran}.dg/vect.exp tests

2024-03-13 Thread Richard Earnshaw
On 13/03/2024 10:58, Maxim Kuvyrkov wrote: This patch has been tested on - aarch64-linux-gnu - arm-linux-gnueabihf (VFP, NEON disabled by default), - arm-none-eabi (Soft-FP) with the following [expected] differences in the test results: - FAIL now PASS [FAIL => PASS]: Execut

Re: [PATCH][GCC] aarch64: Fix SCHEDULER_IDENT for Cortex-A520

2024-03-13 Thread Richard Earnshaw
On 12/03/2024 14:08, Richard Ball wrote: The SCHEDULER_IDENT for this CPU was incorrectly set to cortexa55, which is incorrect. This can cause sub-optimal asm to be generated. Ok for trunk? gcc/ChangeLog: PR target/114272 * config/aarch64/aarch64-cores.def (AARCH64_CORE):

Re: [PATCH v2] [testsuite] Fixup dg-options in {gcc, g++, gfortran}.dg/vect.exp tests

2024-03-13 Thread Richard Earnshaw
On 13/03/2024 12:12, Maxim Kuvyrkov wrote: Changes in v2: - Better changelog entry. - NFC. This patch has been tested on - aarch64-linux-gnu - arm-linux-gnueabihf (VFP, NEON disabled by default), - arm-none-eabi (Soft-FP) with the following [expected] differences in the test results: - F

[PATCH] arm: testsuite: fix issues relating to fp16 alternative testing

2024-02-08 Thread Richard Earnshaw
The v*_fp16_xN_1.c tests on Arm have been unstable since they were added. This is not a problem with the tests themselves, or even the patches that were added, but with the testsuite infrastructure. It turned out that another set of dg- tests for fp16 were corrupting the cached set of options us

Re: [PATCH] testsuite: Disable test for incompatible Arm targets

2024-02-13 Thread Richard Earnshaw
On 13/02/2024 10:44, Torbjörn SVENSSON wrote: Ok for trunk and releases/gcc-13? The alternative approach (that is changing the result a bit) is to drop the special treatment for arm*-*-*. I'm not sure if this is prefered or just disable the test for incompatible flags for arm*-*-*. -- The t

[committed] arm: fix ICE with vectorized reciprocal division [PR108120]

2024-02-23 Thread Richard Earnshaw
The expand pattern for reciprocal division was enabled for all math optimization modes, but the patterns it was generating were not enabled unless -funsafe-math-optimizations were enabled, this leads to an ICE when the pattern we generate cannot be recognized. Fixed by only enabling vector divisi

[PATCH] arm: warn about deprecation of iwmmx in mmintrin.h

2024-02-27 Thread Richard Earnshaw
GCC 13's changes file documents that iwmmx is deprecated. Raise the bar by warning when the mmintrin.h header is included by users, but provide a way to suppress the warning. gcc: * config/arm/mmintrin.h: Warn if this header is included without defining __ENABLE_DEPRECATED_IWMMXT

Re: [PATCH] calls: Fix up TYPE_NO_NAMED_ARGS_STDARG_P handling [PR107453]

2024-02-27 Thread Richard Earnshaw
On 09/01/2023 10:32, Jakub Jelinek via Gcc-patches wrote: > Hi! > > On powerpc64le-linux, the following patch fixes > -FAIL: gcc.dg/c2x-stdarg-4.c execution test > -FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c -O0 execution test > -FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c -O1 execution te

Re: [PATCH] calls: Fix up TYPE_NO_NAMED_ARGS_STDARG_P handling [PR107453]

2024-02-27 Thread Richard Earnshaw
[resending, apologies, I accidentally CC'd the wrong person last time] On 27/02/2024 16:41, Richard Earnshaw wrote: > > > On 09/01/2023 10:32, Jakub Jelinek via Gcc-patches wrote: >> Hi! >> >> On powerpc64le-linux, the following patch fixes >> -FAIL

Re: [PATCH] calls: Fix up TYPE_NO_NAMED_ARGS_STDARG_P handling [PR107453]

2024-02-29 Thread Richard Earnshaw
On 29/02/2024 14:10, Richard Earnshaw (lists) wrote: > On 27/02/2024 17:25, Jakub Jelinek wrote: >> On Tue, Feb 27, 2024 at 04:41:32PM +, Richard Earnshaw wrote: >>>> 2023-01-09 Jakub Jelinek >>>> >>>>PR target/107453 >

Re: [PATCH v2] libgfortran: Bugfix if not define HAVE_ATOMIC_FETCH_ADD

2024-01-10 Thread Richard Earnshaw
On 05/01/2024 01:43, Lipeng Zhu wrote: This patch try to fix the bug when HAVE_ATOMIC_FETCH_ADD is not defined in dec_waiting_unlocked function. As io.h does not include async.h, the WRLOCK and RWUNLOCK macros are undefined. libgfortran/ChangeLog: * io/io.h (dec_waiting_unlocked): Use

Re: [PATCH][GCC][Arm] Define __ARM_FEATURE_BF16 when +bf16 feature is enabled

2024-01-10 Thread Richard Earnshaw
On 08/01/2024 17:21, Matthieu Longo wrote: Hi, Arm GCC backend does not define __ARM_FEATURE_BF16 when +bf16 is specified (via -march option, or target pragma) whereas it is supposed to be tested before including arm_bf16.h (as specified in ACLE document: https://arm-software.github.io/acl

Re: [libatomic PATCH] Fix testsuite regressions on ARM [raspberry pi].

2024-01-10 Thread Richard Earnshaw
On 08/01/2024 16:07, Roger Sayle wrote: Bootstrapping GCC on arm-linux-gnueabihf with --with-arch=armv6 currently has a large number of FAILs in libatomic (regressions since last time I attempted this). The failure mode is related to IFUNC handling with the file tas_8_2_.o containing an unre

Re: [PATCH][GCC][Arm] Add pattern for bswap + rotate -> rev16 [Bug 108933]

2024-01-29 Thread Richard Earnshaw
y and pushed this. Could you please prepare backports for gcc-11 thru 13? It should just be a matter of cherry-picking the commit. R. On 2024-01-22 16:25, Richard Earnshaw (lists) wrote: On 22/01/2024 12:18, Matthieu Longo wrote: rev16 pattern was not recognised anymore as a change in the

Re: [PATCH v7] libgfortran: Replace mutex with rwlock

2023-12-15 Thread Richard Earnshaw
On 15/12/2023 11:31, Lipeng Zhu wrote: On 2023/12/14 23:50, Richard Earnshaw (lists) wrote: On 09/12/2023 15:39, Lipeng Zhu wrote: This patch try to introduce the rwlock and split the read/write to unit_root tree and unit_cache with rwlock instead of the mutex to increase CPU efficiency

Re: [PATCH] testsuite/arm: Fix bfloat16_vector_typecheck_[12].c tests

2023-11-30 Thread Richard Earnshaw
On 30/11/2023 10:15, Christophe Lyon wrote: After commit r14-5617-gb8592186611, int32x[24]_t types now use elements of 'long int' type instead of 'int' on arm-eabi (it's still 'int' on arm-linux-gnueabihf). Both are 32-bit types anyway. This patch adjust the two tests so that they optionnall

Re: [PATCH v2] AArch64: Fix strict-align cpymem/setmem [PR103100]

2023-11-30 Thread Richard Earnshaw
On 29/11/2023 18:09, Richard Sandiford wrote: Wilco Dijkstra writes: v2: Use UINTVAL, rename max_mops_size. The cpymemdi/setmemdi implementation doesn't fully support strict alignment. Block the expansion if the alignment is less than 16 with STRICT_ALIGNMENT. Clean up the condition when to

Re: [PATCH] aarch64: modify Ampere CPU tunings on reassociation/FMA

2023-11-30 Thread Richard Earnshaw
On 30/11/2023 08:27, Di Zhao OS wrote: This patch modifies tunings for ampere1/ampere1a/ampere1b, to: 1. Allow reassociation on FP additions. 2. Avoid generating loop-dependant FMA chains. Added a tuning option for this. Bootstrapped and tested. Is this ok for trunk? Thanks, Di Zhao gcc/Ch

Re: [PATCH v3 10/11] c: Turn -Wincompatible-pointer-types into a permerror

2023-12-05 Thread Richard Earnshaw
ns "-Wc++-compat" } */ +/* { dg-options "-fpermissive -Wc++-compat" } */ typedef struct A { int i; } B; typedef struct T { int i; } *T; /* { dg-warning "using 'T' as both a typedef and a tag is invalid" } */ diff --git a/gcc/testsuite/gcc.dg/diag-aka-1a

Re: [PATCH v3 10/11] c: Turn -Wincompatible-pointer-types into a permerror

2023-12-05 Thread Richard Earnshaw
On 05/12/2023 09:46, Florian Weimer wrote: * Richard Earnshaw: (I think it's this patch, not one of the others in the series). This breaks building libgfortran with newlib on arm and aarch64: /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c:2208:46:

Re: [PATCH] libgfortran: Fix -Wincompatible-pointer-types errors

2023-12-05 Thread Richard Earnshaw
On 05/12/2023 10:33, Jakub Jelinek wrote: Hi! On Tue, Dec 05, 2023 at 10:46:02AM +0100, Florian Weimer wrote: Presumably the fixes will look like this? diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index db3330060ce..4fcc77dbf83 100644 --- a/libgfortran/io/list_read.c

Re: [PATCH] libgfortran: Fix -Wincompatible-pointer-types errors

2023-12-05 Thread Richard Earnshaw
On 05/12/2023 10:51, Jakub Jelinek wrote: On Tue, Dec 05, 2023 at 10:47:34AM +, Richard Earnshaw wrote: The following patch makes libgfortran build on i686-linux after hacking up --- kinds.h.xx 2023-12-05 00:23:00.133365064 +0100 +++ kinds.h 2023-12-05 11:19:24.409679808 +0100

Re: [PATCH] libgfortran: Fix -Wincompatible-pointer-types errors

2023-12-05 Thread Richard Earnshaw
On 05/12/2023 10:59, Jakub Jelinek wrote: On Tue, Dec 05, 2023 at 10:57:50AM +, Richard Earnshaw wrote: On 05/12/2023 10:51, Jakub Jelinek wrote: On Tue, Dec 05, 2023 at 10:47:34AM +, Richard Earnshaw wrote: The following patch makes libgfortran build on i686-linux after hacking up

Re: [PATCH] [arm] testsuite: make mve_intrinsic_type_overloads-int.c libc-agnostic

2023-12-06 Thread Richard Earnshaw
Sorry, I only just spotted this while looking at something else. On 23/05/2023 15:41, Christophe Lyon via Gcc-patches wrote: Glibc defines int32_t as 'int' while newlib defines it as 'long int'. Although these correspond to the same size, g++ complains when using the

Re: [PATCH v2 6/7] aarch64,arm: Fix branch-protection= parsing

2023-12-07 Thread Richard Earnshaw
On 03/11/2023 15:36, Szabolcs Nagy wrote: Refactor the parsing to have a single API and fix a few parsing issues: - Different handling of "bti+none" and "none+bti": these should be rejected because "none" can only appear alone. - Accepted empty strings such as "bti++pac-ret" or "bti+", th

Re: [PATCH v2 7/7] aarch64,arm: Move branch-protection data to targets

2023-12-07 Thread Richard Earnshaw
On 03/11/2023 15:36, Szabolcs Nagy wrote: The branch-protection types are target specific, not the same on arm and aarch64. This currently affects pac-ret+b-key, but there will be a new type on aarch64 that is not relevant for arm. gcc/ChangeLog: * config/aarch64/aarch64-opts.h (enu

Re: [PATCH v2 0/3] [GCC] arm: vst1_types_xN ACLE intrinsics

2023-12-07 Thread Richard Earnshaw
Pushed, thanks. R. On 07/12/2023 15:28, ezra.sito...@arm.com wrote: Add xN variants of vst1_types intrinsic.

Re: [PATCH v2 0/3] [GCC] arm: vst1q_types_xN ACLE intrinsics

2023-12-07 Thread Richard Earnshaw
Pushed, thanks. R. On 07/12/2023 15:36, ezra.sito...@arm.com wrote: Add xN variants of vst1q_types intrinsic.

Re: [PATCH v2 0/3] [GCC] arm: vld1_types_xN ACLE intrinsics

2023-12-07 Thread Richard Earnshaw
Pushed, thanks. R. On 07/12/2023 15:41, ezra.sito...@arm.com wrote: Add xN variants of vld1_types intrinsic.

Re: [PATCH v2 0/3] [GCC] arm: vst1_types_xN ACLE intrinsics

2023-12-08 Thread Richard Earnshaw
Sorry, Ezra, but I've taken the decision to back out all 4 of the patch series' related to this. I think the problems that the CI has shown up need to be addressed first, and the fixes don't seem to be entirely trivial. R. On 07/12/2023 16:44, Richard Earnshaw wrote: Pus

Re: [PATCH 1/2] arm: Add define_attr to to create a mapping between MVE predicated and unpredicated insns

2023-12-12 Thread Richard Earnshaw
On 06/11/2023 11:20, Stamatis Markianos-Wright wrote: Patch has already been approved at: https://gcc.gnu.org/pipermail/gcc-patches/2023-September/630326.html ... But I'm sending this again for archiving on the list after rebasing A couple of minor nits: 1) +#define MVE_VPT_PREDICABLE_I

Re: [PATCH v2 0/3] [GCC] arm: vld1q_types_xN ACLE intrinsics

2023-12-12 Thread Richard Earnshaw
Pushed, thanks. R. On 07/12/2023 15:21, ezra.sito...@arm.com wrote: Add xN variants of vld1q_types intrinsic.

Re: [PING][PATCH 2/2] arm: Add support for MVE Tail-Predicated Low Overhead Loops

2023-12-12 Thread Richard Earnshaw
e (Arm) Thank you :) LGTM otherwise (but I don't have the power to approve this ;)). Kind regards, Andre From: Stamatis Markianos-Wright Sent: Thursday, November 16, 2023 11:36 AM To: Stamatis Markianos-Wright via Gcc-patches; Richard Earnshaw; Richard Sandifor

Re: [PATCH] AArch64: Cleanup memset expansion

2023-11-10 Thread Richard Earnshaw
On 10/11/2023 10:17, Wilco Dijkstra wrote: Hi Kyrill, +  /* Reduce the maximum size with -Os.  */ +  if (optimize_function_for_size_p (cfun)) +    max_set_size = 96; + This is a new "magic" number in this code. It looks sensible, but how did you arrive at it? We need 1 instruction

Re: [PATCH] AArch64: Cleanup memset expansion

2023-11-10 Thread Richard Earnshaw
On 10/11/2023 14:46, Kyrylo Tkachov wrote: -Original Message- From: Richard Earnshaw Sent: Friday, November 10, 2023 11:31 AM To: Wilco Dijkstra ; Kyrylo Tkachov ; GCC Patches Cc: Richard Sandiford ; Richard Earnshaw Subject: Re: [PATCH] AArch64: Cleanup memset expansion On

[committed 00/22] arm: testsuite: clean up some architecture-specific tests

2023-11-13 Thread Richard Earnshaw
flict. I have some ideas about how to address this, but that's for a later test series. committed to master branch. R. Richard Earnshaw (22): arm: testsuite: correctly detect armv6t2 hardware for acle execution tests arm: testsuite: correctly detect hard_float arm: testsuite: avoi

[committed 01/22] arm: testsuite: correctly detect armv6t2 hardware for acle execution tests

2023-11-13 Thread Richard Earnshaw
Some of the ACLE tests for Arm are executable, but we were only testing that the compiler could generate code for them, not that the hardware was capable of executing them. Fix this by adding an execution test for suitable hardware. gcc/testsuite: * lib/target-supports.exp (check_effect

[committed 02/22] arm: testsuite: correctly detect hard_float

2023-11-13 Thread Richard Earnshaw
Add an arm-specific test to check_effective_target_hard_float for Arm to handle cases where we only have single-precision FP in hardware. gcc/testsuite: * lib/target-supports.exp (check_effective_target_hard_float): Add arm-specific test. --- gcc/testsuite/lib/target-supports.ex

[committed 07/22] arm: testsuite: tidy up pre-run check for g2.c

2023-11-13 Thread Richard Earnshaw
gcc.target/arm/g2.c is an xscale-only test, but the test is quite old and we have improved the infrastructure for setting up such tests now. So make use of that to reduce the number of cases where this test fails to run. gcc/testsuite: * lib/target-supports.exp (check_effective_target_ar

[committed 10/22] arm: testsuite: improve compatibility of arm/pr78353-*.c

2023-11-13 Thread Richard Earnshaw
Again, use the infrastructure available to improve the compatibility of these tests. gcc/testsuite: * gcc.target/arm/pr78353-1.c: Use dg-add-options to manage target flags. * gcc.target/arm/pr78353-2.c: Likewise. --- gcc/testsuite/gcc.target/arm/pr78353-1.c | 3 ++- gcc/

[committed 04/22] arm: testsuite: avoid problems with -mfpu=auto in pacbti-m-predef-11.c

2023-11-13 Thread Richard Earnshaw
This test overrides the architecture, but fails to describe which floating-point features are needed. This causes problems if the ABI requires FP for parameter passing and -mfpu=auto is selected, so ensure that one is specified. gcc/testsuite: * gcc.target/arm/acle/pacbti-m-predef-11.c:

[committed 03/22] arm: testsuite: avoid hard-float ABI incompatibility with -march

2023-11-13 Thread Richard Earnshaw
A number of tests in the gcc testsuite, especially for arm-specific targets, add various flags to control the architecture. These run into problems when the compiler is configured with -mfpu=auto if the new architecture lacks an architectural feature that implies we have floating-point instructio

[committed 06/22] arm: testsuite: avoid problems with -mfpu=auto in attr_thumb-static2.c

2023-11-13 Thread Richard Earnshaw
This test overrides the architecture, but fails to describe which floating-point features are needed. This causes problems if the ABI requires FP for parameter passing and -mfpu=auto is selected, so ensure that one is specified. gcc/testsuite: * gcc.target/arm/attr_thumb-static2.c: Add

[committed 11/22] arm: testsuite: improve compatibility of pr88648-asm-syntax-unified.c

2023-11-13 Thread Richard Earnshaw
Fix another test that was trying to set the architecture directly rather than using the infrastructure as intended. gcc/testsuite: * gcc.target/arm/pr88648-asm-syntax-unified.c: It isn't necessary to try to override the architecture flags specified by arm_arch_v7a. --- gcc/tests

[committed 17/22] arm: testsuite: improve compatibility of gcc.target/arm/optional_thumb-*.c

2023-11-13 Thread Richard Earnshaw
These tests deliberately pass invalid option combinations to check that the compiler is generating the correct diagnostic. Nevertheless, we can improve their compatibility with other testsuite options. For optional_thumb-1.c we use a soft-float ABI, while for optional_thumb2.c we use arm_arch_v7

[committed 05/22] arm: testsuite: avoid problems with -mfpu=auto in attr-crypto.c

2023-11-13 Thread Richard Earnshaw
This test overrides the architecture, but fails to describe which floating-point features are needed. This causes problems if the ABI requires FP for parameter passing and -mfpu=auto is selected, so ensure that one is specified. gcc/testsuite: * gcc.target/arm/attr-crypto.c: Add +simd t

[committed 08/22] arm: testsuite: improve compatibility of arm/lto/pr96939_1.c

2023-11-13 Thread Richard Earnshaw
This test overrides the architecture, but fails to specify the floating point architecture. This causes problems if -mfpu=auto is used. gcc/testsuite: * gcc.target/arm/lto/pr96939_1.c: Add +simd to the architecture specification. --- gcc/testsuite/gcc.target/arm/lto/pr96939_1.c

[committed 12/22] arm: testsuite: improve compatibility of pragma_arch_attribute*.c

2023-11-13 Thread Richard Earnshaw
These tests use pragmas adn attributes to change the architecture. Sometimes they simply add a feature using "+crc", but other times they try to completely reset the architecture using "arch=armv8-a+crc". The latter fails on a hard-float ABI with -mfpu=auto because it also clears the FP capability

[committed 14/22] arm: testsuite: modernize framework usage for arm/scd42-2.c

2023-11-13 Thread Richard Earnshaw
Make this test more useful by using dg-require-effective-target/ dg-add-options. gcc/testsuite: * gcc.target/arm/scd42-2.c: Use modern dg- flags. --- gcc/testsuite/gcc.target/arm/scd42-2.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gcc/testsuite/gcc.tar

[committed 13/22] arm: testsuite: improve compatibility of pragma_arch_switch_2.c

2023-11-13 Thread Richard Earnshaw
This test was explicitly setting the architecture on the command-line and in the body of the test. In both cases this causes problems with the auto FPU setting. Fix by using the testsuite infrastructure correctly and by adding +fp to the pragma. gcc/testsuite: * gcc.target/arm/pragma_a

[committed 09/22] arm: testsuite: tidy up pr65647-2.c pre-checks.

2023-11-13 Thread Richard Earnshaw
Another case where we can make better use of the infrastructure to improve the compatibility of this test. gcc/testsuite: * gcc.target/arm/pr65647-2.c: Use dg-add-options to manage target flags. --- gcc/testsuite/gcc.target/arm/pr65647-2.c | 3 ++- 1 file changed, 2 insertions(+

[committed 19/22] arm: testsuite: improve compatibility of gcc.target/arm/pr59575.c

2023-11-13 Thread Richard Earnshaw
Use dg-require-effective-target/dg-add-options to improve compatibility of this test with various compiler configurations. gcc/testsuite: * gcc.target/arm/pr59575.c: Use dg-require-effective-target and dg-add-options. --- gcc/testsuite/gcc.target/arm/pr59575.c | 4 +++- 1 file c

[committed 20/22] testsuite: arm: tighten up mode-specific ISA tests

2023-11-13 Thread Richard Earnshaw
Some of the standard Arm architecture tests require the test to use a specific instruction set (arm or thumb). But although the framework was checking that the flag was accepted, it wasn't checking that the flag wasn't somehow being override (eg by run-specific options). We can improve these tes

[committed 16/22] arm: testsuite: improve compatibility of gcc.target/arm/macro_defs*.c

2023-11-13 Thread Richard Earnshaw
Convert these tests to use dg-add-options for increased compatibilty. Since they also result in an empty translation unit, override the default testsuite options. gcc/testsuite: * gcc.target/arm/macro_defs0.c: Use dg-effective-target and dg-add-options. * gcc.target/arm/m

[committed 15/22] arm: testsuite: improve compatibility of ftest-armv7m-thumb.c

2023-11-13 Thread Richard Earnshaw
This test is specific to armv7m cores which do not support hardware floating-point. We can improve its compatibility by having the default options for this core specify -mfloat-abi=soft. gcc/testsuite: * lib/target-supports.exp (check_effective_target_arm_arch_FUNC_ok): Use soft

[committed 18/22] arm: testsuite: improve compatibility of gcc.target/arm/pr19599.c

2023-11-13 Thread Richard Earnshaw
Add +fp to the architecture specification, so that -mfpu=auto works with the hard-float ABI. gcc/testsuite: * gcc.target/arm/pr19599.c: Add +fp to the architecture. --- gcc/testsuite/gcc.target/arm/pr19599.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsui

[committed 22/22] arm: testsuite: improve compatibility of gcc.dg/debug/pr57351.c

2023-11-13 Thread Richard Earnshaw
This test is arm specific and requires neon. To improve compatibility add a new test for armv7-a with neon and use that. gcc/testsuite: * lib/target-supports.exp (v7a_neon): New feature-test target. * gcc.dg/debug/pr57351.c: Use it. --- gcc/testsuite/gcc.dg/debug/pr57351.c | 7

  1   2   3   4   5   6   7   8   9   10   >