[PATCH] lto: Bypass assembler when generating LTO object files. & libiberty: lto: Addition of .symtab in elf file.

2023-06-30 Thread Rishi Raj via Gcc-patches
This series of two patches enables the output of the LTO object file without an assembler. As of now, .symtab is emitted with __gnu_lto_slim symbol. To test, follow the instructions in the commit message of patch 1. Also, as suggested by Honza, I am putting these patches on devel/bypass-asm branch.

[PATCH v3 3/3] c++: Improve location information in constant evaluation

2023-06-30 Thread Nathaniel Shead via Gcc-patches
This patch updates 'input_location' during constant evaluation to ensure that errors in subexpressions that lack location information still provide accurate diagnostics. By itself this change causes some small regressions in diagnostic quality for circumstances where errors used 'input_location' b

[PATCH v3 2/3] c++: Improve constexpr error for dangling local variables

2023-06-30 Thread Nathaniel Shead via Gcc-patches
Currently, when typeck discovers that a return statement will refer to a local variable it rewrites to return a null pointer. This causes the error messages for using the return value in a constant expression to be unhelpful, especially for reference return values. This patch removes this "optimis

[PATCH v3 1/3] c++: Track lifetimes in constant evaluation [PR70331,PR96630,PR98675]

2023-06-30 Thread Nathaniel Shead via Gcc-patches
This adds rudimentary lifetime tracking in C++ constexpr contexts, allowing the compiler to report errors with using values after their backing has gone out of scope. We don't yet handle other ways of accessing values outside their lifetime (e.g. following explicit destructor calls). PR c+

[PATCH v3 0/3] c++: Track lifetimes in constant evaluation [PR70331,...]

2023-06-30 Thread Nathaniel Shead via Gcc-patches
This is an update of the patch series at https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614811.html Changes since v2: - Use a separate 'hash_set' to track expired variables instead of adding a flag to 'lang_decl_base'. - Use 'iloc_sentinel' to propagate location information down to sube

[PATCH ver 2] rs6000, __builtin_set_fpscr_rn add retrun value

2023-06-30 Thread Carl Love via Gcc-patches
GCC maintainers: Ver 2, Went back thru the requirements and emails. Not sure where I came up with the requirement for an overloaded version with double argument. Removed the overloaded version with the double argument. Added the macro to announce if the __builtin_set_fpscr_rn returns a void

Re: [PATCH] RISC-V: improve codegen for repeating large constants [3]

2023-06-30 Thread Palmer Dabbelt
On Fri, 30 Jun 2023 17:25:54 PDT (-0700), Andrew Waterman wrote: On Fri, Jun 30, 2023 at 5:13 PM Vineet Gupta wrote: On 6/30/23 16:50, Andrew Waterman wrote: > I don't believe this is correct; the subtraction is needed to account > for the fact that the low part might be negative, resulting

Re: [PATCH] RISC-V: improve codegen for repeating large constants [3]

2023-06-30 Thread Andrew Waterman via Gcc-patches
On Fri, Jun 30, 2023 at 5:13 PM Vineet Gupta wrote: > > > > On 6/30/23 16:50, Andrew Waterman wrote: > > I don't believe this is correct; the subtraction is needed to account > > for the fact that the low part might be negative, resulting in a > > borrow from the high part. See the output for you

Re: [PATCH] RISC-V: improve codegen for repeating large constants [3]

2023-06-30 Thread Vineet Gupta
On 6/30/23 16:50, Andrew Waterman wrote: I don't believe this is correct; the subtraction is needed to account for the fact that the low part might be negative, resulting in a borrow from the high part. See the output for your test case below: $ cat test.c #include int main() { unsigned

Re: [PATCH] rs6000: Update the vsx-vector-6.* tests.

2023-06-30 Thread Peter Bergner via Gcc-patches
On 6/30/23 6:50 PM, Carl Love wrote: > With a little help from Peter and Julian Wang. Objdump decodes some of > the xxlor instructions as xxmr instsructions. The xxmr is a new > mnemonic which will be out in the next ISA. But objdump already > produces it. So if you add the counts for grep xxlo

Re: [PATCH] rs6000: Update the vsx-vector-6.* tests.

2023-06-30 Thread Peter Bergner via Gcc-patches
On 6/30/23 5:20 PM, Carl Love wrote: > So, we have the issue that looking at the assembly gives different > instruction counts then what > >dg-final { scan-assembler-times {\mxxlor\M} } > > comes up with??? I recommend not even counting xxlor at all, since the majority of them come from vsx

Re: [PATCH] rs6000: Update the vsx-vector-6.* tests.

2023-06-30 Thread Carl Love via Gcc-patches
Kewen: On Fri, 2023-06-30 at 15:20 -0700, Carl Love wrote: > So, went to look at the assembly to verify my comment on the > difference > being related to the loads. I decided to actually count the > instructions just to verify the number in the assembly files. > Before, > I just looked at the ass

Re: [PATCH] RISC-V: improve codegen for repeating large constants [3]

