[COMMITTED/13] Fix PR 110386: backprop vs ABSU_EXPR

2023-10-01 Thread Andrew Pinski
From: Andrew Pinski The issue here is that when backprop tries to go and strip sign ops, it skips over ABSU_EXPR but ABSU_EXPR not only does an ABS, it also changes the type to unsigned. Since strip_sign_op_1 is only supposed to strip off sign changing operands and not ones that change types

[COMMITTED/13] Fix PR 111331: wrong code for `a > 28 ? MIN : 29`

2023-10-01 Thread Andrew Pinski
From: Andrew Pinski The problem here is after r6-7425-ga9fee7cdc3c62d0e51730, the comparison to see if the transformation could be done was using the wrong value. Instead of see if the inner was LE (for MIN and GE for MAX) the outer value, it was comparing the inner to the value used in the

Re: [PATCH] ipa: Self-DCE of uses of removed call LHSs (PR 108007)

2023-10-04 Thread Andrew Pinski
On Wed, Oct 4, 2023 at 5:08 PM Maciej W. Rozycki wrote: > > On Tue, 3 Oct 2023, Martin Jambor wrote: > > > > SSA graph may be deep so this may cause stack overflow, so I think we > > > should use worklist here (it is also easy to do). > > > > > > OK with that change. > > > Honza > > > > I have jus

Re: [PATCH]AArch64 Handle copysign (x, -1) expansion efficiently

2023-10-05 Thread Andrew Pinski
On Thu, Oct 5, 2023 at 11:22 AM Tamar Christina wrote: > > Hi All, > > copysign (x, -1) is effectively fneg (abs (x)) which on AArch64 can be > most efficiently done by doing an OR of the signbit. > > The middle-end will optimize fneg (abs (x)) now to copysign as the > canonical form and so this o

Re: [PATCH]AArch64 Add SVE implementation for cond_copysign.

2023-10-05 Thread Andrew Pinski
On Thu, Oct 5, 2023 at 12:48 PM Tamar Christina wrote: > > > -Original Message- > > From: Richard Sandiford > > Sent: Thursday, October 5, 2023 8:29 PM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw > > ; Marcus Shawcroft > > ; Kyrylo Tkachov > > Subject:

[PATCH] MATCH: Fix infinite loop between `vec_cond(vec_cond(a, b, 0), c, d)` and `a & b`

