Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-11 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022, 01:25 David Malcolm, wrote: > On Fri, 2022-07-08 at 22:16 +0100, Jonathan Wakely wrote: > > On Fri, 8 Jul 2022 at 21:47, David Malcolm via Gcc > > wrote: > > > > > > std::unique_ptr is C++11, and I'd like to use it in the > > > gcc/analyzer > > > subdirectory, at least. The

Re: Mips: Fix kernel_stat structure size

2022-07-11 Thread Dimitrije Milosevic
Hi Hans-Peter, You're right, this is not ok for the O32 ABI. Your change however, broke the functionality for the N32 ABI. AFAIK, the changes like this should go through LLVM first (yours didn't), so I will send out a review, covering both 32 ABIs, meaning that both O32 and N32 ABIs will be wor

Re: [PATCH] Allocate general register(memory/immediate) for 16/32/64-bit vector bit_op patterns.

2022-07-11 Thread Hongtao Liu via Gcc-patches
On Mon, Jul 11, 2022 at 4:03 PM Uros Bizjak via Gcc-patches wrote: > > On Mon, Jul 11, 2022 at 3:15 AM liuhongt wrote: > > > > And split it to GPR-version instruction after reload. > > > > This will enable below optimization for 16/32/64-bit vector bit_op > > > > - movd(%rdi), %xmm0 > >

XFAIL 'offloading_enabled' diagnostics issue in 'libgomp.oacc-c-c++-common/reduction-5.c' [PR101551] (was: Enhance '_Pragma' diagnostics verification in OMP C/C++ test cases)

2022-07-11 Thread Thomas Schwinge
Hi! On 2022-07-11T11:27:12+0200, I wrote: > [...], I've just pushed to master branch > commit 06b2a2abe26554c6f9365676683d67368cbba206 > "Enhance '_Pragma' diagnostics verification in OMP C/C++ test cases" > --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c > +++ b/libgomp/testsuite

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Richard Biener via Gcc-patches
On Mon, Jul 11, 2022 at 6:35 PM Alexander Monakov wrote: > > On Mon, 11 Jul 2022, Martin Liška wrote: > > > I've clarified that linker should return a value that is in range > > [minimal_api_supported, maximal_api_supported] and added an abort > > if it's not the case. > > I noticed that we are pl

Re: [PATCH] [RFC]Support vectorization for Complex type.

2022-07-11 Thread Hongtao Liu via Gcc-patches
On Mon, Jul 11, 2022 at 7:47 PM Richard Biener via Gcc-patches wrote: > > On Mon, Jul 11, 2022 at 5:44 AM liuhongt wrote: > > > > The patch only handles load/store(including ctor/permutation, except > > gather/scatter) for complex type, other operations don't needs to be > > handled since they wi

Re: [PATCH] i386 testsuite: cope with --enable-default-pie

2022-07-11 Thread Mike Stump via Gcc-patches
On Jul 11, 2022, at 6:47 PM, Alexandre Oliva wrote: > > Running the testsuite on a toolchain build with --enable-default-pie > had some unexpected fails. > Regstrapped on x86_64-linux-gnu, and also tested on i686-linux-gnu, with > and without --enable-default-pie on both platforms. Ok to instal

[PATCH] i386 testsuite: cope with --enable-default-pie

2022-07-11 Thread Alexandre Oliva via Gcc-patches
Running the testsuite on a toolchain build with --enable-default-pie had some unexpected fails. Adjust the tests to tolerate the effects of this configuration option on x86_64-linux-gnu and i686-linux-gnu. The cet-sjlj* tests get offsets before the base symbol name with PIC or PIE. A single pa

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Rui Ueyama via Gcc-patches
I updated my code so that it now acquires a lock before calling claim_file if v0. https://github.com/rui314/mold/commit/54fedf005fb35acdcb0408395aa403f94262190a On Mon, Jul 11, 2022 at 8:51 PM Martin Liška wrote: > > On 7/11/22 14:24, Rui Ueyama wrote: > > I updated my patch to support the propos

[PATCH] c++: non-dependent call to consteval operator [PR105912]

2022-07-11 Thread Patrick Palka via Gcc-patches
Here we were crashing when substituting a non-dependent call to a consteval operator, whose CALL_EXPR_OPERATOR_SYNTAX flag we try to propagate to the result, but the result isn't a CALL_EXPR since the called function is consteval. This patch fixes this by checking the result of extract_call_expr a

