Re: [PATCH] SFINAE check for floating point fetch_add builtins in libstdc++

2025-02-08 Thread Matthew Malcomson
rts while the GCC built binary passes. Thanks again! Matthew On 2/7/25 15:33, Jonathan Wakely wrote: External email: Use caution opening links or attachments On 05/02/25 13:43 +, Jonathan Wakely wrote: On 28/10/24 17:15 +, mmalcom...@nvidia.com wrote: From: Matthew Malcomson I not

Re: [PATCH] testsuite: libitm: Adjust how libitm.c++ passes link flags

2025-02-05 Thread Matthew Malcomson
email: Use caution opening links or attachments On Fri, Jan 03, 2025 at 05:48:12PM +0000, Matthew Malcomson wrote: On 1/3/25 17:14, Joseph Myers wrote: Does this patch cover everything dealt with by <https://gcc.gnu.org/pipermail/gcc-patches/2024-December/672242.html> ([PATCH] testsu

Re: Please Ignore -- testing email

2025-02-05 Thread Matthew Malcomson
Again -- apologies for the noise On 1/22/25 16:16, Matthew Malcomson wrote: *External email: Use caution opening links or attachments* Apologies for the noise.

Please Ignore -- testing email

2025-01-22 Thread Matthew Malcomson
Apologies for the noise.

Re: [PATCH 00/11] Add FP overloads for __atomic_fetch_add etc

2025-01-08 Thread Matthew Malcomson
On 11/14/24 13:55, mmalcom...@nvidia.com wrote: From: Matthew Malcomson Hello, This is the revision of the RFC posted here: https://gcc.gnu.org/pipermail/gcc-patches/2024-September/663355.html This patchset introduces floating point versions of atomic fetch_add, fetch_sub, add_fetc

Re: [PATCH] testsuite: libitm: Adjust how libitm.c++ passes link flags

2025-01-03 Thread Matthew Malcomson
Ah -- I didn't notice that patch. It looks like both do essentially the same thing. That one identifies the use of the c++ test runner by checking for the presence of the `lang_test_file` variable, and in that case `libitm_target_compile` adds the options, while in my patch the c++ test runne

Re: [PATCH] testsuite: libitm: Adjust how libitm.c++ passes link flags

2025-01-03 Thread Matthew Malcomson
taching a patch with this approach -- which is much simpler than the previous patch. How does that look to you? On 1/2/25 15:58, Richard Sandiford wrote: External email: Use caution opening links or attachments Matthew Malcomson writes: On 1/2/25 12:08, Richard Sandiford wrote: +# This

Re: [PATCH] testsuite: libitm: Adjust how libitm.c++ passes link flags

2025-01-02 Thread Matthew Malcomson
was unset at start => saved_TEST_ALWAYS_FLAGS is unset. - Has been set in libitm_init and was set at start => saved_TEST_ALWAYS_FLAGS is set. - Has already been reset => some other flag. Have attached the adjusted patch to this email. From fbce3b25e8ccad80697f1596f566b268fff71221 Mon Sep

Re: [PATCH] c++: Allow overloaded builtins to be used in SFINAE context

2024-12-03 Thread Matthew Malcomson
Attempting to resend my response differently since my last email seems to have had problems with email permissions. Apologies for the duplication. On 12/2/24 16:48, Jason Merrill wrote: External email: Use caution opening links or attachments On 10/21/24 6:43 AM, Matthew Malcomson wrote

Re: Ping: [PATCH] c++: Allow overloaded builtins to be used in SFINAE context

2024-12-02 Thread Matthew Malcomson
Ping 4 Also adding those that I've Cc'd in the patchset for FP atomics since this patch is enabling that one. ____ From: Matthew Malcomson Sent: 26 November 2024 10:26 AM To: gcc-patches@gcc.gnu.org Cc: Jason Merrill ; Nathan Sidwell Subject: Re: Ping:

Re: [PATCH 00/11] Add FP overloads for __atomic_fetch_add etc

2024-11-26 Thread Matthew Malcomson
n 11/22/24 11:47, Matthew Malcomson wrote: External email: Use caution opening links or attachments Wanted to provide a link to the current patch that Prathamesh has worked on for automatically linking in libatomic (since this patch relies on that for the idea approach). https://gcc.gnu.org/pip

Re: Ping: [PATCH] c++: Allow overloaded builtins to be used in SFINAE context