2023-06-30 Thread Andrew Waterman via Gcc-patches
I don't believe this is correct; the subtraction is needed to account for the fact that the low part might be negative, resulting in a borrow from the high part. See the output for your test case below: $ cat test.c #include int main() { unsigned long result, tmp; asm ( "li %1,-252645

Re: [PATCH] RISC-V: improve codegen for repeating large constants [3]

2023-06-30 Thread Vineet Gupta
On 6/30/23 16:33, Vineet Gupta wrote: Ran into a minor snafu in const splitting code when playing with test case from an old PR/23813. long long f(void) { return 0xF0F0F0F0F0F0F0F0ull; } This currently generates li a5,-252645376 addia5,a5,241 li

[PATCH] RISC-V: improve codegen for repeating large constants [3]

2023-06-30 Thread Vineet Gupta
Ran into a minor snafu in const splitting code when playing with test case from an old PR/23813. long long f(void) { return 0xF0F0F0F0F0F0F0F0ull; } This currently generates li a5,-252645376 addia5,a5,241 li a0,-252645376 sllia5,a5,32

[PATCH] c-family: Implement pragma_lex () for preprocess-only mode

2023-06-30 Thread Lewis Hyatt via Gcc-patches
In order to support processing #pragma in preprocess-only mode (-E or -save-temps for gcc/g++), we need a way to obtain the #pragma tokens from libcpp. In full compilation modes, this is accomplished by calling pragma_lex (), which is a symbol that must be exported by the frontend, and which is cur

Re: [PATCH] RISC-V: Support vfwmul.vv combine lowering