[PATCH 2/2] analyzer: use std::unique_ptr for pending_diagnostic/note

2022-07-11 Thread David Malcolm via Gcc-patches
This patch uses the new gcc/make-unique.h header for C++11 compatibility. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. I can self-approve this, but it's dependent on the patch to add gcc/make-unique.h. gcc/analyzer/ChangeLog: * call-info.cc: Add define of INCLUDE_MEMORY

[PATCH 1/2] Add gcc/make-unique.h

2022-07-11 Thread David Malcolm via Gcc-patches
On Fri, 2022-07-08 at 22:16 +0100, Jonathan Wakely wrote: > On Fri, 8 Jul 2022 at 21:47, David Malcolm via Gcc > wrote: > > > > std::unique_ptr is C++11, and I'd like to use it in the > > gcc/analyzer > > subdirectory, at least. The following patch eliminates a bunch of > > "takes ownership" com

[PATCH] preprocessor: Set input_location to the most recently seen token

2022-07-11 Thread Lewis Hyatt via Gcc-patches
Hello- As discussed here: https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598136.html Here is another short patch that improves "#pragma GCC diagnostic" handling. Longer term, it will be desirable to make the handling of this pragma independent of the global input_location. But in the meantim

Re: [PATCH] btf: emit linkage information in BTF_KIND_FUNC entries