2024-11-26 Thread Matthew Malcomson
Ping 3 On 11/18/24 13:22, Matthew Malcomson wrote: External email: Use caution opening links or attachments Ping 2 On 10/21/24 11:43, Matthew Malcomson wrote: External email: Use caution opening links or attachments Ping (re-sending ping because previous message body too large for list

Re: [PATCH 00/11] Add FP overloads for __atomic_fetch_add etc

2024-11-22 Thread Matthew Malcomson
: Matthew Malcomson Hello, This is the revision of the RFC posted here: https://gcc.gnu.org/pipermail/gcc-patches/2024-September/663355.html This patchset introduces floating point versions of atomic fetch_add, fetch_sub, add_fetch and sub_fetch. Instructions for performing these operations have

Re: [PATCH 08/11] c: c++: flag to disable fetch_op handling fenv exceptions

2024-11-21 Thread Matthew Malcomson
Attempting to resend since got rejected from gcc-patches mailing list. (Apologies about the duplication to those on Cc). On 11/18/24 11:25, Matthew Malcomson wrote: On 11/14/24 18:44, Joseph Myers wrote: External email: Use caution opening links or attachments On Thu, 14 Nov 2024,mmalcom

Ping: [PATCH] c++: Allow overloaded builtins to be used in SFINAE context

2024-11-18 Thread Matthew Malcomson
Ping 2 On 10/21/24 11:43, Matthew Malcomson wrote: External email: Use caution opening links or attachments Ping (re-sending ping because previous message body too large for list -- apologies for duplication to those on Cc). Attaching update on testsuite to fix testism on Arm that Linaro CI

Re: libstdc++ fetch_add & fenv -- ecosystem questions

2024-10-15 Thread Matthew Malcomson
27;t look like there's any >objection to implementing that. Seems that the testsuite and build system are the main things to watch out for here right? Does that seem reasonable to others? From: Joseph Myers Sent: 14 October 2024 6:47 PM To: Matthew Malcomso

Re: libstdc++ fetch_add & fenv -- ecosystem questions

2024-10-14 Thread Matthew Malcomson
27;m unfamiliar with. From: Jonathan Wakely Sent: 14 October 2024 2:36 PM To: Matthew Malcomson Cc: Joseph Myers ; gcc-patches@gcc.gnu.org Subject: Re: libstdc++ fetch_add & fenv -- ecosystem questions External email: Use caution opening links or attachments O

libstdc++ fetch_add & fenv -- ecosystem questions

2024-10-14 Thread Matthew Malcomson
re your thoughts? Regards, Matthew From: Joseph Myers Sent: 19 September 2024 10:38 PM To: Matthew Malcomson Cc: gcc-patches@gcc.gnu.org ; Jonathan Wakely ; Richard Biener Subject: Re: [PATCH 0/8] [RFC] Introduce floating point fetch_add builtins External email: Use caution ope

Re: [PATCH 0/8] [RFC] Introduce floating point fetch_add builtins

2024-10-02 Thread Matthew Malcomson
ecific builtins)? From: Jonathan Wakely Sent: 19 September 2024 3:47 PM To: Matthew Malcomson Cc: gcc-patches@gcc.gnu.org ; Joseph Myers ; Richard Biener Subject: Re: [PATCH 0/8] [RFC] Introduce floating point fetch_add builtins External email: Use caution opening links

Re: testsuite: Remove no_fsanitize_address install directory dependency

2024-07-10 Thread Matthew Malcomson
On 7/10/24 13:42, Rainer Orth wrote: N.b. one alternative would be to remove this effective target and try to move all tests which currently use this into directories which run their tests between calls to `asan_finish` and `asan_init`. This seems like it might ensure a clearer division of "asan

Re: testsuite: Remove no_fsanitize_address install directory dependency

2024-07-10 Thread Matthew Malcomson
property that uses a different name to cache under, given that this is testing something different than the original function. Have again tested that the problematic tests run without an install directory. On 7/10/24 13:19, Matthew Malcomson wrote: The current no_fsanitize_address effective

testsuite: Remove no_fsanitize_address install directory dependency

2024-07-10 Thread Matthew Malcomson
The current no_fsanitize_address effective target check (implemented in target-supports.exp rather than in asan.exp) has some problems with the link path. Because it is not called from in between asan_init and asan_finish the link paths of the compiler are not changed to point at the build directo

Re: gcc: docs: Fix documentation of two hooks

2024-07-01 Thread Matthew Malcomson
t; in any way. On 4/8/24 11:34, Matthew Malcomson wrote: The `function_attribute_inlinable_p` hook documentation described it returning the value if it is OK to inline the provided fndecl into "the current function". AFAICS This hook is only called when `current_function_decl` is the

gcc: docs: Fix documentation of two hooks

2024-04-08 Thread Matthew Malcomson
The `function_attribute_inlinable_p` hook documentation described it returning the value if it is OK to inline the provided fndecl into "the current function". AFAICS This hook is only called when `current_function_decl` is the same as the `fndecl` argument that the hook is given, hence asking whe

Re: [PATCH] arm: fix c23 0-named-args caller-side stdarg

2024-02-26 Thread Matthew Malcomson
Hi Alexandre, I don't have the ability to OK the patch, but I'm attempting to do a review in order to reduce the workload for any maintainer.  (Apologies for the slow response). I think you're right that the AAPCS32 requires all arguments to be passed in registers for this testcase. (Nit on th

Re: [PATCH 0/12] GCC _BitInt support [PR102989]

2023-09-18 Thread Matthew Malcomson via Gcc-patches
On 8/9/23 19:14, Jakub Jelinek via Gcc-patches wrote: It is enabled only on targets which have agreed on processor specific ABI how to lay those out or pass as function arguments/return values, which currently is just x86-64 I believe, would be nice if target maintainers helped to get agreement

[PATCH] mid-end: Use integral time intervals in timevar.cc