2023-06-30 Thread Jeff Law via Gcc-patches
On 6/30/23 04:14, Robin Dapp wrote: The explicit conversions I see are because we need the output of the conversion in multiple vfmul instructions. That won't be helped by the patch you've proposed. FWIW on my local branch and the patch applied I see that the vfwmuls are being generated (al

Re: [PATCH] rs6000: Update the vsx-vector-6.* tests.

2023-06-30 Thread Carl Love via Gcc-patches
Kewen: On Fri, 2023-06-30 at 11:37 +0800, Kewen.Lin wrote: > Hi Carl, > > on 2023/6/30 05:36, Carl Love wrote: > > Kewen: > > > > On Wed, 2023-06-28 at 16:35 +0800, Kewen.Lin wrote: > > > > Yea, I was going with a runnable test and didn't include the > > > > instruction counts. Added back in.

RE: [EXTERNAL] Re: [PATCH] Collect both user and kernel events for autofdo tests and autoprofiledbootstrap

2023-06-30 Thread Eugene Rozenfeld via Gcc-patches
I also set /proc/sys/kernel/perf_event_paranoid to 1 instead of the default 2. -Original Message- From: Gcc-patches On Behalf Of Eugene Rozenfeld via Gcc-patches Sent: Friday, June 30, 2023 2:44 PM To: Sam James ; Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: RE: [EXTERNAL] Re: [P

RE: [EXTERNAL] Re: [PATCH] Collect both user and kernel events for autofdo tests and autoprofiledbootstrap

2023-06-30 Thread Eugene Rozenfeld via Gcc-patches
I don't run this with elevated privileges but I set /proc/sys/kernel/kptr_restrict to 0. Setting that does require elevated privileges. If that's not acceptable, the only fix I can think of is to make that event mapping threshold percentage a parameter to create_gcov and pass something low eno

[PATCH] libstdc++: Enable OpenMP 5.0 pragmas in PSTL headers

2023-06-30 Thread Jonathan Wakely via Gcc-patches
Jakub made a similar change a few yeas ago, but I think it got lost in the recent PSTL rebase. Tested x86_64-linux. Does this look OK for trunk? -- >8 -- This reapplies r10-1314-g32bab8b6ad0a90 which was lost in the recent PSTL rebase from upstream. * include/pstl/pstl_config.h (_PSTL_

[PATCH V4, rs6000] Disable generation of scalar modulo instructions

2023-06-30 Thread Pat Haugen via Gcc-patches
Updated from prior version to address latest review comment (simplify umod3). Disable generation of scalar modulo instructions. It was recently discovered that the scalar modulo instructions can suffer noticeable performance issues for certain input values. This patch disables their generation s

[PATCH 6/7] OpenMP: Support OpenMP 5.0 "declare mapper" directives for C

2023-06-30 Thread Julian Brown
This patch adds support for "declare mapper" directives (and the "mapper" modifier on "map" clauses) for C. 2023-06-30 Julian Brown gcc/c/ * c-decl.cc (c_omp_mapper_id, c_omp_mapper_decl, c_omp_mapper_lookup, c_omp_extract_mapper_directive, c_omp_map_array_section, c_om

[PATCH 5/7] OpenMP: lvalue parsing for map clauses (C)

2023-06-30 Thread Julian Brown
This patch adds support for parsing general lvalues ("locator list item types") for OpenMP "map", "to" and "from" clauses to the C front-end, similar to the previously-posted patch for C++. 2023-06-30 Julian Brown gcc/c/ * c-pretty-print.cc (c_pretty_printer::postfix_expression,

[PATCH 7/7] OpenMP: Fortran "!$omp declare mapper" support

2023-06-30 Thread Julian Brown
This patch implements "omp declare mapper" functionality for Fortran, following the equivalent support for C and C++. This version of the patch has been merged to og13 and contains various fixes for e.g.: * Mappers with deferred-length strings * Array descriptors not being appropriately tran

[PATCH 4/7] OpenMP: C++ "declare mapper" support

2023-06-30 Thread Julian Brown
This patch adds support for OpenMP 5.0 "declare mapper" functionality for C++. I've merged it to og13 based on the last version posted upstream, with some minor changes due to the newly-added 'present' map modifier support. There's also a fix to splay-tree traversal in gimplify.cc:omp_instantiate

[PATCH 2/7] OpenMP: OpenMP 5.2 semantics for pointers with unmapped target

2023-06-30 Thread Julian Brown
This patch fixes two more cases where an unmapped target pointer results in a null pointer on the target instead of a copy of the host pointer. The latter behaviour is required by OpenMP 5.2, which is a change from earlier versions of the standard. This change has already been made in one place by

[PATCH 0/7] [og13] OpenMP: lvalue parsing and "declare mapper" support

2023-06-30 Thread Julian Brown
This patch series provides generalised lvalue ("locator list item") parsing for OpenMP "map", "to" and "from" clauses for C and C++, and "declare mapper" support for C, C++ and Fortran. It is based on the latter part of the patch series sent upstream previously: https://gcc.gnu.org/pipermail/gc

[PATCH 1/7] Fix up merge/formatting errors

2023-06-30 Thread Julian Brown
This patch fixes a couple of minor merge/formatting errors. 2023-06-30 Julian Brown gcc/fortran/ * parse.cc (decode_omp_directive): Add missing break. gcc/ * gimplify.cc (gimplify_adjust_omp_clauses): Fix indentation. --- gcc/fortran/parse.cc | 1 + gcc/gimplify.cc | 4 +

Re: [PATCH 1/2] go: update usage of TARGET_AIX to TARGET_AIX_OS

2023-06-30 Thread Peter Bergner via Gcc-patches
On 6/22/23 10:30 PM, Ian Lance Taylor wrote: > On Thu, Jun 22, 2023, 4: 47 PM Peter Bergner > wrote: On 6/22/23 6: 37 PM, Peter Bergner via Gcc-patches wrote: > On 6/16/23 > >> On Fri, Jun 16, 2023 at 9:00 AM Paul E. Murphy via Gcc-patches > >> mailto:gcc-patches@gcc.gnu.org>> wrote: >

Re: [PATCH 2/19][front-end] C/C++ front-end: add pragma GCC novector

2023-06-30 Thread Jason Merrill via Gcc-patches
On Fri, Jun 30, 2023, 12:18 PM Tamar Christina wrote: > Hi Jason, > > Thanks for the review. I only now realized I should have split them > between C and C++. > > Will do so on the respins. > > > > > On 6/28/23 09:41, Tamar Christina wrote: > > > Hi All, > > > > > > FORTRAN currently has a pragma

Re: Adjust LTO mode tables for "Machine_Mode: Extend machine_mode from 8 to 16 bits" (was: [PATCH] Machine_Mode: Extend machine_mode from 8 to 16 bits)

2023-06-30 Thread Jakub Jelinek via Gcc-patches
On Fri, Jun 30, 2023 at 08:45:38PM +0800, Kito Cheng wrote: > Hmmm, I think maybe what we need is to leverage C++ language features > to declare enum with underlying types like that: > > enum machine_mode : uint16_t What would be the advantage of doing that? I mean, on most hosts using unsigned r

RE: [PATCH 2/19][front-end] C/C++ front-end: add pragma GCC novector

2023-06-30 Thread Tamar Christina via Gcc-patches
Hi Jason, Thanks for the review. I only now realized I should have split them between C and C++. Will do so on the respins. > > On 6/28/23 09:41, Tamar Christina wrote: > > Hi All, > > > > FORTRAN currently has a pragma NOVECTOR for indicating that > > vectorization should not be applied to a

Re: Adjust LTO mode tables for "Machine_Mode: Extend machine_mode from 8 to 16 bits" (was: [PATCH] Machine_Mode: Extend machine_mode from 8 to 16 bits)

2023-06-30 Thread Thomas Schwinge
Hi! On 2023-06-30T20:45:38+0800, Kito Cheng wrote: >> On 2023-05-13T16:44:41+0800, Kito Cheng via Gcc-patches >> wrote: >> > Tried this patch and I ran into some issues, some variables are using >> > unsigned char to hold machine mode and will have problems when the >> > number of modes is larg

[pushed 2/2] jit.exp: handle dwarf version mismatch in jit-check-debug-info [PR110466]

2023-06-30 Thread David Malcolm via Gcc-patches
Successfully regrtested on x86_64-pc-linux-gnu. Verified fix on powerpc64le-unknown-linux-gnu (gcc112 in Compile Farm). Pushed to trunk as r14-2223-gc3c0ba5436170e. gcc/testsuite/ChangeLog: PR jit/110466 * jit.dg/jit.exp (jit-check-debug-info): Gracefully handle too early v

[pushed 1/2] jit: avoid using __vector in testcase [PR110466]

2023-06-30 Thread David Malcolm via Gcc-patches
r13-4531-gd2e782cb99c311 added test coverage to libgccjit's vector support, but used __vector, which doesn't work on Power. Additionally the size param to gcc_jit_type_get_vector was wrong. Fixed thusly. Successfully regrtested on x86_64-pc-linux-gnu. Verified fix on powerpc64le-unknown-linux-gn

[PATCH v2 3/3] c++: Improve location information in constexpr evaluation

2023-06-30 Thread Nathaniel Shead via Gcc-patches
On Fri, Jun 23, 2023 at 01:09:14PM -0400, Patrick Palka wrote: > On Wed, 29 Mar 2023, Nathaniel Shead via Gcc-patches wrote: > > > This patch caches the current expression's location information in the > > constexpr_global_ctx struct, which allows subexpressions that have lost > > location informa

Re: [PATCH v2 1/3] c++: Track lifetimes in constant evaluation [PR70331, PR96630, PR98675]

2023-06-30 Thread Nathaniel Shead via Gcc-patches
On Mon, Jun 26, 2023 at 03:37:32PM -0400, Patrick Palka wrote: > On Sun, 25 Jun 2023, Nathaniel Shead wrote: > > > On Fri, Jun 23, 2023 at 12:43:21PM -0400, Patrick Palka wrote: > > > On Wed, 29 Mar 2023, Nathaniel Shead via Gcc-patches wrote: > > > > > > > This adds rudimentary lifetime tracking

Re: [PATCH 3/3] analyzer: add text-art visualizations of out-of-bounds accesses [PR106626]

2023-06-30 Thread Martin Jambor
Hi David, On Wed, May 31 2023, David Malcolm via Gcc-patches wrote: > This patch extends -Wanalyzer-out-of-bounds so that, where possible, it > will emit a text art diagram visualizing the spatial relationship between [...] > > gcc/ChangeLog: > PR analyzer/106626 > * Makefile.in (AN

Re: [PATCH] libstdc++: Fix iostream init for Clang on darwin [PR110432]

2023-06-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Jun 2023 at 15:29, Patrick Palka wrote: > > On Fri, 30 Jun 2023, Jonathan Wakely wrote: > > > Tested x86_64-linux. Patrick, PTAL. > > > > -- >8 -- > > > > The __has_attribute(init_priority) check in is true for Clang > > on darwin, which means that user code including thinks the > > l

[committed] libstdc++: Fix unused warning for new variable

2023-06-30 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux and x86_64-linux. Pushed to trunk. -- >8 -- This newly-introduced variable isn't used on all paths, so add the [[maybe_unused]] attribute. libstdc++-v3/ChangeLog: * src/c++11/random.cc (random_device::_M_init): Add maybe_unused attribute. --- libstdc++-

Re: [PATCH] libstdc++: Fix iostream init for Clang on darwin [PR110432]

2023-06-30 Thread Patrick Palka via Gcc-patches
On Fri, 30 Jun 2023, Jonathan Wakely wrote: > Tested x86_64-linux. Patrick, PTAL. > > -- >8 -- > > The __has_attribute(init_priority) check in is true for Clang > on darwin, which means that user code including thinks the > library will initialize the global streams. However, when libstdc++ is

[PATCH] libstdc++: Fix iostream init for Clang on darwin [PR110432]

2023-06-30 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Patrick, PTAL. -- >8 -- The __has_attribute(init_priority) check in is true for Clang on darwin, which means that user code including thinks the library will initialize the global streams. However, when libstdc++ is built by GCC on darwin, the __has_attribute(init_priority)

[committed] libstdc++: Make std::random_device throw more std::system_error [PR105081]

2023-06-30 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- In r14-289-gf9412cedd6c0e7 I made the std::random_device constructor throw std::system_error for unrecognized tokens. But it still throws std::runtime_error for a token such as "rdseed" that is recognized but not supported at runtime by the CPU the p

[committed] fold-const+optabs: Change return type of predicate functions from int to bool

2023-06-30 Thread Uros Bizjak via Gcc-patches
Also change some internal variables and function argument from int to bool. gcc/ChangeLog: * fold-const.h (multiple_of_p): Change return type from int to bool. * fold-const.cc (split_tree): Change negl_p, neg_litp_p, neg_conp_p and neg_var_p variables to bool. (const_binop): Chang

Fix predictions of conditionals with __builtin_expect

2023-06-30 Thread Jan Hubicka via Gcc-patches
Hi, while looking into the std::vector _M_realloc_insert codegen I noticed that call of __throw_bad_alloc is predicted with 10% probability. This is because the conditional guarding it has __builtin_expect (cond, 0) on it. This incorrectly takes precedence over more reliable heuristics predicting

Re: Adjust LTO mode tables for "Machine_Mode: Extend machine_mode from 8 to 16 bits" (was: [PATCH] Machine_Mode: Extend machine_mode from 8 to 16 bits)

2023-06-30 Thread Kito Cheng via Gcc-patches
> On 2023-05-13T16:44:41+0800, Kito Cheng via Gcc-patches > wrote: > > Tried this patch and I ran into some issues, some variables are using > > unsigned char to hold machine mode and will have problems when the > > number of modes is larger than 255... > > > > And here is the fix: > > > --- a/gc

Adjust LTO mode tables for "Machine_Mode: Extend machine_mode from 8 to 16 bits" (was: [PATCH] Machine_Mode: Extend machine_mode from 8 to 16 bits)

2023-06-30 Thread Thomas Schwinge
Hi! On 2023-05-13T16:44:41+0800, Kito Cheng via Gcc-patches wrote: > Tried this patch and I ran into some issues, some variables are using > unsigned char to hold machine mode and will have problems when the > number of modes is larger than 255... > > And here is the fix: > --- a/gcc/genmodes.c

RE: [v4] Streamer: Fix out of range memory access of machine mode

2023-06-30 Thread Li, Pan2 via Gcc-patches
Thanks Thomas for make it happen. Then we have 2 patches, right? V4 Streamer and V1 LTO: Capture. Not quite sure if these 2 has some dependencies when commit (I suppose both are well tested and approved). But anything I can do to make some progress please feel free to let me know. Again, very

Re: [PATCH 0/9] vect: Move costing next to the transform for vect load

2023-06-30 Thread Richard Biener via Gcc-patches
On Tue, Jun 13, 2023 at 4:07 AM Kewen Lin wrote: > > This patch series follows Richi's suggestion at the link [1], > which suggest structuring vectorizable_load to make costing > next to the transform, in order to make it easier to keep > costing and the transform in sync. For now, it's a known >

[committed] Regenrate lto-plugin/Makefile.in

2023-06-30 Thread Martin Jambor
Hi, On Thu, Jun 29 2023, Marek Polacek wrote: > On Thu, Jun 29, 2023 at 05:58:22PM +0200, Martin Jambor wrote: [...] >> >> Unfortunately I won't have time to actually look at this in the next 2-3 >> weeks, so I am inclined to just trust the verification script (which >> essentially runs autocon

Re: [PATCH 1/2] Mid engine setup [SU]ABDL

2023-06-30 Thread Richard Sandiford via Gcc-patches
Oluwatamilore Adebayo writes: > From: oluade01 > > This updates vect_recog_abd_pattern to recognize the widening > variant of absolute difference (ABDL, ABDL2). > > gcc/ChangeLog: > > * internal-fn.cc (widening_fn_p, decomposes_to_hilo_fn_p): > Add IFN_VEC_WIDEN_ABD to the switch stat

Re: [PATCH 3/9] vect: Adjust vectorizable_load costing on VMAT_INVARIANT

2023-06-30 Thread Richard Biener via Gcc-patches
On Tue, Jun 13, 2023 at 4:03 AM Kewen Lin wrote: > > This patch adjusts the cost handling on VMAT_INVARIANT in > function vectorizable_load. We don't call function > vect_model_load_cost for it any more. > > To make the costing on VMAT_INVARIANT better, this patch is > to query hoist_defs_of_uses

RE: [PATCH v1] RISC-V: Refactor vxrm_mode attr for type attr equal

2023-06-30 Thread Li, Pan2 via Gcc-patches
Committed, thanks Jeff and Juzhe. Pan -Original Message- From: Jeff Law Sent: Friday, June 30, 2023 4:58 AM To: Li, Pan2 ; gcc-patches@gcc.gnu.org Cc: juzhe.zh...@rivai.ai; kito.ch...@sifive.com; Wang, Yanzhang Subject: Re: [PATCH v1] RISC-V: Refactor vxrm_mode attr for type attr equa

Re: [PATCH 2/9] vect: Adjust vectorizable_load costing on VMAT_GATHER_SCATTER && gs_info.decl

2023-06-30 Thread Richard Biener via Gcc-patches
On Tue, Jun 13, 2023 at 4:03 AM Kewen Lin wrote: > > This patch adds one extra argument cost_vec to function > vect_build_gather_load_calls, so that we can do costing > next to the tranform in vect_build_gather_load_calls. > For now, the implementation just follows the handlings in > vect_model_lo

[pushed] wwwdocs: gcc-14: Add list markup for C++ release notes

2023-06-30 Thread Gerald Pfeifer
List items can only appear in lists. :-) This fixes up commit b38079855ead7f7e358d17bc06642d031de5e29b Author: Marek Polacek Date: Thu Jun 22 14:44:43 2023 -0400 C++26 P2752R3 - Static storage for braced initializers implemented Gerald --- htdocs/gcc-14/changes.html | 2 ++ 1 fil

[PATCH] tree-optimization/110496 - TYPE_PRECISION issue with store-merging

2023-06-30 Thread Richard Biener via Gcc-patches
When store-merging looks for bswap opportunities we also handle BIT_FIELD_REFs where we verify the refed object is of scalar type but we don't check for the result type we eventually use. That's done later but after we eventually query TYPE_PRECISION. The following re-orders this. Bootstrapped and

[COMMITTED] MAINTAINERS file: Added myself to Write After Approval and DCO

2023-06-30 Thread Rishi Raj via Gcc-patches
From 50cb9df7209125f9466336d23efdd4fbeda9c4d5 Mon Sep 17 00:00:00 2001 From: rsh-raj Date: Fri, 30 Jun 2023 16:04:48 +0530 Subject: [PATCH] MAINTAINERS file: Added myself to Write After Approval and DCO ChangeLog: 2023-06-30 Rishi Raj * MAINTAINERS: Added myself to Write After Approval and

[PATCH V5] Machine Description: Add LEN_MASK_{GATHER_LOAD, SCATTER_STORE} pattern

2023-06-30 Thread juzhe . zhong
From: Ju-Zhe Zhong Hi, Richi and Richard. This patch is adding LEN_MASK_{GATHER_LOAD,SCATTER_STORE} to allow targets handle flow control by mask and loop control by length on gather/scatter memory operations. Consider this following case: #include void f (uint8_t *restrict a, uint8_t *restr

[PATCH] VECT: Apply LEN_MASK_GATHER_LOAD/SCATTER_STORE into vectorizer

2023-06-30 Thread juzhe . zhong
From: Ju-Zhe Zhong Hi, Richard and Richi. It seems that the implementation of LEN_MASK_GATHER_LOAD/LEN_MASK_SCATTER_STORE is simple and code change is not big. Here is an example: #include void f (uint8_t *restrict a, uint8_t *restrict b, int n, int base, int step, int *restrict cond

Re: [PATCH] RISC-V: Support vfwmul.vv combine lowering

2023-06-30 Thread Robin Dapp via Gcc-patches
> The explicit conversions I see are because we need the output of the > conversion in multiple vfmul instructions. That won't be helped by > the patch you've proposed. FWIW on my local branch and the patch applied I see that the vfwmuls are being generated (all of the vfmuls are replaced). > It

Re: [PATCH] Fix couple of endianness issues in fold_ctor_reference

2023-06-30 Thread Richard Biener via Gcc-patches
> (fold_nonarray_ctor_reference): Likewise. Specifically deal > with integral bit-fields. > (fold_ctor_reference): Check that the constructor uses the > native storage order. > > > 2023-06-30 Eric Botcazou > > * gcc.c-torture/

Re: PR108672 re-fixed after [PATCH] libstdc++: Synchronize PSTL with upstream

2023-06-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Jun 2023 at 09:42, Jonathan Wakely wrote: > > On Fri, 30 Jun 2023 at 04:48, Hans-Peter Nilsson wrote: > > > > > Date: Mon, 26 Jun 2023 11:57:49 -0700 > > > From: Thomas Rodgers via Gcc-patches > > > > > On Wed, May 17, 2023 at 12:32 PM Jonathan Wakely > > > wrote: > > > > All the act

[PATCH] Fix couple of endianness issues in fold_ctor_reference

2023-06-30 Thread Eric Botcazou via Gcc-patches
native storage order. 2023-06-30 Eric Botcazou * gcc.c-torture/execute/20230630-1.c: New test. * gcc.c-torture/execute/20230630-2.c: Likewise. -- Eric Botcazoudiff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc index 3d46b76edeb..e80a72dfa22 100644 --- a/gcc/gimple

Re: [PATCH 1/3] targhooks: Extend legitimate_address_p with code_helper [PR110248]

2023-06-30 Thread Kewen.Lin via Gcc-patches
Hi Richi, Thanks for your review! on 2023/6/30 16:56, Richard Biener wrote: > On Fri, Jun 30, 2023 at 7:38 AM Kewen.Lin wrote: >> >> Hi, >> >> As PR110248 shows, some middle-end passes like IVOPTs can >> query the target hook legitimate_address_p with some >> artificially constructed rtx to dete

Re: PR82943 - Suggested patch to fix

2023-06-30 Thread Paul Richard Thomas via Gcc-patches
Hi All, I have gone through the PDT problem reports and made sure that they block PR82173. To my utter astonishment (i) There might be only one duplicate; and (ii) Only 82649, 84119, 90218, 95541, 99079, 102901 & 105380 (out of 50 PRs) depend on the representation. Regards Paul

Re: [PATCH] Collect both user and kernel events for autofdo tests and autoprofiledbootstrap

2023-06-30 Thread Sam James via Gcc-patches
Richard Biener via Gcc-patches writes: > On Fri, Jun 30, 2023 at 7:28 AM Eugene Rozenfeld via Gcc-patches > wrote: >> >> When we collect just user events for autofdo with lbr we get some events >> where branch >> sources are kernel addresses and branch targets are user addresses. Without >>

Re: [PATCH 2/3] ivopts: Call valid_mem_ref_p with code_helper [PR110248]

2023-06-30 Thread Richard Biener via Gcc-patches
On Fri, Jun 30, 2023 at 7:46 AM Kewen.Lin wrote: > > Hi, > > As PR110248 shows, to get the expected query results for > that case internal functions LEN_{LOAD,STORE} is unable to > adopt some addressing modes, we need to pass down the > related IFN code as well. This patch is to make IVOPTs > pas

Re: [PATCH 1/3] targhooks: Extend legitimate_address_p with code_helper [PR110248]

2023-06-30 Thread Richard Biener via Gcc-patches
On Fri, Jun 30, 2023 at 7:38 AM Kewen.Lin wrote: > > Hi, > > As PR110248 shows, some middle-end passes like IVOPTs can > query the target hook legitimate_address_p with some > artificially constructed rtx to determine whether some > addressing modes are supported by target for some gimple > statem

Re: [PATCH] Collect both user and kernel events for autofdo tests and autoprofiledbootstrap

2023-06-30 Thread Richard Biener via Gcc-patches
On Fri, Jun 30, 2023 at 7:28 AM Eugene Rozenfeld via Gcc-patches wrote: > > When we collect just user events for autofdo with lbr we get some events > where branch > sources are kernel addresses and branch targets are user addresses. Without > kernel MMAP > events create_gcov can't make sense of

Re: [PATCH] tree.h: Hide wi::from_mpz from GENERATOR_FILE

2023-06-30 Thread Richard Biener via Gcc-patches
On Fri, Jun 30, 2023 at 7:20 AM Kewen.Lin wrote: > > Hi, > > Similar to r0-85707-g34917a102a4e0c for PR35051, the uses > of mpz_t should be guarded with "#ifndef GENERATOR_FILE". > This patch is to fix it and avoid some possible build > errors. > > Bootstrapped and regress-tested on x86_64-redhat-

[v4] Streamer: Fix out of range memory access of machine mode

2023-06-30 Thread Thomas Schwinge
Hi! On 2023-06-30T01:39:39+, "Li, Pan2" wrote: > That’s very cool, thanks Thomas for help! :-) > Let’s wait the AMD test running result for the final version of the patch. That's all looking good, too. > From: juzhe.zh...@rivai.ai > Sent: Friday, June 30, 2023 9:27 AM > Could you merge

Re: PR108672 re-fixed after [PATCH] libstdc++: Synchronize PSTL with upstream

2023-06-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Jun 2023 at 04:48, Hans-Peter Nilsson wrote: > > > Date: Mon, 26 Jun 2023 11:57:49 -0700 > > From: Thomas Rodgers via Gcc-patches > > > On Wed, May 17, 2023 at 12:32 PM Jonathan Wakely wrote: > > > All the actual code changes look good. > > Unfortunately, this overwrote the fix for PR1

Re: [PATCH v1 2/6] LoongArch: Added Loongson SX base instruction support.

2023-06-30 Thread WANG Xuerui
On 2023/6/30 10:16, Chenghui Pan wrote: [snip] --- gcc/config/loongarch/constraints.md| 128 +- gcc/config/loongarch/loongarch-builtins.cc | 10 + gcc/config/loongarch/loongarch-modes.def | 38 + gcc/config/loongarch/loongarch-protos.h| 31 + gcc/config/loongarch/loo

Re: LTO: Capture 'lto_file_decl_data *file_data' in 'class lto_input_block' (was: [PATCH v3] Streamer: Fix out of range memory access of machine mode)

2023-06-30 Thread Richard Biener via Gcc-patches
On Fri, 30 Jun 2023, Thomas Schwinge wrote: > Hi! > > On 2023-06-29T22:14:59+0200, I wrote: > > [the new] 'file_data->mode_bits' needs to be considered [somewhere] > > > > Easiest is in 'gcc/lto-streamer.h:class lto_input_block' to capture > > 'lto_file_decl_data *file_data' instead of just > > '

[PATCH] middle-end/110489 - avoid useless work on statistics

2023-06-30 Thread Richard Biener via Gcc-patches
When we call statistics_fini_pass we unconditionally allocate the statistics hash and traverse it. When a TU has many small functions this can take considerable time. The following avoids this by never allocating the hash from this function. Bootstrapped and tested on x86_64-unknown-linux-gnu, p

Re: [x86 PATCH] Add STV support for DImode and SImode rotations by constant.

2023-06-30 Thread Uros Bizjak via Gcc-patches
On Fri, Jun 30, 2023 at 9:29 AM Roger Sayle wrote: > > > This patch implements scalar-to-vector (STV) support for DImode and SImode > rotations by constant bit counts. Scalar rotations are almost always > optimal on x86, requiring only one or two instructions, but it is also > possible to impleme

[PATCH 2/2] AArch64: New RTL for ABDL

2023-06-30 Thread Oluwatamilore Adebayo via Gcc-patches
From: oluade01 This patch adds new RTL for ABDL (sabdl, sabdl2, uabdl, uabdl2). gcc/ChangeLog: * config/aarch64/aarch64-simd.md (vec_widen_abdl_lo_, vec_widen_abdl_hi_): Expansions for abd vec widen optabs. (aarch64_abdl_insn): VQW based abdl RTL. * confi

[PATCH 1/2] Mid engine setup [SU]ABDL

2023-06-30 Thread Oluwatamilore Adebayo via Gcc-patches
From: oluade01 This updates vect_recog_abd_pattern to recognize the widening variant of absolute difference (ABDL, ABDL2). gcc/ChangeLog: * internal-fn.cc (widening_fn_p, decomposes_to_hilo_fn_p): Add IFN_VEC_WIDEN_ABD to the switch statement. * internal-fn.def (VEC_WIDE

Re: [PATCH 2/2] AArch64: New RTL for ABDL

2023-06-30 Thread Oluwatamilore Adebayo via Gcc-patches
> Sorry, my fault, but I meant the comment about avoiding > (minus (max…) (min…)) for both patterns, not just the first. Change made. > I think the review suggestions for 1/2 will change the tests. > For example: > > TEST2(signed, short, char) This is the case and the tests have been updated to

Re: [PATCH 1/2] Mid engine setup [SU]ABDL

2023-06-30 Thread Oluwatamilore Adebayo via Gcc-patches
> Sorry, my fault. I was using the original type names in this > suggestion, rather than the TYPE1…TYPE5 ones. Should be: > >WIDEN_ABD exists to optimize the case where TYPE4 is at least >twice as wide as TYPE3. Change made. > Lingering use of “L” suffixes here. Maybe: > > stmts

LTO: Capture 'lto_file_decl_data *file_data' in 'class lto_input_block' (was: [PATCH v3] Streamer: Fix out of range memory access of machine mode)

2023-06-30 Thread Thomas Schwinge
Hi! On 2023-06-29T22:14:59+0200, I wrote: > [the new] 'file_data->mode_bits' needs to be considered [somewhere] > > Easiest is in 'gcc/lto-streamer.h:class lto_input_block' to capture > 'lto_file_decl_data *file_data' instead of just > 'unsigned char *mode_table', and adjust all users. I've split

[x86 PATCH] Add STV support for DImode and SImode rotations by constant.

2023-06-30 Thread Roger Sayle
This patch implements scalar-to-vector (STV) support for DImode and SImode rotations by constant bit counts. Scalar rotations are almost always optimal on x86, requiring only one or two instructions, but it is also possible to implement these efficiently with SSE2, requiring only one or two instr

Flip the nvptx port to LRA (was: [PATCH] Turn on LRA on all targets)

2023-06-30 Thread Thomas Schwinge
Hi! On 2023-04-29T09:06:54-0600, Jeff Law via Gcc-patches wrote: > On 4/29/23 07:37, Roger Sayle wrote: >> >> Segher Boessenkool wrote: >>> I send this patch now so that people can start testing. >>> >>> --- a/gcc/config/nvptx/nvptx.cc >>> +++ b/gcc/config/nvptx/nvptx.cc >>> @@ -7601,9 +7601,6 @

Re: Re: [PATCH V2] Machine Description: Add LEN_MASK_{GATHER_LOAD, SCATTER_STORE} pattern

2023-06-30 Thread juzhe.zh...@rivai.ai
Hi, Richi. I have added "BIAS" and send V4: https://gcc.gnu.org/pipermail/gcc-patches/2023-June/623293.html Forget about V3. I made a mistake there, sorry about that. Thanks. juzhe.zh...@rivai.ai From: Richard Biener Date: 2023-06-30 14:26 To: Ju-Zhe Zhong CC: gcc-patches; richard.sandiford

[PATCH V4] Machine Description: Add LEN_MASK_{GATHER_LOAD, SCATTER_STORE} pattern

2023-06-30 Thread juzhe . zhong
From: Ju-Zhe Zhong Hi, Richi and Richard. This patch is adding LEN_MASK_{GATHER_LOAD,SCATTER_STORE} to allow targets handle flow control by mask and loop control by length on gather/scatter memory operations. Consider this following case: #include void f (uint8_t *restrict a, uint8_t *restr

[PATCH] c++: Fix ICE with parameter pack of decltype(auto) [PR103497]

2023-06-30 Thread Nathaniel Shead via Gcc-patches
On Thu, Jun 29, 2023 at 01:43:07PM -0400, Jason Merrill wrote: > On 6/24/23 09:24, Nathaniel Shead wrote: > > On Fri, Jun 23, 2023 at 11:59:51AM -0400, Patrick Palka wrote: > > > Hi, > > > > > > On Sat, 22 Apr 2023, Nathaniel Shead via Gcc-patches wrote: > > > > > > > Bootstrapped and tested on x

[PATCH V3] Machine Description: Add LEN_MASK_{GATHER_LOAD, SCATTER_STORE} pattern

2023-06-30 Thread juzhe . zhong
From: Ju-Zhe Zhong Hi, Richi and Richard. This patch is adding LEN_MASK_{GATHER_LOAD,SCATTER_STORE} to allow targets handle flow control by mask and loop control by length on gather/scatter memory operations. Consider this following case: #include void f (uint8_t *restrict a, uint8_t *rest