2022-07-11 Thread Indu Bhagat via Gcc-patches
On 7/8/22 11:30 AM, Jose E. Marchesi via Gcc-patches wrote: The kernel bpftool expects BTF_KIND_FUNC entries in BTF to include an annotation reflecting the linkage of functions (static, global). For whatever reason they (ab)use the `vlen' field of the BTF_KIND_FUNC entry instead of adding a va

Re: Modula-2: merge followup (brief update on the progress of the new linking implementation)

2022-07-11 Thread Rainer Orth
Hi Gaius, > thanks for the report - the first bug report (above) is now fixed on > devel/modula-2. thanks, that got me closer, but not quite there yet: * First, I get: /vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-libs-min/SYSTEM.mod:29:1: error: In implementation module 'SYSTEM': module 'M2RTS'

Re: [PATCH] Move reload_completed and other rtl.h globals to crtl structure.

2022-07-11 Thread Jeff Law via Gcc-patches
On 7/10/2022 12:19 PM, Roger Sayle wrote: This patch builds upon Richard Biener's suggestion of avoiding global variables to track state/identify which passes have already been run. In the early middle-end, the tree-ssa passes use the curr_properties field in cfun to track this. This patch us

[PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream

2022-07-11 Thread Martin Liška
I'm going to push the following cherry-pick which fixes libasan build with top-of-tree glibc. Martin 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include to resolve fsconfig_command/mount_attr conflict with glibc 2.36 --- .../sanitizer_platform_limits_posix.cpp|

Re: [PATCH v2] Modify combine pattern by a pseudo AND with its nonzero bits [PR93453]

2022-07-11 Thread Segher Boessenkool
Hi! On Mon, Jul 11, 2022 at 10:13:41AM +0800, HAO CHEN GUI wrote: > I did a biset for the problem. After commit "commit 8d2d39587: combine: Do > not combine > moves from hard registers", the case fails. The root cause is it can't > combine from the > hard registers and has to use subreg which ca

PING: [PATCH v5] tree-optimization/101186 - extend FRE with "equivalence map" for condition prediction

2022-07-11 Thread Di Zhao OS via Gcc-patches
Updated the patch in the attachment, so it can apply. Thanks, Di Zhao > -Original Message- > From: Di Zhao OS > Sent: Sunday, May 29, 2022 11:59 PM > To: gcc-patches@gcc.gnu.org > Cc: Richard Biener > Subject: [PATCH v5] tree-optimization/101186 - extend FRE with "equivalence > map" for

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Alexander Monakov via Gcc-patches
On Mon, 11 Jul 2022, Martin Liška wrote: > I've clarified that linker should return a value that is in range > [minimal_api_supported, maximal_api_supported] and added an abort > if it's not the case. I noticed that we are placing a trap for C++ consumers such as mold by passing min/max_api_suppo

Re: Modula-2: merge followup (brief update on the progress of the new linking implementation)

2022-07-11 Thread Gaius Mulley via Gcc-patches
Rainer Orth writes: > Hi Gaius, > >> A very brief update to say that I've merged the new linking >> implementation back onto the devel/modula-2 branch, > > unfortunately, that branch doesn't bootstrap for me anywere: > > * On both x86_64-pc-linux-gnu and i386-pc-solaris2.11: > > libtool: compile:

[committed] vect: Restore optab_vector argument [PR106250]

2022-07-11 Thread Richard Sandiford via Gcc-patches
In g:76c3041b856cb0 I'd removed a "C ? optab_vector : optab_mixed_sign" argument from a call to directly_supported_p, thinking that the argument only existed because of the condition (which I was removing). But the difference between the scalar and vector forms matters for shifts, so we do still n

[COMMITTED] c-family: Fix option check in handle_pragma_diagnostic [PR106252]

2022-07-11 Thread Lewis Hyatt via Gcc-patches
Hello- PR106252 notes an error found by the address sanitizer from r13-1544. This was my mistake during refactoring of handle_pragma_diagnostic(), the check for the option arg was moved earlier than it should be. Committed the obvious fix putting this back where it was before. -Lewis c-family: Fi

Re: [pushed 1/2] Convert label_text to C++11 move semantics

2022-07-11 Thread Martin Liška
On 7/7/22 22:00, David Malcolm via Gcc-patches wrote: > |libcpp's class label_text stores a char * for a string and a flag saying > whether it owns the buffer. I added this class before we could use C++11, and > so to avoid lots of copying it required an explicit call to > label_text::maybe_free

[PATCH] c++: dependence of constrained memfn from current inst [PR105842]

2022-07-11 Thread Patrick Palka via Gcc-patches
Here we incorrectly deem the calls to func1, func2 and tmpl2 as ambiguous ahead of time ultimately because we mishandle dependence of a constrained member function from the current instantiation. In type_dependent_expression_p, we consider the dependence of a TEMPLATE_DECL's constraints (via uses_

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Martin Liška
On 7/11/22 14:24, Rui Ueyama wrote: > I updated my patch to support the proposed API: > https://github.com/rui314/mold/commit/22bbfa9bba9beeaf40b76481d175939ee2c62ec8 > > Martin, > > I think you want to apply this patch. Currently, your API always > passes LAPI_V0 as the maximum API version. Are

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Alexander Monakov via Gcc-patches
On Mon, 11 Jul 2022, Rui Ueyama wrote: > I updated my patch to support the proposed API: > https://github.com/rui314/mold/commit/22bbfa9bba9beeaf40b76481d175939ee2c62ec8 This still seems to ignore the thread safety aspect. Alexander

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Rui Ueyama via Gcc-patches
I updated my patch to support the proposed API: https://github.com/rui314/mold/commit/22bbfa9bba9beeaf40b76481d175939ee2c62ec8 Martin, I think you want to apply this patch. Currently, your API always passes LAPI_V0 as the maximum API version. diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto

[PATCH] More update-ssa speedup

2022-07-11 Thread Richard Biener via Gcc-patches
When working on a smaller region like a loop version copy the main time spent is now dominance fast query recompute which does a full function DFS walk. The dominance queries within the region of interest should be O(log n) without fast queries and we should do on the order of O(n) of them which o

Re: [PATCH] [RFC]Support vectorization for Complex type.

2022-07-11 Thread Richard Biener via Gcc-patches
On Mon, Jul 11, 2022 at 5:44 AM liuhongt wrote: > > The patch only handles load/store(including ctor/permutation, except > gather/scatter) for complex type, other operations don't needs to be > handled since they will be lowered by pass cplxlower.(MASK_LOAD is not > supported for complex type, so

Re: [PATCH] Move reload_completed and other rtl.h globals to crtl structure.

2022-07-11 Thread Richard Sandiford via Gcc-patches
I know it'll seem like make-work, but could you put the combine flag in a separate follow-on patch? Reorganising the existing flags (very welcome!) and adding new ones seem like different things. TBH I'm a bit suspicious of the combine flag. What fundamental property holds true after combine tha

Re: Modula-2: merge followup (brief update on the progress of the new linking implementation)

2022-07-11 Thread Rainer Orth
Hi Gaius, >> A very brief update to say that I've merged the new linking >> implementation back onto the devel/modula-2 branch, > > unfortunately, that branch doesn't bootstrap for me anywere: [...] > * On sparc-sun-solaris2.11: [...] > Seems like PR modula2/101392 raised its ugly head again, af

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Martin Liška
On 7/11/22 11:55, Richard Biener wrote: > On Mon, Jul 11, 2022 at 11:16 AM Alexander Monakov wrote: >> >> On Mon, 11 Jul 2022, Rui Ueyama wrote: >> but ignoring min_api_supported is wrong, and assuming max_api_supported > 0 is also wrong. It really should check how given [min; max] range

Re: [PATCH] c++: Add __reference_con{struc, ver}ts_from_temporary [PR104477]

2022-07-11 Thread Jonathan Wakely via Gcc-patches
On Fri, 8 Jul 2022 at 18:41, Marek Polacek wrote: > The patch also adds the relevant class and variable templates to > . + template +struct reference_constructs_from_temp orary +: public __bool_constant<__reference_constructs_from_temporary(_Tp, _Up)> This can use bool_constant, as tha

[PATCH] tree-optimization/106228 - fixup last change

2022-07-11 Thread Richard Biener via Gcc-patches
The following fixes the last commit to honor the case we are not vectorizing a loop. Bootstrapped on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/106228 * tree-vect-data-refs.cc (vect_setup_realignment): Adjust VUSE compute for the non-loop case. --- gcc/tree-ve

[PATCH] Add condition coverage profiling

2022-07-11 Thread Jørgen Kvalsvik via Gcc-patches
This patch adds support in gcc+gcov for modified condition/decision coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of test/code coverage and it is particularly important in the avation and automotive industries for safety-critical applications. MC/DC it is required for or reco

Re: [PATCH] Introduce hardbool attribute for C

2022-07-11 Thread Richard Biener via Gcc-patches
On Fri, Jul 8, 2022 at 5:29 PM Alexandre Oliva wrote: > > On Jul 8, 2022, Richard Biener wrote: > > > Does this follow some other compilers / language? > > It is analogous to Ada's booleans with representation clauses and > runtime validation checking at use points. > > > Is such feature used in

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Richard Biener via Gcc-patches
On Mon, Jul 11, 2022 at 11:16 AM Alexander Monakov wrote: > > On Mon, 11 Jul 2022, Rui Ueyama wrote: > > > > but ignoring min_api_supported is wrong, and assuming max_api_supported > > > > 0 > > > is also wrong. It really should check how given [min; max] range > > > intersects > > > with its own

RE: [PATCH] Move reload_completed and other rtl.h globals to crtl structure.

2022-07-11 Thread Richard Biener via Gcc-patches
On Mon, 11 Jul 2022, Roger Sayle wrote: > On 11 July 2022 08:20, Richard Biener wrote: > > On Sun, 10 Jul 2022, Roger Sayle wrote: > > > > > This patch builds upon Richard Biener's suggestion of avoiding global > > > variables to track state/identify which passes have already been run. > > > In t

Enhance '_Pragma' diagnostics verification in OMP C/C++ test cases (was: [PATCH] c: Fix location for _Pragma tokens [PR97498])

2022-07-11 Thread Thomas Schwinge
Hi! On 2022-07-10T16:51:11-0400, Lewis Hyatt via Gcc-patches wrote: > On Sat, Jul 9, 2022 at 11:59 PM Jeff Law via Gcc-patches > wrote: >> On 7/9/2022 2:52 PM, Lewis Hyatt via Gcc-patches wrote: >> > PR97498 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97498) is another PR >> > related to the

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Alexander Monakov via Gcc-patches
On Mon, 11 Jul 2022, Rui Ueyama wrote: > > but ignoring min_api_supported is wrong, and assuming max_api_supported > 0 > > is also wrong. It really should check how given [min; max] range intersects > > with its own range of supported versions. > > Currently only one version is defined which is L

Re: [PATCH 1/1 V3] RISC-V: Support Zmmul extension

2022-07-11 Thread Kito Cheng via Gcc-patches
On Mon, Jul 11, 2022 at 3:15 PM wrote: > > From: LiaoShihua > > gcc/ChangeLog: > > * common/config/riscv/riscv-common.cc: > * config/riscv/riscv-c.cc (riscv_cpu_cpp_builtins): > * config/riscv/riscv-opts.h (MASK_ZMMUL): > (TARGET_ZMMUL): > * config/riscv/ri

Re: [PATCH] d: Move DSO registry support code from compiler to drtstuff in library (PR100062)

2022-07-11 Thread Rainer Orth
Hi Iain, > Currently the DSO support for D runtime is generated by the compiler in > every object, when really it is only required once per shared object. > > This patch moves that support logic from the compiler itself to the > library as part of the drtstuff code. The object files drtbegin.o an

RE: [PATCH] Move reload_completed and other rtl.h globals to crtl structure.

2022-07-11 Thread Roger Sayle
On 11 July 2022 08:20, Richard Biener wrote: > On Sun, 10 Jul 2022, Roger Sayle wrote: > > > This patch builds upon Richard Biener's suggestion of avoiding global > > variables to track state/identify which passes have already been run. > > In the early middle-end, the tree-ssa passes use the curr

Re: Modula-2: merge followup (brief update on the progress of the new linking implementation)

2022-07-11 Thread Rainer Orth
Hi Gaius, > A very brief update to say that I've merged the new linking > implementation back onto the devel/modula-2 branch, unfortunately, that branch doesn't bootstrap for me anywere: * On both x86_64-pc-linux-gnu and i386-pc-solaris2.11: libtool: compile: /var/gcc/modula-2/11.4-gcc-modula-

Re: [PATCH] Allocate general register(memory/immediate) for 16/32/64-bit vector bit_op patterns.

2022-07-11 Thread Uros Bizjak via Gcc-patches
On Mon, Jul 11, 2022 at 3:15 AM liuhongt wrote: > > And split it to GPR-version instruction after reload. > > This will enable below optimization for 16/32/64-bit vector bit_op > > - movd(%rdi), %xmm0 > - movd(%rsi), %xmm1 > - pand%xmm1, %xmm0 > - movd%xmm0,

Re: [PATCH] Control flow redundancy hardening

2022-07-11 Thread Richard Biener via Gcc-patches
On Fri, Jul 8, 2022 at 7:00 PM Alexandre Oliva wrote: > > On Jul 8, 2022, Richard Biener wrote: > > > I'm possibly missing the importance of 'redundancy' in -fharden-control-flow > > I took "Control Flow Redundancy" as a term of the art and never > questioned it. I think the "redundancy" has to

Re: [PATCH] Add condition coverage profiling

2022-07-11 Thread Jørgen Kvalsvik via Gcc-patches
On 08/07/2022 15:45, Sebastian Huber wrote: > Hello Jørgen, > > some time passed. It would be nice if you could give a status update. I am > quite > interested in your work. > > Best regards, >     Sebastian > I'm sorry for the late updates. There have have been a lot of issues (with the patch

[PATCH] tree-optimization/106228 - fix vect_setup_realignment virtual SSA handling

2022-07-11 Thread Richard Biener via Gcc-patches
The following adds missing assignment of a virtual use operand to a created load to vect_setup_realignment which shows as bootstrap failure on powerpc64-linux and extra testsuite fails for targets when misaligned loads are not supported or not optimal. Bootstrapped on x86_64-unknown-linux-gnu, tes

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Rui Ueyama via Gcc-patches
On Fri, Jul 8, 2022 at 8:41 PM Alexander Monakov wrote: > > > On Fri, 8 Jul 2022, Martin Liška wrote: > > > Hi. > > > > All right, there's updated version of the patch that reflects the following > > suggestions: > > > > 1) strings are used for version identification > > 2) thread-safe API versio

Re: [PATCH] Move reload_completed and other rtl.h globals to crtl structure.

2022-07-11 Thread Richard Biener via Gcc-patches
On Sun, 10 Jul 2022, Roger Sayle wrote: > > This patch builds upon Richard Biener's suggestion of avoiding global > variables to track state/identify which passes have already been run. > In the early middle-end, the tree-ssa passes use the curr_properties > field in cfun to track this. This pat

[PATCH 1/1 V3] RISC-V: Support Zmmul extension

2022-07-11 Thread shihua
From: LiaoShihua gcc/ChangeLog: * common/config/riscv/riscv-common.cc: * config/riscv/riscv-c.cc (riscv_cpu_cpp_builtins): * config/riscv/riscv-opts.h (MASK_ZMMUL): (TARGET_ZMMUL): * config/riscv/riscv.cc (riscv_option_override): * config/riscv/ris

[PATCH 0/1 V3] RISC-V: Support Zmmul extension

2022-07-11 Thread shihua
From: LiaoShihua Zmmul extension is Multiply only extension for RISC-V.It implements the multiplication subset of the M extension. The encodings are identical to those of the corresponding M-extension instructions. When You both use M extension add Zmmul extension, it will warning