2023-08-04 Thread Matthew Malcomson via Gcc-patches
Hopefully last update ... > Specifically, please try compiling with >-ftime-report -fdiagnostics-format=sarif-file > and have a look at the generated .sarif file, e.g. via >python -m json.tool foo.c.sarif > which will pretty-print the JSON to stdout. Rebasing onto the JSON output was quit

Re: [PATCH] mid-end: Use integral time intervals in timevar.cc

2023-08-03 Thread Matthew Malcomson via Gcc-patches
On 8/3/23 15:09, David Malcolm wrote: Hi Matthew. I recently touched the timevar code (in r14-2881- g75d623946d4b6e) to add support for serializing the timevar data in JSON form as part of the SARIF output (PR analyzer/109361). Looking at your patch, it looks like the baseline for the patch se

[PATCH] mid-end: Use integral time intervals in timevar.cc

2023-08-03 Thread Matthew Malcomson via Gcc-patches
> > I think this is undesriable. With fused you mean we use FMA? > I think you could use -ffp-contract=off for the TU instead. > > Note you can't use __attribute__((noinline)) literally since the > host compiler might not support this. > > Richard. > Trying to make the timevar store integral

[committed] Add check_vect in a testcase

2023-07-26 Thread Matthew Malcomson via Gcc-patches
Also reformat a comment that had too long lines. Commit c5bd0e5870a introduced both these problems to fix. Committed as obvious after ensuring that when running the testcase on AArch64 it still fails before the original c5bd0e5870a commit and passes after it. gcc/ChangeLog: * tree-vect-s

Re: [PATCH] Reduce floating-point difficulties in timevar.cc

2023-07-21 Thread Matthew Malcomson via Gcc-patches
On 7/21/23 14:45, Xi Ruoyao wrote: On Fri, 2023-07-21 at 14:11 +0100, Matthew Malcomson wrote: My understanding is that this is not a hardware bug and that it's specified that rounding does not happen on the multiply "sub-part" in `FNMSUB`, but rounding happens on the `FMUL` that

Re: [PATCH] Reduce floating-point difficulties in timevar.cc

2023-07-21 Thread Matthew Malcomson via Gcc-patches
Responding to two emails at the same time ;-) On 7/21/23 13:47, Richard Biener wrote: On Fri, 21 Jul 2023, Matthew Malcomson wrote: On some AArch64 bootstrapped builds, we were getting a flaky test because the floating point operations in `get_time` were being fused with the floating point

[PATCH] Reduce floating-point difficulties in timevar.cc

2023-07-21 Thread Matthew Malcomson via Gcc-patches
On some AArch64 bootstrapped builds, we were getting a flaky test because the floating point operations in `get_time` were being fused with the floating point operations in `timevar_accumulate`. This meant that the rounding behaviour of our multiplication with `ticks_to_msec` was different when us

Re: vectorizer: Avoid an OOB access from vectorization

2023-07-18 Thread Matthew Malcomson via Gcc-patches
Tamar pointed out it would be good to have a `scan-tree-dump` in the testcase just to make sure that when something is currently vectorizing it stays vectorizing (and hence that the new code is still likely running). Attached patch has that change, also inlined for ease of reply.

vectorizer: Avoid an OOB access from vectorization

2023-07-14 Thread Matthew Malcomson via Gcc-patches
Our checks for whether the vectorization of a given loop would make an out of bounds access miss the case when the vector we load is so large as to span multiple iterations worth of data (while only being there to implement a single iteration). This patch adds a check for such an access. Example

docs: Fix wording describing the hwaddress sanitizer

2021-01-04 Thread Matthew Malcomson via Gcc-patches
The original documentation added to mention the clash between -fsanitize=address and -fsanitize=hwaddress used confusing wording trying to say that -fsanitize=hwaddress is only available on AArch64. It read as if -fsanitize=address were only supported on AArch64. This patch fixes that wording by

[wwwdocs] Document new Hardware-assisted AddressSanitizer

2020-12-14 Thread Matthew Malcomson via Gcc-patches
gcc-11/changes: Document new Hardware-assisted AddressSanitizer. I have put it in the "general" section rather than AArch64 since the feature does add a general framework, so I believe the news is interesting for people interesting in architectures other than AArch64 that may want to implement thi

[PATCH] testsuite: Correct check_effective_target_hwaddress_exec

2020-11-27 Thread Matthew Malcomson via Gcc-patches
Hello, - This test should ensure that we can compile with hwasan, that such a compiled binary runs as expected, *and* that we're running on a kernel which implements the capability to ignore the top bytes of pointers in syscalls. It was expected that a basic test of `int main(void) { return

Re: Update: [PATCH 5/X] libsanitizer: mid-end: Introduce stack variable handling for HWASAN

2020-11-24 Thread Matthew Malcomson via Gcc-patches
an obvious fix after the patchset as it is now goes in. That way I can say I ran all my tests on the patch series that I applied without going through the all the tests again. Thanks for the catch! Matthew On Sat, Nov 21, 2020 at 2:48 AM Matthew Malcomson via Gcc-patches wrote:

Re: libsanitizer: Hwasan reporting check for dladdr failing