2023-10-05 Thread Andrew Pinski
Match has a pattern which converts `vec_cond(vec_cond(a,b,0), c, d)` into `vec_cond(a & b, c, d)` but since in this case a is a comparison fold will change `a & b` back into `vec_cond(a,b,0)` which causes an infinite loop. The best way to fix this is to enable the patterns for vec_cond(*,vec_cond,*

Re: [PATCH]middle-end match.pd: optimize fneg (fabs (x)) to x | (1 << signbit(x)) [PR109154]

2023-10-09 Thread Andrew Pinski
On Mon, Oct 9, 2023 at 12:20 AM Richard Biener wrote: > > On Sat, 7 Oct 2023, Richard Sandiford wrote: > > > Richard Biener writes: > > >> Am 07.10.2023 um 11:23 schrieb Richard Sandiford > > >> >> Richard Biener writes: > > >>> On Thu, 5 Oct 2023, Tamar Christina wrote: > > >>> > > > I su

[PATCH] MATCH: [PR111679] Add alternative simplification of `a | ((~a) ^ b)`

2023-10-09 Thread Andrew Pinski
So currently we have a simplification for `a | ~(a ^ b)` but that does not match the case where we had originally `(~a) | (a ^ b)` so we need to add a new pattern that matches that and uses bitwise_inverted_equal_p that also catches comparisons too. OK? Bootstrapped and tested on x86_64-linux-gnu

Re: [PATCH] use get_range_query to replace get_global_range_query

2023-10-10 Thread Andrew Pinski
> > + get_range_query (cfun)->range_of_expr (r, bound); > > expand doesn't have a ranger instance so this is a no-op. I'm unsure > if it would be safe given we're half GIMPLE, half RTL. Please leave it > out. It definitely does not work and can&#x

[PATCH] MATCH: [PR111282] Simplify `a & (b ^ ~a)` to `a & b`

2023-10-10 Thread Andrew Pinski
While `a & (b ^ ~a)` is optimized to `a & b` on the rtl level, it is always good to optimize this at the gimple level and allows us to match a few extra things including where a is a comparison. Note I had to update/change the testcase and-1.c to avoid matching this case as we can match -2 and 1 a

Re: RISC-V: Support CORE-V XCVMAC and XCVALU extensions

2023-10-11 Thread Andrew Pinski
On Wed, Oct 11, 2023 at 6:01 PM juzhe.zh...@rivai.ai wrote: > > ../../../../gcc/gcc/doc/extend.texi:21708: warning: node next `RISC-V Vector > Intrinsics' in menu `CORE-V Built-in Functions' and in sectioning `RX > Built-in Functions' differ > ../../../../gcc/gcc/doc/extend.texi:21716: warning:

[PATCH] MATCH: [PR111432] Simplify `a & (x | CST)` to a when we know that (a & ~CST) == 0

2023-10-13 Thread Andrew Pinski
This adds the simplification `a & (x | CST)` to a when we know that `(a & ~CST) == 0`. In a similar fashion as `a & CST` is handle. I looked into handling `a | (x & CST)` but that I don't see any decent simplifications happening. OK? Bootstrapped and tested on x86_linux-gnu with no regressions.

[PATCH 2/2] [c] Fix PR 101364: ICE after error due to diagnose_arglist_conflict not checking for error

2023-10-14 Thread Andrew Pinski
When checking to see if we have a function declaration has a conflict due to promotations, there is no test to see if the type was an error mark and then calls c_type_promotes_to. c_type_promotes_to is not ready for error_mark and causes an ICE. This adds a check for error before the call of c_ty

[PATCH 1/2] Fix ICE due to c_safe_arg_type_equiv_p not checking for error_mark node

2023-10-14 Thread Andrew Pinski
This is a simple error recovery issue when c_safe_arg_type_equiv_p was added in r8-5312-gc65e18d3331aa999. The issue is that after an error, an argument type (of a function type) might turn into an error mark node and c_safe_arg_type_equiv_p was not ready for that. So this just adds a check for err

[PATCH] MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.

2023-10-15 Thread Andrew Pinski
This improves the `A CMP 0 ? A : -A` set of match patterns to use bitwise_equal_p which allows an nop cast between signed and unsigned. This allows catching a few extra cases which were not being caught before. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog:

[PATCH] Improve factor_out_conditional_operation for conversions and constants

2023-10-15 Thread Andrew Pinski
In the case of a NOP conversion (precisions of the 2 types are equal), factoring out the conversion can be done even if int_fits_type_p returns false and even when the conversion is defined by a statement inside the conditional. Since it is a NOP conversion there is no zero/sign extending happening

[PATCH] [PR31531] MATCH: Improve ~a < ~b and ~a < CST, allow a nop cast inbetween ~ and a/b

2023-10-15 Thread Andrew Pinski
Currently we able to simplify `~a CMP ~b` to `b CMP a` but we should allow a nop conversion in between the `~` and the `a` which can show up. A similarly thing should be done for `~a CMP CST`. I had originally submitted the `~a CMP CST` case as https://gcc.gnu.org/pipermail/gcc-patches/2021-Novem

Re: [PATCH] Add files to discourage submissions of PRs to the GitHub mirror.

2023-10-16 Thread Andrew Pinski
On Mon, Oct 16, 2023, 16:39 Eric Gallager wrote: > Currently there is an unofficial mirror of GCC on GitHub that people > sometimes submit pull requests to: > https://github.com/gcc-mirror/gcc > However, this is not the proper way to contribute to GCC, so that means > that someone (usually Jonath

Re: [PATCH 11/11] aarch64: Add new load/store pair fusion pass.

2023-10-17 Thread Andrew Pinski
On Tue, Oct 17, 2023 at 1:52 PM Alex Coplan wrote: > > This adds a new aarch64-specific RTL-SSA pass dedicated to forming load > and store pairs (LDPs and STPs). > > As a motivating example for the kind of thing this improves, take the > following testcase: > > extern double c[20]; > > double f(do

[COMMITTED] Fix expansion of `(a & 2) != 1`

2023-10-18 Thread Andrew Pinski
I had a thinko in r14-1600-ge60593f3881c72a96a3fa4844d73e8a2cd14f670 where we would remove the `& CST` part if we ended up not calling expand_single_bit_test. This fixes the problem by introducing a new variable that will be used for calling expand_single_bit_test. As afar as I know this can only s

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

2023-10-18 Thread Andrew Pinski
After r14-3110-g7fb65f10285, the canonical form for `a ? ~b : b` changed to be `-(a) ^ b` that means for aarch64 we need to add a few new insn patterns to be able to catch this and change it to be what is the canonical form for the aarch64 backend. A secondary pattern was needed to support a zero_e

[PATCH] c: [PR104822] Don't warn about converting NULL to different sso endian

2023-10-19 Thread Andrew Pinski
In a similar way we don't warn about NULL pointer constant conversion to a different named address we should not warn to a different sso endian either. This adds the simple check. Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR c/104822 gcc/c/ChangeLog: * c-t

[PATCH] c: [PR100532] Fix ICE when an agrgument was an error mark

2023-10-19 Thread Andrew Pinski
In the case of convert_argument, we would return the same expression back rather than error_mark_node after the error message about trying to convert to an incomplete type. This causes issues in the gimplfier trying to see if another conversion is needed. The code here dates back to before the rev

Re: [PATCH, GCC, AARCH64] Add support for +profile extension

2018-07-09 Thread Andrew Pinski
On Mon, Jul 9, 2018 at 6:21 AM Andre Vieira (lists) wrote: > > Hi, > > This patch adds support for the Statistical Profiling Extension (SPE) on > AArch64. Even though the compiler will not generate code any differently > given this extension, it will need to pass it on to the assembler in > order

Re: [RFC] Fix recent popcount change is breaking

2018-07-10 Thread Andrew Pinski
On Tue, Jul 10, 2018 at 6:14 PM Kugan Vivekanandarajah wrote: > > On 10 July 2018 at 23:17, Richard Biener wrote: > > On Tue, Jul 10, 2018 at 3:06 PM Kugan Vivekanandarajah > > wrote: > >> > >> Hi, > >> > >> Jeff told me that the recent popcount built-in detection is causing > >> kernel build is

Re: [RFC] Fix recent popcount change is breaking

2018-07-10 Thread Andrew Pinski
On Tue, Jul 10, 2018 at 6:35 PM Kugan Vivekanandarajah wrote: > > Hi Andrew, > > On 11 July 2018 at 11:19, Andrew Pinski wrote: > > On Tue, Jul 10, 2018 at 6:14 PM Kugan Vivekanandarajah > > wrote: > >> > >> On 10 July 2018 at 23:17, Richard Biener &g

Re: [PATCH][AARCH64] PR target/84521 Fix frame pointer corruption with -fomit-frame-pointer with __builtin_setjmp

2018-07-31 Thread Andrew Pinski
On Tue, Jul 31, 2018 at 2:43 PM James Greenhalgh wrote: > > On Thu, Jul 12, 2018 at 12:01:09PM -0500, Sudakshina Das wrote: > > Hi Eric > > > > On 27/06/18 12:22, Wilco Dijkstra wrote: > > > Eric Botcazou wrote: > > > > > >>> This test can easily be changed not to use optimize since it doesn't >

Re: [PATCH] move the (a-b) CMP 0 ? (a-b) : (b-a) optimization from fold_cond_expr_with_comparison to match

2023-10-19 Thread Andrew Pinski
On Mon, Jul 12, 2021 at 4:47 AM Richard Biener via Gcc-patches wrote: > > On Sun, Jul 11, 2021 at 4:12 AM apinski--- via Gcc-patches > wrote: > > > > From: Andrew Pinski > > > > This patch moves the (a-b) CMP 0 ? (a-b) : (b-a) optimization > > from

Re: [PATCH 2/2] c++: remove NON_DEPENDENT_EXPR, part 2

2023-10-20 Thread Andrew Pinski
On Mon, Sep 25, 2023 at 1:43 PM Patrick Palka wrote: > > This much more mechanical patch removes build_non_dependent_expr > (and make_args_non_dependent) and adjusts callers accordingly, > no functional change. This broke the RUST front-end which decided to copy/reuse the C++ code for constexpr

[PATCH] convert_to_complex vs invalid_conversion [PR111903]

2023-10-21 Thread Andrew Pinski
convert_to_complex when creating a COMPLEX_EXPR does not currently check if either the real or imag parts was not error_mark_node. This later on confuses the gimpilfier when there was a SAVE_EXPR wrapped around that COMPLEX_EXPR. The simple fix is after calling convert inside convert_to_complex_1,

Re: [PATCH] move the (a-b) CMP 0 ? (a-b) : (b-a) optimization from fold_cond_expr_with_comparison to match

2023-10-21 Thread Andrew Pinski
On Thu, Oct 19, 2023 at 10:13 PM Andrew Pinski wrote: > > On Mon, Jul 12, 2021 at 4:47 AM Richard Biener via Gcc-patches > wrote: > > > > On Sun, Jul 11, 2021 at 4:12 AM apinski--- via Gcc-patches > > wrote: > > > > > > From: Andrew Pinski > &

[PATCHv2] move the (a-b) CMP 0 ? (a-b) : (b-a) optimization from fold_cond_expr_with_comparison to match

2023-10-21 Thread Andrew Pinski
From: Andrew Pinski This patch moves the `(a-b) CMP 0 ? (a-b) : (b-a)` optimization from fold_cond_expr_with_comparison to match. Bootstrapped and tested on x86_64-linux-gnu. Changes in: v2: Removes `(a == b) ? 0 : (b - a)` handling since it was handled via r14-3606-g3d86e7f4a8ae

Re: [PATCH] gcc.c-torture/execute/builtins/fputs.c: Define _GNU_SOURCE

2023-10-22 Thread Andrew Pinski
a lib-fputs.c file which will define a fputs_unlock which is how it will link even if the libc does not define a fputs_unlock. Thanks, Andrew Pinski > > gcc/testsuite/ > > * gcc.c-torture/execute/builtins/fputs.c (_GNU_SOURCE): > Define. > > --- > gcc/te

[PATCH] Use error_mark_node after error in convert

2023-10-22 Thread Andrew Pinski
While working on PR c/111903, I Noticed that convert will convert integer_zero_node to that type after an error instead of returning error_mark_node. >From what I can tell this was the old way of not having error recovery since other places in this file does return error_mark_node and the places I

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

2023-10-22 Thread Andrew Pinski
After r14-3110-g7fb65f10285, the canonical form for `a ? ~b : b` changed to be `-(a) ^ b` that means for aarch64 we need to add a few new insn patterns to be able to catch this and change it to be what is the canonical form for the aarch64 backend. A secondary pattern was needed to support a zero_e

[PATCH] match: Fix the `popcnt(a&b) + popcnt(a|b)` patthern for types [PR111913]

2023-10-23 Thread Andrew Pinski
So this pattern needs a little help on the gimple side of things to know what the type popcount should be. For most builtins, the type is the same as the input but popcount and others are not. And when using it with another outer expression, genmatch needs some slight help to know that the return

Re: Inquiry about ARM gcc5 CVE-2023-4039 Patch

2023-10-23 Thread Andrew Pinski
issue with any correct code that GCC will process. GCC does not consider this a security issue according to its security policy. See the "Security features implemented in GCC" section of https://gcc.gnu.org/git/?p=gcc.git;a=blob_plain;f=SECURITY.txt;hb=HEAD for more information on that policy. Thanks, Andrew Pinski > > Best regards,

[PATCHv2] Improve factor_out_conditional_operation for conversions and constants

2023-10-23 Thread Andrew Pinski
In the case of a NOP conversion (precisions of the 2 types are equal), factoring out the conversion can be done even if int_fits_type_p returns false and even when the conversion is defined by a statement inside the conditional. Since it is a NOP conversion there is no zero/sign extending happening

[PATCH] match: Simplify `a != C1 ? abs(a) : C2` when C2 == abs(C1) [PR111957]

2023-10-24 Thread Andrew Pinski
This adds a match pattern for `a != C1 ? abs(a) : C2` which gets simplified to `abs(a)`. if C1 was originally *_MIN then change it over to use absu instead of abs. Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/111957 gcc/ChangeLog: * match

[PATCH] Improve tree_expr_nonnegative_p by using the ranger [PR111959]

2023-10-24 Thread Andrew Pinski
I noticed we were missing optimizing `a / (1 << b)` when we know that a is nonnegative but only due to ranger information. This adds the use of the global ranger to tree_single_nonnegative_warnv_p for SSA_NAME. I didn't extend tree_single_nonnegative_warnv_p to use the ranger for floating point nor

Re: [PATCH] match: Simplify `a != C1 ? abs(a) : C2` when C2 == abs(C1) [PR111957]

2023-10-26 Thread Andrew Pinski
On Thu, Oct 26, 2023 at 2:24 AM Richard Biener wrote: > > On Wed, Oct 25, 2023 at 5:37 AM Andrew Pinski wrote: > > > > This adds a match pattern for `a != C1 ? abs(a) : C2` which gets simplified > > to `abs(a)`. if C1 was originally *_MIN then change it over to use absu

Re: [PATCH] Improve tree_expr_nonnegative_p by using the ranger [PR111959]

2023-10-26 Thread Andrew Pinski
On Thu, Oct 26, 2023 at 2:29 AM Richard Biener wrote: > > On Wed, Oct 25, 2023 at 5:51 AM Andrew Pinski wrote: > > > > I noticed we were missing optimizing `a / (1 << b)` when > > we know that a is nonnegative but only due to ranger information. > > This

Re: Ping: [PATCH v2 0/2] Replace intl/ with out-of-tree GNU gettext

2023-10-26 Thread Andrew Pinski
d modern gettext > > > > Ping on this patch series. One comment from me. It would be nice to update install.texi in gcc/doc/ to make a mention of this requirement for non-glibc hosts. Thanks, Andrew Pinski > > TIA, have a lovely night :-) > -- > Arsen Arsenović

Re: [PATCH] testsuite, aarch64: Normalise options to aarch64.exp.

2023-10-26 Thread Andrew Pinski
On Thu, Oct 26, 2023 at 11:58 AM Iain Sandoe wrote: > > tested on cfarm185 (aarch64-linux-gnu, xgene1) and with the aarch64 > Darwin prototype. It is possible that some initial fallout could occur > on some test setups (where the default has been catered for in some > way) - but that should stabi

Re: [PATCH htdocs v2] bugs: Mention -D_GLIBCXX_ASSERTIONS and -D_GLIBCXX_DEBUG

2023-10-26 Thread Andrew Pinski
On Thu, Oct 26, 2023 at 12:18 PM Sam James wrote: > > These options both enabled more checking within the C++ standard library > and can expose errors in submitted code. > > -D_GLIBCXX_DEBUG is mentioned separately because while we want people to try > it, > it's not always feasible because it re

[PATCH] MATCH: Simplify `(X &| B) CMP X` if possible [PR 101590]

2023-10-26 Thread Andrew Pinski
From: Andrew Pinski I noticed we were missing these simplifications so let's add them. This adds the following simplifications: U & N <= U -> true U & N > U -> false When U is known to be as non-negative. When N is also known to be non-negative, this is also true: U

Re: [PATCH] MATCH: Simplify `(X &| B) CMP X` if possible [PR 101590]

2023-10-27 Thread Andrew Pinski
On Thu, Oct 26, 2023 at 11:56 PM Richard Biener wrote: > > > > > Am 26.10.2023 um 23:10 schrieb Andrew Pinski : > > > > From: Andrew Pinski > > > > I noticed we were missing these simplifications so let's add them. > > > > This adds the

Re: [PATCH] testsuite, Darwin: Add support for Mach-O function body scans.

2023-10-27 Thread Andrew Pinski
On Fri, Oct 27, 2023 at 4:00 AM Iain Sandoe wrote: > > Hi Richard, > > > On 26 Oct 2023, at 21:00, Iain Sandoe wrote: > > >> On 26 Oct 2023, at 20:49, Richard Sandiford > >> wrote: > >> > >> Iain Sandoe writes: > >>> This was written before Thomas' modification to the ELF-handling to allow > >

[PATCH 0/3] start of moving value replacement from phiopt to match

2023-10-29 Thread Andrew Pinski
generation independently of that move. Note this does not add the absorbing_element_p optimizations yet; I filed PR 112271 to record that move. Andrew Pinski (3): MATCH: first of the value replacement moving from phiopt MATCH: Move jump_function_from_stmt support to match.pd MATCH: Add some more

[PATCH 2/3] MATCH: Move jump_function_from_stmt support to match.pd

2023-10-29 Thread Andrew Pinski
This moves the value_replacement support for jump_function_from_stmt to match pattern. This allows us to optimize things earlier in phiopt1 rather than waiting to phiopt2. Which means phiopt1 needs to be disable for vrp03.c testcase. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog:

[PATCH 3/3] MATCH: Add some more value_replacement simplifications to match

2023-10-29 Thread Andrew Pinski
This moves a few more value_replacements simplifications to match. /* a == 1 ? b : a * b -> a * b */ /* a == 1 ? b : b / a -> b / a */ /* a == -1 ? b : a & b -> a & b */ Also adds a testcase to show can we catch these where value_replacement would not (but other passes would). Bootstrapped and

[PATCH 1/3] MATCH: first of the value replacement moving from phiopt

2023-10-29 Thread Andrew Pinski
This moves a few simple patterns that are done in value replacement in phiopt over to match.pd. Just the simple ones which might show up in other code. This allows some optimizations to happen even without depending on sinking from happening and in some cases where phiopt is not invoked (cond-1.c

Re: [PATCH] Testsuite, i386: Fix test by passing -march

2023-10-30 Thread Andrew Pinski
On Mon, Oct 30, 2023 at 5:05 AM Iain Sandoe wrote: > > > > > On 30 Oct 2023, at 11:53, FX Coudert wrote: > > > The newly introduced test gcc.target/i386/pr111698.c currently fails on > > Darwin, where the default arch is core2. > > Andrew suggested in https://gcc.gnu.org/bugzilla/show_bug.cgi?id

Re: [PATCH 2/3] MATCH: Move jump_function_from_stmt support to match.pd

2023-10-30 Thread Andrew Pinski
On Mon, Oct 30, 2023 at 2:29 AM Richard Biener wrote: > > On Sun, Oct 29, 2023 at 5:41 PM Andrew Pinski wrote: > > > > This moves the value_replacement support for jump_function_from_stmt > > to match pattern. > > This allows us to optimize things earlier in phio

Re: [PATCH 1/2] match.pd: Support combine cond_len_op + vec_cond similar to cond_op

2023-10-30 Thread Andrew Pinski
On Wed, Sep 20, 2023 at 6:10 AM Lehua Ding wrote: > > This patch adds combine cond_len_op and vec_cond to cond_len_op like > cond_op. > > gcc/ChangeLog: > > * gimple-match.h (gimple_match_op::gimple_match_op): > Add interfaces for more arguments. > (gimple_match_op::set_op)

Re: [PATCH 1/2] match.pd: Support combine cond_len_op + vec_cond similar to cond_op

2023-10-31 Thread Andrew Pinski
On Tue, Oct 31, 2023 at 12:08 AM Lehua Ding wrote: > > Hi Andrew, > > On 2023/10/31 14:48, Andrew Pinski wrote: > >> +inline > >> +gimple_match_op::gimple_match_op (const gimple_match_cond &cond_in, > >> +

Re: [PATCH] ifcvt/vect: Emit COND_ADD for conditional scalar reduction.

2023-11-02 Thread Andrew Pinski
(_40 != 6.4e+1) // not working It is test_epi32_ps which is failing with TEST_PS macro and the plus operand that uses TESTOP: TESTOP (add, +, float, ps, 0.0f); \ I have not reduced the testcase any further though. Thanks, Andrew Pinski > > Regards &

Re: [PATCH] Remove unnecessary "& 1" in year_month_day_last::day()

2023-11-05 Thread Andrew Pinski
On Sun, Nov 5, 2023 at 9:13 AM Cassio Neri wrote: > > I could not find any entry in gcc's bugzilla for that. Perhaps my search > wasn't good enough. I filed https://gcc.gnu.org/PR112395 with a first attempt at the patch (will double check it soon). Thanks, Andrew > > > On Sun, 5 Nov 2023 at 15

Re: [PATCH][Aarch64] Fix vec_perm cost for thunderx2t99

2019-11-01 Thread Andrew Pinski
hmarks. > > Bootstrapped OK on aarch64-linux-gnu. > > OK for trunk? Maybe the big question is vec_perm used for both 1 input and 2 input cases? If so maybe splitting the two cases would be important too. Otherwise this is ok from my point of view but I can't approve it. Th

Re: [PATCH] combine: Don't generate IF_THEN_ELSE

2019-11-03 Thread Andrew Pinski
On Thu, May 9, 2019 at 5:05 PM Segher Boessenkool wrote: > > On all targets I managed to test (21) this results in better code. Only > alpha ends up with slightly bigger code. > > Committing to trunk. This introduced: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92342 Thanks

Re: [PATCH] Refactor tree-loop-distribution for thread safety

2019-11-12 Thread Andrew Pinski
On Tue, Nov 12, 2019 at 1:16 AM Richard Biener wrote: > > On Sat, Nov 9, 2019 at 3:26 PM Giuliano Belinassi > wrote: > > > > Hi all, > > > > This patch refactors tree-loop-distribution.c for thread safety without > > use of C11 __thread feature. All global variables were moved to a struct > > whi

Re: [PATCH] Switch gcc ftp URL's to http

2019-11-13 Thread Andrew Pinski
On Wed, Nov 13, 2019 at 12:37 PM Janne Blomqvist wrote: > > The FTP protocol is getting long in the tooth, and we should emphasize > HTTP where that is available. This patch changes various gcc.gnu.org > URL's to instead use HTTP. May I suggest you use https instead of http here? Because it will

Re: [PATCH][AArch64] Fix shrinkwrapping interactions with atomics (PR92692)

2020-01-16 Thread Andrew Pinski
On Thu, Jan 16, 2020 at 5:14 AM Richard Sandiford wrote: > > Wilco Dijkstra writes: > > The separate shrinkwrapping pass may insert stores in the middle > > of atomics loops which can cause issues on some implementations. > > Avoid this by delaying splitting of atomic patterns until after > > pro

Re: [PATCH][AArch64] Fix shrinkwrapping interactions with atomics (PR92692)

2020-01-16 Thread Andrew Pinski
On Thu, Jan 16, 2020 at 5:51 PM Andrew Pinski wrote: > > On Thu, Jan 16, 2020 at 5:14 AM Richard Sandiford > wrote: > > > > Wilco Dijkstra writes: > > > The separate shrinkwrapping pass may insert stores in the middle > > > of atomics loops which c

Re: [PATCH] Fix PR 93242: patchable-function-entry broken on MIPS

2020-01-22 Thread Andrew Pinski
On Wed, Jan 22, 2020 at 12:48 PM Jeff Law wrote: > > On Mon, 2020-01-20 at 09:42 +0100, Richard Biener wrote: > > On Sat, Jan 18, 2020 at 1:47 AM wrote: > > > From: Andrew Pinski > > > > > > On MIPS, .set noreorder/reorder needs to emitted around &

Re: [PATCH] Fix PR 93242: patchable-function-entry broken on MIPS

2020-01-22 Thread Andrew Pinski
On Wed, Jan 22, 2020 at 1:16 PM Andrew Pinski wrote: > > On Wed, Jan 22, 2020 at 12:48 PM Jeff Law wrote: > > > > On Mon, 2020-01-20 at 09:42 +0100, Richard Biener wrote: > > > On Sat, Jan 18, 2020 at 1:47 AM wrote: > > > > From: Andrew Pinski > >

Re: [PATCH] Allow tree-ssa.exp to be run by itself

2020-01-22 Thread Andrew Pinski
On Wed, Jan 22, 2020 at 3:39 PM Jakub Jelinek wrote: > > On Tue, Jan 21, 2020 at 05:56:38PM -0800, apin...@marvell.com wrote: > > From: Andrew Pinski > > > > tree-ssa testcases sometimes check autovect effective target > > but does not set it up. On MIPS, those te

Re: [PATCH] Allow tree-ssa.exp to be run by itself

2020-01-22 Thread Andrew Pinski
On Wed, Jan 22, 2020 at 4:34 PM Jakub Jelinek wrote: > > On Wed, Jan 22, 2020 at 04:22:54PM -0800, Andrew Pinski wrote: > > > I see > > > pr88497-1.c:/* { dg-require-effective-target vect_double } */ > > > pr88497-2.c:/* { dg-require-effective-target vect_flo

Re: [PATCH 2/2] analyzer: avoid use of fold_build2

2020-01-31 Thread Andrew Pinski
hese are all true integer constants, then you might want to use tree_int_cst_compare instead of even using fold_binary/fold_build2. Also if you are doing equal but always constant (but not always integer ones), you could use simple_cst_equal instead. Thanks, Andrew Pinski > >

Re: [PATCH][AArch64] Improve popcount expansion

2020-02-03 Thread Andrew Pinski
On Mon, Feb 3, 2020 at 7:02 AM Wilco Dijkstra wrote: > > The popcount expansion uses umov to extend the result and move it back > to the integer register file. If we model ADDV as a zero-extending > operation, fmov can be used to move back to the integer side. This > results in a ~0.5% speedup on

Re: libgo patch committed: Update to Go1.14beta1

2020-02-04 Thread Andrew Pinski
Something like attached. I will clean it up next week and submit it then. It should also fix some arm64be related issues too. Thanks, Andrew Pinski On Mon, Feb 3, 2020 at 6:17 PM Ian Lance Taylor wrote: > > On Sun, Feb 2, 2020 at 2:27 AM Andreas Schwab wrote: > > > > I'

[FYI] Patches that fix testing santiziers with qemu user mode

2020-02-08 Thread Andrew Pinski
it when used with asan instead of in general. With these two patches, I get clean test results on aarch64-linux-gnu. I am mainly sending them here as I think they are useful for people who are doing testing; especially cross testing. Thanks, Andrew Pinski From

Re: [PATCH v2] [MIPS] Prevent allocation of a GPR for a floating mode pseudo

2020-02-10 Thread Andrew Pinski
hich this improves the code generation? I can see this producing much worse code for soft-float (which I still care about). Thanks, Andrew Pinski > > gcc/ChangeLog: > > * gcc/config/mips/mips.c (mips_ira_change_pseudo_allocno_class): > Limit the allocation of floating

Re: [PATCH][AArch64] Improve clz patterns

2020-02-12 Thread Andrew Pinski
For an example on OcteonTX (and ThunderX1), the cost of CLS/CLZ is 4 cycles, the same as the cost as a multiple; on OcteonTX2 it is 5 cycles (again the same cost as a multiple). Thanks, Andrew Pinski > > > ensures we still get efficient code for this example: > > > > [AArc

Re: [PATCH] aarch64: Allow -mcpu=generic -march=armv8.5-a

2020-02-14 Thread Andrew Pinski
On Fri, Feb 14, 2020 at 2:12 AM Richard Earnshaw (lists) wrote: > > On 14/02/2020 03:18, apin...@marvell.com wrote: > > From: Andrew Pinski > > > > Right if someone supplies a -mcpu= option and then overrides > > that option with -march=*, we get a warning when they

Re: [PATCH] [AARCH64] Improve vector generation cost model

2019-12-07 Thread Andrew Pinski
On Thu, May 2, 2019 at 9:10 AM Andrew Pinski wrote: > > On Thu, Mar 14, 2019 at 6:19 PM wrote: > > > > From: Andrew Pinski > > > > Hi, > > On OcteonTX2, ld1r and ld1 (with a single lane) are split > > into two different micro-ops unlike most other t

[committed] Add a bswap testcase

2019-12-08 Thread Andrew Pinski
Pinski * gcc.c-torture/execute/bswap-3.c: New testcase. Index: ChangeLog === --- ChangeLog (revision 279099) +++ ChangeLog (working copy) @@ -1,3 +1,7 @@ +2019-12-08 Andrew Pinski + + * gcc.c-torture/execute/bswap-3.c

[Committed] Add C testcases for PR 86659

2019-12-13 Thread Andrew Pinski
to SLOW_BYTE_ACCESS set to 0. But I changed SLOW_BYTE_ACCESS to be 1 when I was testing the code. Committed as obvious after a simple test. Thanks, Andrew Pinski testsuite/ChangeLog: 2019-12-13 Andrew Pinski * gcc.c-torture/execute/pr86659-1.c: New test. * gcc.c-torture

Re: [PATCH, c] all plattforms: support using a CC_REG instead cc0_rtx

2019-12-13 Thread Andrew Pinski
Segher > > > since I still don't get it: i386.md expands cbranch into two insns, e.g. > > > (insn 17 16 18 4 (set (reg:CCNO 17 flags) > (compare:CCNO (reg/v:SI 96 [ ]) > (const_int 0 [0]))) "x.c":2 3 {*cmpsi_ccno_1} > (nil)) > (jump_insn 18 17 19 4 (set (pc) > (if_then_else (le (reg:CCNO 17 flags) > (const_int 0 [0])) > (label_ref:DI 28) > (pc))) "x.c":2 627 {*jcc_1} > (int_list:REG_BR_PROB 1500 (nil)) > > > What mechanism guarantees that no other insn is inserted inbetween the > compare and the jump? >(Note that at these stages clobbers are not yet tracked as CLOBBER insns). All of the instructions that need CLOBBER has it at this point. So I think your back-end is not describing what it should be describing. The old saying inside GCC is lie to reload and get wrong code. That rings true here too. Thanks, Andrew Pinski > > Or is i386 also "broken"? > > Stefan

Re: [PATCH] Fix PR70985

2019-12-13 Thread Andrew Pinski
r lowering for GCC 11, we don't regress (there was no testcase beforehand). Thanks, Andrew Pinski > > Richard. > > 2016-05-09 Richard Biener > > PR tree-optimization/70985 > * match.pd (BIT_FIELD_REF -> (type)): Disable on GIMPLE when >

[Committed] Add some __int128 bitfield testcases

2019-12-15 Thread Andrew Pinski
. Thanks, Andrew Pinski testsuite/ChangeLog: * gcc.c-torture/compile/bitfield-1.c: New test. * gcc.c-torture/compile/bitfield-endian-1.c: New test. * gcc.c-torture/compile/bitfield-endian-2.c: New test. Index: ChangeLog

Re: [patch] Guard aarch64/aapcs64 tests using abitest.S by check_weak_available

2019-12-16 Thread Andrew Pinski
linux. > > Is this ok to commit ? Why does VxWorks not have weak symbol support when it is an elf target? I can understand it not having support in a loader but these symbols should all be resolved at build time. Thanks, Andrew Pinski > > Thanks in advance! > > With Kind Regard

Re: [PATCH][RFC] Introduce BIT_FIELD_INSERT

2019-12-16 Thread Andrew Pinski
On Thu, Nov 15, 2018 at 12:31 AM Richard Biener wrote: > > On Thu, 15 Nov 2018, Richard Biener wrote: > > > On Wed, 14 Nov 2018, Andrew Pinski wrote: > > > > > On Fri, May 13, 2016 at 3:51 AM Richard Biener wrote: > > > > > > > > > > &g

Re: [PATCH][RFC] Introduce BIT_FIELD_INSERT

2019-12-16 Thread Andrew Pinski
On Mon, Dec 16, 2019 at 6:32 PM Andrew Pinski wrote: > > On Thu, Nov 15, 2018 at 12:31 AM Richard Biener wrote: > > > > On Thu, 15 Nov 2018, Richard Biener wrote: > > > > > On Wed, 14 Nov 2018, Andrew Pinski wrote: > > > > > > > On Fri,

Re: [PATCH] Fix redundant load missed by fre [tree-optimization 92980]

2019-12-17 Thread Andrew Pinski
h instead of HOST_WIDE_INT here, then you don't need the tree_fits_uhwi_p check. Add a testcase should tests the pattern directly rather than indirectly. Also we are in stage 3 which means bug fixes only so this might/should wait until stage 1. Thanks, Andrew Pinski > > changelog > g

Re: [PATCH] Fix redundant load missed by fre [tree-optimization 92980]

2019-12-18 Thread Andrew Pinski
basically doing a factoring and undoing an optimization that was done in the front-end (see pointer_int_sum in c-common.c). But I think the optimization in the front-end should be removed. It dates from 1992, a time when GCC did not anything on the tree level and there was no GCSE (PRE) and the CSE was limited. Thanks, Andrew Pinski > > > > Segher > > > > -- > BR, > Hongtao

[Committed] Fix testsuite/92998: dupq_1.c and simd-abi-8.c fail on big-endian

2019-12-21 Thread Andrew Pinski
little-endian only. Committed as obvious after a test on aarch64_be-linux-gnu. Thanks, Andrew Pinski testsuite/ChangeLog: PR testsuite/92998 * gcc.target/aarch64/sve/acle/general/dupq_1.c: Restrict to aarch64_little_endian only. * gcc.target/aarch64/torture/simd

Re: [PATCH] PR tree-optimization/90836 Missing popcount pattern matching

2019-12-29 Thread Andrew Pinski
> > aarch64-linux-gnu, which took some time. > > > > attached v3. > > OK. This introduced PR 93098 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93098 ). Thanks, Andrew Pinski > > Thanks, > Richard. > > > Thanks, > > Dmitrij > > > > On

[Committed] Fix libobjc on Windows (PR93099)

2020-01-01 Thread Andrew Pinski
being in use. Committed after the bug reported tested the patch for me. Thanks, Andrew Pinski ChangeLog: * objc/objc-decls.h (objc_EXPORT): Define it to extern for DLL_EXPORT define case.

Re: [Committed] Fix libobjc on Windows (PR93099)

2020-01-01 Thread Andrew Pinski
On Wed, Jan 1, 2020 at 2:14 PM Andrew Pinski wrote: > > Hi, > On Windows if DLLL_EXPORT was declared objc_EXPORT was defined to an > empty string. This is wrong as that would produce common symbols in > the headers; except now -fno-common is the default. > So setting the d

[Committed] Add two testcases for 1bit bit-field

2020-01-02 Thread Andrew Pinski
Hi, While working an optimization, the optimization would produce wrong code but I noticed there was no testcase for that case at all. Committed as obvious. Thanks, Andrew Pinski ChangeLog: * gcc.c-torture/execute/bitfld-8.c: New testcase. * gcc.c-torture/execute/bitfld-9.c: New testcase

[PATCH] Simplify ((A & N) ==/!= CST1) &/| ((A & M) ==/!= CST2)

2020-01-03 Thread Andrew Pinski
that in a follow up patch. NOTE this is a step forward to be able to remove the fold_truth_andor_1 and optimize_bit_field_compare from fold-const.c. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. Thanks, Andrew Pinski ChangeLog: * match.pd (((A & N) ==/!= CST1) &/| ((A &

[Committed] New bit-field testcases Part 3/N

2020-01-05 Thread Andrew Pinski
Hi, I found some more testcases that would cause an internal compiler error while working on my bit-field lowering pass. Since there was no testcase already done, I thought it would be best if it was applied to the trunk. Thanks, Andrew Pinski testsuite/ChangeLog: * gcc.c-torture/compile

Re: [patch] relax aarch64 stack-clash tests depedence on alloca.h

2020-01-06 Thread Andrew Pinski
n some other > places in the testsuite. > > This cures the failures on VxWorks and bootstrap+regtest > fine on aarch64 linux. > > Ok to commit ? Just one small suggestion: Instead of: - char* pStr = alloca(SIZE); + char* pStr = __builtin_alloca(SIZE); Why not just do: -#incl

Re: [PATCH][RFC] Introduce BIT_FIELD_INSERT

2020-01-07 Thread Andrew Pinski
On Mon, Jan 6, 2020 at 11:36 PM Richard Biener wrote: > > On Mon, 16 Dec 2019, Andrew Pinski wrote: > > > On Thu, Nov 15, 2018 at 12:31 AM Richard Biener wrote: > > > > > > On Thu, 15 Nov 2018, Richard Biener wrote: > > > > > > > On Wed, 14 N

Re: [PATCH] std::experimental::simd

2020-01-07 Thread Andrew Pinski
On Tue, Jan 7, 2020 at 3:01 AM Matthias Kretz wrote: > > Is there any chance left we can get this done for 10.1? If not, can we please > get it ready for 10.2 ASAP? > > Cheers, > Matthias > > On Montag, 14. Oktober 2019 14:12:12 CET Matthias Kretz wrote: > > Let me try again to get this patch re

Re: [committed] d: Fix gdc -O2 -mavx generates misaligned vmovdqa instruction [PR114171]

2024-03-03 Thread Andrew Pinski
gt; ())); > > + tmode = build_aligned_type (tmode, TYPE_ALIGN (stype)); You might also need to build a may_alias variant too. Or make sure the access is using the correct aliasing set. I have not checked if the D front-end does anything special for aliasing sets so I am n

Re: [PATCH] testsuite: xfail test for arm

2024-03-09 Thread Andrew Pinski
ithout the xfail part). Also makes sense to add a reference to r14-6517-gb7e4a4c626e to the dg-bogus in the source too. Thanks, Andrew Pinski > > -- > > On arm-none-eabi, the test case fails with > .../null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c:63:65: warning: > converting

Re: [RFC] [PR tree-optimization/92539] Optimize away tests against invalid pointers

2024-03-10 Thread Andrew Pinski
On Sun, Mar 10, 2024 at 2:04 PM Jeff Law wrote: > > Here's a potential approach to fixing PR92539, a P2 -Warray-bounds false > positive triggered by loop unrolling. > > As I speculated a couple years ago, we could eliminate the comparisons > against bogus pointers. Consider: > > >[local count

[COMMITTED] Fold: Fix up merge_truthop_with_opposite_arm for NaNs [PR95351]

2024-03-10 Thread Andrew Pinski
-1.c: New test. Signed-off-by: Andrew Pinski --- gcc/fold-const.cc | 3 ++- gcc/testsuite/gcc.dg/float_opposite_arm-1.c | 17 + 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/float_opposite_arm-1.c diff --git a

  1   2   3   4   5   6   7   8   9   10   >