[PATCH 1/2] xtensa: constantsynth: Make try to find shorter instruction

2022-07-15 Thread Takayuki 'January June' Suwa via Gcc-patches
This patch allows the constant synthesis to choose shorter instruction if possible. /* example */ int test(void) { return 128 << 8; } ;; before test: movia2, 0x100 addmi a2, a2, 0x7f00 ret.n ;; after test: movi.n a2, 1

[PATCH 2/2] xtensa: Optimize "bitwise AND with imm1" followed by "branch if (not) equal to imm2"

2022-07-15 Thread Takayuki 'January June' Suwa via Gcc-patches
This patch enhances the effectiveness of the previously posted one: "xtensa: Optimize bitwise AND operation with some specific forms of constants". /* example */ extern void foo(int); void test(int a) { if ((a & (-1U << 8)) == (128 << 8)) /* 0 or one of "b4const" */

Re: [PATCH] libphobos: Fix instability in the parallelized testsuite

2022-07-15 Thread Iain Buclaw via Gcc-patches
Excerpts from Lewis Hyatt via Gcc-patches's message of Juli 14, 2022 11:53 pm: > Hello- > > I get a different number of test results from libphobos.unittest/unittest.exp, > depending on server load. I believe it's because this testsuite doesn't check > runtest_file_p: > > $ make -j 1

Re: [PATCH, rs6000] Additional cleanup of rs6000_builtin_mask

2022-07-15 Thread will schmidt via Gcc-patches
On Thu, 2022-07-14 at 11:28 +0800, Kewen.Lin wrote: > Hi Will, > > Thanks for the cleanup! Some comments are inlined. Hi, Thanks for the review. A few comments and responses below. TLDR I'll incorporate the suggestions in V2 that will show up ... after. :-) > > on 2022/7/14 05:39, will

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

2022-07-15 Thread Marek Polacek via Gcc-patches
On Fri, Jul 15, 2022 at 10:59:41PM +0300, Ville Voutilainen wrote: > Well, is_xible is not is_xible_p because it doesn't need to be both is_* > and *_p. But xes_from_temporary is less obviously a question, so > xes_from_temporary_p would imho be a better name. Yeah, I guess so. But I've already

[PATCH, committed] Fortran: do not generate conflicting results under -ff2c [PR104313]

2022-07-15 Thread Harald Anlauf via Gcc-patches
Dear all, the attached patch by Steve fixes a regression under -ff2c for functions where the result is not set. There would otherwise be conflicting declarations of the returned result, which gimple doesn't like. I've committed this as obvious after discussion with Steve for him, see PR, as

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

2022-07-15 Thread Ville Voutilainen via Gcc-patches
Well, is_xible is not is_xible_p because it doesn't need to be both is_* and *_p. But xes_from_temporary is less obviously a question, so xes_from_temporary_p would imho be a better name. On Fri, Jul 15, 2022, 18:33 Marek Polacek via Libstdc++ < libstd...@gcc.gnu.org> wrote: > On Thu, Jul 14,

Re: [PATCH] Adding three new function attributes for static analysis of file descriptors

2022-07-15 Thread David Malcolm via Gcc-patches
On Fri, 2022-07-15 at 21:08 +0530, Immad Mir wrote: Thanks for the patch. Various review comments: The patch is missing a ChangeLog. > --- > gcc/analyzer/sm-fd.cc| 257 --- > gcc/c-family/c-attribs.cc| 115 >

Re: kernel sparse annotations vs. compiler attributes and debug_annotate_{type, decl} WAS: Re: [PATCH 0/9] Add debug_annotate attributes

2022-07-15 Thread Yonghong Song via Gcc-patches
On 7/15/22 7:17 AM, Jose E. Marchesi wrote: On 7/14/22 8:09 AM, Jose E. Marchesi wrote: Hi Yonghong. On 7/7/22 1:24 PM, Jose E. Marchesi wrote: Hi Yonghong. On 6/21/22 9:12 AM, Jose E. Marchesi wrote: On 6/17/22 10:18 AM, Jose E. Marchesi wrote: Hi Yonghong. On 6/15/22 1:57 PM,

Re: [x86 PATCH] PR target/106273: Add earlyclobber to *andn3_doubleword_bmi

2022-07-15 Thread Uros Bizjak via Gcc-patches
On Fri, Jul 15, 2022 at 3:28 PM Roger Sayle wrote: > > > > This patch resolves PR target/106273 which is a wrong code regression > > caused by the recent reorganization to split doubleword operations after > > reload on x86. For the failing test case, the constraints on the > >

[committed] analyzer: fix taint false positive on optimized range checks [PR106284]

2022-07-15 Thread David Malcolm via Gcc-patches
PR analyzer/106284 reports a false positive from -Wanalyzer-tainted-array-index seen on the Linux kernel with a version of my patches from: https://gcc.gnu.org/pipermail/gcc-patches/2021-November/584372.html in drivers/usb/class/usblp.c in function ‘usblp_set_protocol’ handling usblp_ioctl on

[committed] analyzer: documentation nits relating to new fd warnings

2022-07-15 Thread David Malcolm via Gcc-patches
Lightly tested; pushed to trunk as r13-1712-gb1d07b50d43e95. gcc/ChangeLog: * doc/invoke.texi (Static Analyzer Options): Add the new fd warnings to the initial gccoptlist, and to the list of those disabled by -fanalyzer-checker=taint. Signed-off-by: David Malcolm ---

[PATCH] Adding three new function attributes for static analysis of file descriptors

2022-07-15 Thread Immad Mir via Gcc-patches
--- gcc/analyzer/sm-fd.cc| 257 --- gcc/c-family/c-attribs.cc| 115 gcc/doc/extend.texi | 19 ++ gcc/testsuite/gcc.dg/analyzer/fd-5.c | 53 ++ gcc/testsuite/gcc.dg/analyzer/fd-6.c | 14 ++ 5 files changed,

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

2022-07-15 Thread Marek Polacek via Gcc-patches
On Thu, Jul 14, 2022 at 11:48:51PM -0400, Jason Merrill wrote: > On 7/14/22 13:43, Marek Polacek wrote: > > On Tue, Jul 12, 2022 at 04:15:00PM -0400, Jason Merrill wrote: > > > On 7/12/22 16:10, Jason Merrill wrote: > > > > On 7/8/22 13:41, Marek Polacek wrote: > > > > > This patch implements

[PATCH] c++: ICE with erroneous template redeclaration [PR106311]

2022-07-15 Thread Marek Polacek via Gcc-patches
Here we ICE trying to get DECL_SOURCE_LOCATION of the parm that happens to be error_mark_node in this ill-formed test. I kept running into this while reducing code, so it'd be good to have it fixed. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? PR c++/106311

Go patch committed: Don't crash on f(g()) if g returns a zero-sized value

2022-07-15 Thread Ian Lance Taylor via Gcc-patches
This patch to the GCC interface of the Go frontend fixes a crash in f(g()) if g returns a zero-sized value. In that case the GCC interface modifies g to return void, since GCC's middle-end does not have solid support for zero-sized values. This patch detects the f(g()) case and replaces the call

[PATCH] aarch64: Replace manual swapping idiom with std::swap in aarch64.cc

2022-07-15 Thread Richard Ball via Gcc-patches
Replace manual swapping idiom with std::swap in aarch64.cc gcc/config/aarch64/aarch64.cc has a few manual swapping idioms of the form: x = in0, in0 = in1, in1 = x; The preferred way is using the standard: std::swap (in0, in1); We should just fix these to use std::swap. This will also allow

Re: [PATCH v2 1/2] aarch64: Don't return invalid GIMPLE assign statements

2022-07-15 Thread Andrew Carlotti via Gcc-patches
On Wed, Jul 13, 2022 at 02:32:16PM +0200, Richard Biener wrote: > On Wed, Jul 13, 2022 at 12:50 PM Andrew Carlotti > wrote: > > I specifically wanted to avoid not folding the call, because always > > folding means that the builtin doesn't need to be implemented anywhere > > else (which isn't

Re: kernel sparse annotations vs. compiler attributes and debug_annotate_{type,decl} WAS: Re: [PATCH 0/9] Add debug_annotate attributes

2022-07-15 Thread Jose E. Marchesi via Gcc-patches
> On 7/14/22 8:09 AM, Jose E. Marchesi wrote: >> Hi Yonghong. >> >>> On 7/7/22 1:24 PM, Jose E. Marchesi wrote: Hi Yonghong. > On 6/21/22 9:12 AM, Jose E. Marchesi wrote: >> >>> On 6/17/22 10:18 AM, Jose E. Marchesi wrote: Hi Yonghong. > On

[committed] MAINTAINERS: Add myself to Write After Approval

2022-07-15 Thread Andrew Carlotti via Gcc-patches
ChangeLog: * MAINTAINERS: Add myself to Write After Approval. diff --git a/MAINTAINERS b/MAINTAINERS index 7d9aab76dd9676c806bd08abc7542553fcf81928..7a7ad42ced3027f1f7970916b355fd5fc7b0088c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -352,6 +352,7 @@ Kevin Buettner

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-07-15 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 14 Jul 2022 at 17:22, Richard Sandiford wrote: > > Richard Biener writes: > > On Thu, Jul 14, 2022 at 9:55 AM Prathamesh Kulkarni > > wrote: > >> > >> On Wed, 13 Jul 2022 at 12:22, Richard Biener > >> wrote: > >> > > >> > On Tue, Jul 12, 2022 at 9:12 PM Prathamesh Kulkarni via

Re: [PATCH] Add condition coverage profiling

2022-07-15 Thread Jørgen Kvalsvik via Gcc-patches
On 15/07/2022 15:31, Sebastian Huber wrote: > On 15.07.22 13:47, Jørgen Kvalsvik via Gcc-patches wrote: >> 2. New vocabulary for the output - decisions for, well, the decisions. It >> also >> writes at most one line per condition: >> >> decisions covered 1/4 >> condition  0 not covered

Re: [PATCH] Add condition coverage profiling

2022-07-15 Thread Sebastian Huber
On 15.07.22 13:47, Jørgen Kvalsvik via Gcc-patches wrote: 2. New vocabulary for the output - decisions for, well, the decisions. It also writes at most one line per condition: decisions covered 1/4 condition 0 not covered (true false) condition 1 not covered (true)

[x86 PATCH] PR target/106273: Add earlyclobber to *andn3_doubleword_bmi

2022-07-15 Thread Roger Sayle
This patch resolves PR target/106273 which is a wrong code regression caused by the recent reorganization to split doubleword operations after reload on x86. For the failing test case, the constraints on the andnti3_doubleword_bmi pattern allow reload to allocate the output and operand in

Re: [PATCH] HIGH part of symbol ref is invalid for constant pool

2022-07-15 Thread Jiufu Guo via Gcc-patches
"Kewen.Lin" writes: > Hi Jeff, > > Thanks for the patch, one question is inlined below. > > on 2022/7/4 14:58, Jiufu Guo wrote: >> The high part of the symbol address is invalid for the constant pool. In >> function rs6000_cannot_force_const_mem, we already return true for >> "HIGH with UNSPEC"

Re: [COMMITTED] Use pp_vrange for ranges in dump_ssaname_info.

2022-07-15 Thread Aldy Hernandez via Gcc-patches
On Fri, Jul 15, 2022 at 11:40 AM Aldy Hernandez wrote: > > This changes the ad-hoc dumping of ranges in the gimple pretty printer > to use the pp_vrange utility function, which has the benefit of > handling all range types going forward and unifying the dumping code. > > Instead of: > #

Re: [PATCH] Add condition coverage profiling

2022-07-15 Thread Jørgen Kvalsvik via Gcc-patches
On 15/07/2022 13:39, Jørgen Kvalsvik wrote: > This patch adds support in gcc+gcov for modified condition/decision > coverage (MC/DC) with the -fprofile-conditions flag. Hello, I have updated this patch based on the feedback from Sebastian and Martin. 1. The description of the masking_vector

[PATCH] Add condition coverage profiling

2022-07-15 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

[COMMITTED] Implement visitor pattern for vrange.

2022-07-15 Thread Aldy Hernandez via Gcc-patches
We frequently do operations on the various (upcoming) range types. The cascading if/switch statements of is_a<> are getting annoying and repetitive. The classic visitor pattern provides a clean way to implement classes handling various range types without the need for endless conditionals. It

[COMMITTED] Convert vrange dumping facilities to pretty_printer.

2022-07-15 Thread Aldy Hernandez via Gcc-patches
We need to dump global ranges from the gimple pretty printer code, but all the vrange dumping facilities work with FILE handles. This patch converts all the dumping methods to work with pretty printers, and provides a wrapper so the FILE * methods continue to work for debugging. I also cleaned

[COMMITTED] Use pp_vrange for ranges in dump_ssaname_info.

2022-07-15 Thread Aldy Hernandez via Gcc-patches
This changes the ad-hoc dumping of ranges in the gimple pretty printer to use the pp_vrange utility function, which has the benefit of handling all range types going forward and unifying the dumping code. Instead of: # RANGE [0, 51] NONZERO 0x3f # RANGE ~[5, 10] we would now get:

Re: [PATCH] libcpp: Improve encapsulation of label_text

2022-07-15 Thread Jonathan Wakely via Gcc-patches
On Thu, 14 Jul 2022 at 22:31, David Malcolm wrote: > > On Thu, 2022-07-14 at 22:10 +0100, Jonathan Wakely wrote: > > Thanks for the patch. > > > I'm not sure if label_text::get () is the best name for the new > > accessor. Other options include buffer () and c_str () but I don't > > see a > >