2020-11-24 Thread Matthew Malcomson via Gcc-patches
On 24/11/2020 15:53, Kyrylo Tkachov wrote: Hi Matthew, -Original Message- From: Gcc-patches On Behalf Of Matthew Malcomson via Gcc-patches Sent: 24 November 2020 15:47 To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford Subject: libsanitizer: Hwasan reporting check for dladdr failing

libsanitizer: Hwasan reporting check for dladdr failing

2020-11-24 Thread Matthew Malcomson via Gcc-patches
Hello there, This is the compiler-rt patch I'd like to cherry-pick so that the hwasan tests pass. It is in LLVM as commit 83ac18205ec69a00ac2be3b603bc3a61293fbe89. Ok for trunk? Also is the libhwasan library merge from the below email OK for trunk? https://gcc.gnu.org/pipermail/gcc-patches/2020

Re: [PATCH 7/X] libsanitizer: Add tests

2020-11-23 Thread Matthew Malcomson via Gcc-patches
Hello, Update of the hwasan tests attached. Ok for trunk? (NOTE on the state of the entire patch series: Currently re-testing everything from scratch to ensure I didn't get tripped up from old state carried around. Also looking into PR 97941 on hwasan. As yet don't understand what's goin

Re: [PATCH 4/X] libsanitizer: options: Add hwasan flags and argument parsing

2020-11-20 Thread Matthew Malcomson via Gcc-patches
Hi there, I was just doing some double-checks and noticed I'd placed the documentation in the wrong section of tm.texi. The `MEMTAG` hooks were documented in the `Register Classes` section, so I've now moved it to the `Misc` section. That's the only change, Ok for trunk? Matthew -

Re: Update: [PATCH 5/X] libsanitizer: mid-end: Introduce stack variable handling for HWASAN

2020-11-20 Thread Matthew Malcomson via Gcc-patches
Hi there, I was just doing some double-checks and noticed I'd placed the documentation in the wrong section of tm.texi. The `MEMTAG` hooks were documented in the `Register Classes` section, so I've now moved it to the `Misc` section. That's the only change, Ok for trunk? Matthew ---

Re: [Patch 0/X] HWASAN v4

2020-11-20 Thread Matthew Malcomson via Gcc-patches
On 13/11/2020 17:22, Martin Liška wrote: On 11/13/20 5:57 PM, Matthew Malcomson wrote: Hi there, Thanks for the heads-up. As it turns out the most recent `libhwasan` crashes when displaying an address on the stack in Linux. Hello. What a bad luck. I'm currently working on getti

Re: Document --with-build-config=bootstrap-asan option.

2020-11-20 Thread Matthew Malcomson via Gcc-patches
On 13/01/2020 10:40, Matthew Malcomson wrote: On 11/01/2020 07:19, Gerald Pfeifer wrote: On Thu, 12 Dec 2019, Matthew Malcomson wrote: gcc/ChangeLog: 2019-12-12 Matthew Malcomson * doc/install.texi: Document bootstrap-asan configuration option. I see this introduces a new table

Re: Update [PATCH 6/X] libsanitizer: Add hwasan pass and associated gimple changes

2020-11-20 Thread Matthew Malcomson via Gcc-patches
Updates after latest review. (testing underway) --- There are four main features to this change: 1) Check pointer tags match address tags. When sanitizing for hwasan we now put HWASAN_CHECK internal functions before memory accesses in the `asan` pass. This checks that a tag in

Update [PATCH 6/X] libsanitizer: Add hwasan pass and associated gimple changes

2020-11-19 Thread Matthew Malcomson via Gcc-patches
Update to match the change in initialisation for patch 5/X. MM --- There are four main features to this change: 1) Check pointer tags match address tags. When sanitizing for hwasan we now put HWASAN_CHECK internal functions before memory accesses in the `asan` pass. This checks that a tag in

Update: [PATCH 5/X] libsanitizer: mid-end: Introduce stack variable handling for HWASAN

2020-11-19 Thread Matthew Malcomson via Gcc-patches
Hi there, After offline discussion with Richard I've modified the way in which the initialisation for the hwasan base pointer is emitted. Originally it was getting emitted during `expand_used_vars`, and requiring `handle_builtin_alloca` to register a need for it to be emitted so that `expand_HWASA

[PATCH 6/X] libsanitizer: Add hwasan pass and associated gimple changes

2020-11-16 Thread Matthew Malcomson via Gcc-patches
There are four main features to this change: 1) Check pointer tags match address tags. When sanitizing for hwasan we now put HWASAN_CHECK internal functions before memory accesses in the `asan` pass. This checks that a tag in the pointer being used match the tag stored in shadow memory for the m

[PATCH 5/X] libsanitizer: mid-end: Introduce stack variable handling for HWASAN

2020-11-16 Thread Matthew Malcomson via Gcc-patches
Handling stack variables has three features. 1) Ensure HWASAN required alignment for stack variables When tagging shadow memory, we need to ensure that each tag granule is only used by one variable at a time. This is done by ensuring that each tagged variable is aligned to the tag granule repres

[PATCH 1/X] libsanitizer: Tie the hwasan library into our build system

2020-11-16 Thread Matthew Malcomson via Gcc-patches
This patch tries to tie libhwasan into the GCC build system in the same way that the other sanitizer runtime libraries are handled. libsanitizer/ChangeLog: * Makefile.am: Build libhwasan. * Makefile.in: Build libhwasan. * asan/Makefile.in: Build libhwasan. * con

[PATCH 4/X] libsanitizer: options: Add hwasan flags and argument parsing

2020-11-16 Thread Matthew Malcomson via Gcc-patches
These flags can't be used at the same time as any of the other sanitizers. We add an equivalent flag to -static-libasan in -static-libhwasan to ensure static linking. The -fsanitize=kernel-hwaddress option is for compiling targeting the kernel. This flag has defaults to match the LLVM implementat

[PATCH 3/X] libsanitizer: Add option to bootstrap using HWASAN

2020-11-16 Thread Matthew Malcomson via Gcc-patches
This is an analogous option to --bootstrap-asan to configure. It allows bootstrapping GCC using HWASAN. For the same reasons as for ASAN we have to avoid using the HWASAN sanitizer when compiling libiberty and the lto-plugin. Also add a function to query whether -fsanitize=hwaddress has been pas

[PATCH 7/X] libsanitizer: Add tests

2020-11-16 Thread Matthew Malcomson via Gcc-patches
Adding hwasan tests. Only interesting thing here is that we have to make sure the tagging mechanism is deterministic to avoid flaky tests. gcc/testsuite/ChangeLog: * c-c++-common/ubsan/sanitize-recover-7.c: * c-c++-common/hwasan/aligned-alloc.c: New test. * c-c++-common/h

[PATCH 2/X] libsanitizer: Only build libhwasan when targeting AArch64

2020-11-16 Thread Matthew Malcomson via Gcc-patches
Though the library has limited support for x86, we don't have any support for generating code targeting x86 so there is no point building for that target. Ensure we build for AArch64 but not for AArch64 ilp32. libsanitizer/ChangeLog: * Makefile.am: Condition Build hwasan directory.

Hwasan v5

2020-11-16 Thread Matthew Malcomson via Gcc-patches
Hello, Bootstrapped and regression tested on AArch64 (have not finished running tests on the Linux Kernel yet). Sending upstream to catch next set of comments early. This version mainly just consists of requested changes. Some notable exceptions: Have rebased onto a newer version, there was a c

Re: [Patch 0/X] HWASAN v4

2020-11-13 Thread Matthew Malcomson via Gcc-patches
16:33 To: Matthew Malcomson ; gcc-patches@gcc.gnu.org Cc: ja...@redhat.com ; Richard Earnshaw ; k...@google.com ; do...@redhat.com ; jos...@codesourcery.com Subject: Re: [Patch 0/X] HWASAN v4 On 10/16/20 11:03 AM, Martin Li�ka wrote: > Hello. > > I've just merged libsaniti

[Patch] opts: Change `is incompatible with` messages to have standard parametrised form

2020-11-09 Thread Matthew Malcomson via Gcc-patches
Hello, In a recent review for one of the hwasan patches Richard S. noticed there are quite a few errors of the form "% is incompatible with ". https://gcc.gnu.org/pipermail/gcc-patches/2020-October/556137.html In order to avoid this creating extra work for translators we would like to change thes

[PATCH 5/X] libsanitizer: mid-end: Introduce stack variable handling for HWASAN

2020-11-03 Thread Matthew Malcomson via Gcc-patches
Hi Richard, I'm sending up the revised patch 5 (introducing stack variable handling) without the other changes to other patches. I figure there's been quite a lot of changes to this patch and I wanted to give you time to review them while I worked on finishing the less widespread changes in patch

Re: [PATCH 1/X] libsanitizer: Tie the hwasan library into our build system

2020-10-28 Thread Matthew Malcomson via Gcc-patches
efer to have the "hwasan" pass separate (I liked having the "correct" names for the -fdump-tree* arguments and dump files). That said -- if you feel strongly about this I'll happily change it. From: Richard Sandiford Sent: 13 October 202

[PATCH 4/X] libsanitizer: options: Add hwasan flags and argument parsing

2020-08-17 Thread Matthew Malcomson
These flags can't be used at the same time as any of the other sanitizers. We add an equivalent flag to -static-libasan in -static-libhwasan to ensure static linking. The -fsanitize=kernel-hwaddress option is for compiling targeting the kernel. This flag has defaults that allow compiling KASAN wi

[PATCH 6/X] libsanitizer: Add hwasan pass and associated gimple changes

2020-08-17 Thread Matthew Malcomson
There are four main features to this change: 1) Check pointer tags match address tags. In the new `hwasan` pass we put HWASAN_CHECK internal functions before all memory accesses to check that tags in the pointer being used match the tag stored in shadow memory for the memory region being used. T

[PATCH 5/X] libsanitizer: mid-end: Introduce stack variable handling for HWASAN

2020-08-17 Thread Matthew Malcomson
Handling stack variables has three features. 1) Ensure HWASAN required alignment for stack variables When tagging shadow memory, we need to ensure that each tag granule is only used by one variable at a time. This is done by ensuring that each tagged variable is aligned to the tag granule repres

[PATCH 7/X] libsanitizer: Add tests

2020-08-17 Thread Matthew Malcomson
Adding hwasan tests. Only interesting thing here is that we have to make sure the tagging mechanism is deterministic to avoid flaky tests. gcc/testsuite/ChangeLog: * c-c++-common/hwasan/aligned-alloc.c: New test. * c-c++-common/hwasan/alloca-array-accessible.c: New test.

[PATCH 1/X] libsanitizer: Tie the hwasan library into our build system

2020-08-17 Thread Matthew Malcomson
This patch tries to tie libhwasan into the GCC build system in the same way that the other sanitizer runtime libraries are handled. libsanitizer/ChangeLog: * Makefile.am: Build libhwasan. * Makefile.in: Build libhwasan. * asan/Makefile.in: Build libhwasan. * con

[PATCH 2/X] libsanitizer: Only build libhwasan when targeting AArch64

2020-08-17 Thread Matthew Malcomson
Though the library has limited support for x86, we don't have any support for generating code targeting x86 so there is no point building for that target. libsanitizer/ChangeLog: * Makefile.am: Condition building hwasan directory. * Makefile.in: Regenerate. * configure: Re

[PATCH 3/X] libsanitizer: Add option to bootstrap using HWASAN

2020-08-17 Thread Matthew Malcomson
This is an analogous option to --bootstrap-asan to configure. It allows bootstrapping GCC using HWASAN. For the same reasons as for ASAN we have to avoid using the HWASAN sanitizer when compiling libiberty and the lto-plugin. Also add a function to query whether -fsanitize=hwaddress has been pas

Re: SLS Mitigation patches backported for GCC9

2020-07-24 Thread Matthew Malcomson
On 24/07/2020 12:01, Kyrylo Tkachov wrote: Hi Matthew, -Original Message- From: Matthew Malcomson Sent: 21 July 2020 16:16 To: gcc-patches@gcc.gnu.org Cc: Richard Earnshaw ; Kyrylo Tkachov ; Ross Burton Subject: SLS Mitigation patches backported for GCC9 Hello, Eventually we will

aarch64: (GCC-9 Backport) New Straight Line Speculation (SLS) mitigation flags

2020-07-21 Thread Matthew Malcomson
Here we introduce the flags that will be used for straight line speculation. The new flag introduced is `-mharden-sls=`. This flag can take arguments of `none`, `all`, or a comma seperated list of one or more of `retbr` or `blr`. `none` indicates no special mitigation of the straight line speculat

aarch64: (GCC-9 Backport) Introduce SLS mitigation for RET and BR instructions

2020-07-21 Thread Matthew Malcomson
Instructions following RET or BR are not necessarily executed. In order to avoid speculation past RET and BR we can simply append a speculation barrier. Since these speculation barriers will not be architecturally executed, they are not expected to add a high performance penalty. The speculation

aarch64: (GCC-9 Backport) Mitigate SLS for BLR instruction

2020-07-21 Thread Matthew Malcomson
This patch introduces the mitigation for Straight Line Speculation past the BLR instruction. This mitigation replaces BLR instructions with a BL to a stub which uses a BR to jump to the original value. These function stubs are then appended with a speculation barrier to ensure no straight line sp

SLS Mitigation patches backported for GCC9

2020-07-21 Thread Matthew Malcomson
Hello, Eventually we will want to backport the SLS patches to older branches. When the GCC10 release is unfrozen we will work on getting the same patches already posted backported to that branch. The patches already posted on the mailing list apply cleanly to the current releases/gcc-10 branch.

Re: [Patch 2/3] aarch64: Introduce SLS mitigation for RET and BR instructions

2020-07-03 Thread Matthew Malcomson
BR is immediately followed by a speculation barrier. gcc/ChangeLog: 2020-07-03 Matthew Malcomson * config/aarch64/aarch64-protos.h (aarch64_sls_barrier): New. * config/aarch64/aarch64.c (aarch64_output_casesi): Emit speculation barrier after BR instruction if nee

Re: [Patch 1/3] aarch64: New Straight Line Speculation (SLS) mitigation flags

2020-07-03 Thread Matthew Malcomson
speculation barrier after it. Setting this on a per-function basis using attributes or the like is not enabled, but may be in the future. gcc/ChangeLog: 2020-07-03 Matthew Malcomson * config/aarch64/aarch64-protos.h (aarch64_harden_sls_retbr_p): New

Re: [Patch 1/3] aarch64: New Straight Line Speculation (SLS) mitigation flags

2020-06-23 Thread Matthew Malcomson
On 23/06/2020 16:48, Richard Sandiford wrote: Matthew Malcomson writes: @@ -14466,6 +14466,81 @@ aarch64_validate_mcpu (const char *str, const struct processor **res, return false; mfix-cortex-a53-835769 Target Report Var(aarch64_fix_a53_err835769) Init(2) Save Workaround for ARM

Re: [Patch 2/3] aarch64: Introduce SLS mitigation for RET and BR instructions

2020-06-23 Thread Matthew Malcomson
On 23/06/2020 17:56, Richard Sandiford wrote: Matthew Malcomson writes: On 23/06/2020 17:17, Richard Sandiford wrote: Matthew Malcomson writes: --- a/gcc/config/aarch64/aarch64-protos.h +/* Ensure there are no BR or RET instructions which are not directly followed + by a speculation

Re: [Patch 2/3] aarch64: Introduce SLS mitigation for RET and BR instructions

2020-06-23 Thread Matthew Malcomson
On 23/06/2020 17:17, Richard Sandiford wrote: Matthew Malcomson writes: --- a/gcc/config/aarch64/aarch64-protos.h +/* Ensure there are no BR or RET instructions which are not directly followed + by a speculation barrier. */ +/* { dg-final { scan-assembler-not "\t(br|ret|retaa|retab)\

[Patch v2 3/3] aarch64: Mitigate SLS for BLR instruction

2020-06-23 Thread Matthew Malcomson
is immediately followed by a speculation barrier. b) No BLR instruction is emitted by compiler. gcc/ChangeLog: 2020-06-23 Matthew Malcomson * config/aarch64/aarch64-protos.h (aarch64_indirect_call_asm): New declaration. * config/aarch64/aarch64.c (aarch64_regno_regcla

[Patch 2/3] aarch64: Introduce SLS mitigation for RET and BR instructions

2020-06-08 Thread Matthew Malcomson
every RET or BR is immediately followed by a speculation barrier. gcc/ChangeLog: 2020-06-08 Matthew Malcomson * config/aarch64/aarch64-protos.h (aarch64_sls_barrier): New. * config/aarch64/aarch64.c (aarch64_output_casesi): Emit speculation barrier after BR instruction

[Patch 3/3] aarch64: Mitigate SLS for BLR instruction

2020-06-08 Thread Matthew Malcomson
ted by compiler. gcc/ChangeLog: 2020-06-08 Matthew Malcomson * config/aarch64/aarch64-protos.h (aarch64_indirect_call_asm): New declaration. * config/aarch64/aarch64.c (aarch64_use_return_insn_p): Return false if hardening BLR instructions. (aarch64_sl

[Patch 1/3] aarch64: New Straight Line Speculation (SLS) mitigation flags

2020-06-08 Thread Matthew Malcomson
. Setting this on a per-function basis using attributes or the like is not enabled, but may be in the future. gcc/ChangeLog: 2020-06-08 Matthew Malcomson * config/aarch64/aarch64-protos.h (aarch64_harden_sls_retbr_p): New. (aarch64_harden_sls_blr_p): New. * config

Straight Line Speculation (SLS) mitigation.

2020-06-08 Thread Matthew Malcomson
Hi, A new speculative cache side-channel vulnerability has been published at the link below, named "straight-line speculation" (SLS in this patch series). https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/downloads/straight-line-speculation This vulnerabili

[Arm] Account for C++17 artificial field determining Homogeneous Aggregates

2020-04-27 Thread Matthew Malcomson
-April/544204.html Regression tested on arm-none-eabi. gcc/ChangeLog: 2020-04-27 Matthew Malcomson Jakub Jelinek PR target/94383 * config/arm/arm.c (aapcs_vfp_sub_candidate): Account for C++17 empty base class

[AArch64] (PR94383) Avoid C++17 empty base field checking for HVA/HFA

2020-04-23 Thread Matthew Malcomson
: 2020-04-23 Matthew Malcomson Jakub Jelinek PR target/94383 * config/aarch64/aarch64.c (aapcs_vfp_sub_candidate): Account for C++17 empty base class artificial fields. (aarch64_vfp_is_call_or_return_candidate): Warn when ABI PCS decision is di

[AArch64] (PR94383) Avoid C++17 empty base field checking for HVA/HFA

2020-04-21 Thread Matthew Malcomson
gcc/ChangeLog: 2020-04-21 Matthew Malcomson Jakub Jelinek PR target/94383 * config/aarch64/aarch64.c (enum cpp17empty_state): New. (aapcs_vfp_sub_candidate): Account for C++17 empty base class artificial fields. (aarch64_vfp_is_call_or_return_can

Re: [PATCH 1/2] testsuite: [arm/cde] Include arm_cde.h and arm_mve.h in arm_v8*m_main_cde*

2020-04-20 Thread Matthew Malcomson
On 20/04/2020 08:47, Christophe Lyon via Gcc-patches wrote: Since arm_cde.h includes stdint.h, its use requires the presence of the right gnu/stub-*.h, so make sure to include it when checking the arm_v8*m_main_cde* effective targets, otherwise we can decide CDE is supported while it's not really

[Arm] Disallow arm_movdi when targetting MVE

2020-04-15 Thread Matthew Malcomson
04-15 Matthew Malcomson * config/arm/arm.md (arm_movdi): Disallow for MVE. ### Attachment also inlined for ease of reply### diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 7bc55cce61b2e45e5875a233dd4546d5939

[Arm] Allow the use of arm_cde.h for C++

2020-04-09 Thread Matthew Malcomson
thout name mangling. Hence all the function names are the same and we have many conflicting declarations. Testing Done: Regression tested for arm-none-eabi. gcc/ChangeLog: 2020-04-09 Matthew Malcomson * config/arm/arm_cde.h: Remove `extern "C"` when compiling for

[wwwdocs] [arm] Document CDE intrinsics from ACLE

2020-04-08 Thread Matthew Malcomson
New in GCC 10. ### Attachment also inlined for ease of reply### diff --git a/htdocs/gcc-10/changes.html b/htdocs/gcc-10/changes.html index 3d8e0ba989e860d307310378a2be99b32a27261f..389561d13c69b650528e8ed8859ebbb5760438c6 100644 --- a/htdocs/gcc-10/changes.html

[PATCH] [Arm] Implement scalar Custom Datapath Extension intrinsics

2020-04-08 Thread Matthew Malcomson
generation for -Os when producing the cx*d instructions. Testing done: Bootstrapped and regtested for arm-none-linux-gnueabihf. gcc/ChangeLog: 2020-04-08 Matthew Malcomson * config/arm/arm.c (arm_hard_regno_mode_ok): DImode registers forced into even-odd register pairs for

[PATCH] [Arm] Implement scalar Custom Datapath Extension intrinsics

2020-04-08 Thread Matthew Malcomson
with CDE -- this avoids faulty code generation for -Os when producing the cx*d instructions. Testing done: Bootstrapped and regtested for arm-none-linux-gnueabihf. gcc/ChangeLog: 2020-04-08 Matthew Malcomson * config/arm/arm.c (arm_hard_regno_mode_ok): DImode registers forced into

[Arm] Implement CDE predicated intrinsics for MVE registers

2020-04-08 Thread Matthew Malcomson
pace between the mnemonic and the first argument, but in one case it just has a tab -- making all the same helps make test regexps simpler. Testing Done: Bootstrap and full regtest on arm-none-linux-gnueabihf Full regtest on arm-none-eabi gcc/ChangeLog: 2020-04-08 Matthew Malcomson

[Arm] Implement CDE intrinsics for MVE registers.

2020-04-08 Thread Matthew Malcomson
Ok for trunk? gcc/ChangeLog: 2020-04-08 Matthew Malcomson * config.gcc (arm_mve_types.h): New extra_header for arm. * config/arm/arm-builtins.c (arm_resolve_overloaded_builtin): New. (arm_init_cde_builtins): New. (arm_init_acle_builtins): Remove initialisation

[Arm] Implement CDE predicated intrinsics for MVE registers

2020-04-07 Thread Matthew Malcomson
ug.cgi?id=94341 gcc/ChangeLog: 2020-04-07 Matthew Malcomson * config/arm/arm-builtins.c (CX_UNARY_UNONE_QUALIFIERS): New. (CX_BINARY_UNONE_QUALIFIERS): New. (CX_TERNARY_UNONE_QUALIFIERS): New. (arm_resolve_overloaded_builtin): Move to arm-c.c. (arm_expa

[Arm] Implement CDE intrinsics for MVE registers.

2020-03-26 Thread Matthew Malcomson
by Dennis. https://gcc.gnu.org/pipermail/gcc-patches/2020-March/542008.html Ok for trunk? gcc/ChangeLog: 2020-03-26 Matthew Malcomson * config.gcc (arm_mve_types.h): New extra_header for arm. * config/arm/arm-builtins.c (arm_resolve_overloaded_builtin): New

Fwd: [testsuite] Add @ lines to check-function-bodies fluff

2020-03-10 Thread Matthew Malcomson
Cc'ing maintainers and original author of `check-function-bodies`. It looks like I missed that the first time around. Forwarded Message Subject: [testsuite] Add @ lines to check-function-bodies fluff Date: Tue, 10 Mar 2020 17:22:52 + From: Matthew Malcomson To

[testsuite] Add @ lines to check-function-bodies fluff

2020-03-10 Thread Matthew Malcomson
o I'd like to remove such `@` lines automatically. gcc/testsuite/ChangeLog: 2020-03-10 Matthew Malcomson * lib/scanasm.exp (parse_function_bodies): Lines starting with '@' also counted as fluff. ### Attachment also inlined for ease of reply

[AArch64] effective_target for aarch64 f64mm asm

2020-01-21 Thread Matthew Malcomson
read. Testing Done: Checked on a cross-compiler that: Tests running for binutils commit e264b5b7a are listed as UNSUPPORTED. Tests running for binutils commit 26916852e all pass. gcc/testsuite/ChangeLog: 2020-01-21 Matthew Malcomson * gcc.target/aarch64/sve/acle/asm/ld1ro_f16.c: Use re

Re: [Patch] [AArch64] [SVE] Implement svld1ro intrinsic.

2020-01-20 Thread Matthew Malcomson
On 20/01/2020 14:53, Christophe Lyon wrote: > On Thu, 9 Jan 2020 at 16:53, Matthew Malcomson > wrote: >> >> + (match_test "aarch64_sve_ld1ro_operand_p (op, DImode)"))) >> + > > >> (define_predicate "aarch64_sve_ldff1_operand" &

  1   2   3   >