Re: [PATCH] predict: Adjust optimize_function_for_size_p [PR105818]

2022-06-14 Thread Kewen.Lin via Gcc-patches
on 2022/6/14 20:53, Segher Boessenkool wrote: > On Tue, Jun 14, 2022 at 03:57:08PM +0800, Kewen.Lin wrote: >> PR target/105818 > > Change this to something else? It is not a target bug. "middle-end" > perhaps? > Good catch, will fix this. Thanks Segher! BR, Kewen

Re: [PATCH] predict: Adjust optimize_function_for_size_p [PR105818]

2022-06-14 Thread Kewen.Lin via Gcc-patches
Hi Honza, Thanks for the comments! Some replies are inlined below. on 2022/6/14 19:37, Jan Hubicka wrote: >> Hi, >> >> Function optimize_function_for_size_p returns OPTIMIZE_SIZE_NO >> if func->decl is not null but no cgraph node is available for it. >> As PR105818 shows, this could give unexpec

Re: [PATCH 0/9] Add debug_annotate attributes

2022-06-14 Thread Yonghong Song via Gcc-patches
On 6/7/22 2:43 PM, David Faust wrote: Hello, This patch series adds support for: - Two new C-language-level attributes that allow to associate (to "annotate" or to "tag") particular declarations and types with arbitrary strings. As explained below, this is intended to be used to, for e

Re: [PATCH] Fix ICE in extract_insn, at recog.cc:2791

2022-06-14 Thread Uros Bizjak via Gcc-patches
On Wed, Jun 15, 2022 at 12:49 AM liuhongt wrote: > > (In reply to Uroš Bizjak from comment #1) > > Instruction does not accept memory operand for operand 3: > > > > (define_insn_and_split > > "*_blendv_ltint" > > [(set (match_operand: 0 "register_operand" "=Yr,*x,x") > > (unspec: > >

[PATCH] Fix ICE in extract_insn, at recog.cc:2791

2022-06-14 Thread liuhongt via Gcc-patches
(In reply to Uroš Bizjak from comment #1) > Instruction does not accept memory operand for operand 3: > > (define_insn_and_split > "*_blendv_ltint" > [(set (match_operand: 0 "register_operand" "=Yr,*x,x") > (unspec: > [(match_operand: 1 "register_operand" "0,0,x") > (match_

Re: [PATCH V2]rs6000: Store complicated constant into pool

2022-06-14 Thread Segher Boessenkool
Hi! On Tue, Jun 14, 2022 at 09:23:55PM +0800, Jiufu Guo wrote: > This patch reduces the threshold of instruction number for storing > constant to pool and update cost for constant and mem accessing. > And then if building the constant needs more than 2 instructions (or > more than 1 instruction on

libgo patch committed: Format the syscall package

2022-06-14 Thread Ian Lance Taylor via Gcc-patches
This Go formatter is starting to format documentation comments in some cases. As a step toward that in libgo, this patch adds blank lines after //sys comments in the syscall package where needed, and then runs the new formatter on the syscall package files. This is the libgo version of https://go

Re: [PATCH][_Hashtable] Fix insertion of range of type convertible to value_type PR 105714

2022-06-14 Thread Jonathan Wakely via Gcc-patches
On Wed, 25 May 2022 at 06:10, François Dumont wrote: > > Here is the patch to fix just what is described in PR 105714. > > libstdc++: [_Hashtable] Insert range of types convertible to > value_type PR 105714 > > Fix insertion of range of types convertible to value_type. > > libstdc++

[PATCH] libcpp: Handle extended characters in user-defined literal suffix [PR103902]

2022-06-14 Thread Lewis Hyatt via Gcc-patches
Hello- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103902 The attached patch resolves PR preprocessor/103902 as described in the patch message inline below. bootstrap + regtest all languages was successful on x86-64 Linux, with no new failures: FAIL 103 103 PASS 542338 542371 UNSUPPORTED 15247

[committed] libstdc++: Check lengths first in operator== for basic_string [PR62187]

2022-06-14 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- As confirmed by LWG 2852, the calls to traits_type::compare do not need to be obsvervable, so we can make operator== compare string lengths first and return immediately for non-equal lengths. This avoids doing a slow string comparison for "abc..

[committed] libstdc++: Inline all basic_string::compare overloads [PR59048]

2022-06-14 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- Defining the compare member functions inline allows calls to traits_type::length and std::min to be inlined, taking advantage of constant expression arguments. When not inline, the compiler prefers to use the explicit instantiation definitions i

[committed] libstdc++: Fix indentation in allocator base classes

2022-06-14 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/bits/new_allocator.h: Fix indentation. * include/ext/malloc_allocator.h: Likewise. --- libstdc++-v3/include/bits/new_allocator.h | 6 +++--- libstdc++-v3/include/ext/malloc_allocator.h | 6 ++

[committed] libstdc++: Check for size overflow in constexpr allocation [PR105957]

2022-06-14 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/105957 * include/bits/allocator.h (allocator::allocate): Check for overflow in constexpr allocation. * testsuite/20_util/allocator/105975.cc: New test. --- libstdc++-v3/inclu

Re: [PATCH 2/5] xtensa: Add support for sibling call optimization

2022-06-14 Thread Max Filippov via Gcc-patches
, exit@PLT .align 4 .global main .type main, @function main: addisp, sp, -16 l32ra2, .LC5 s32i.n a0, sp, 12 callx0 a2 l32ra3, .LC6 movi.n a2, 0 callx0 a3 .size main, .-main .ident "GCC: (GNU) 13.0.0 20220614 (experimental)" -- Thanks. -- Max

[PATCH] gcc/configure.ac: fix --enable-fixed-point enablement [PR34422]

2022-06-14 Thread Eric Gallager via Gcc-patches
So, in investigating PR target/34422, I discovered that the gcc subdirectory's configure script had an instance of AC_ARG_ENABLE with 3rd and 4th its arguments reversed: the one where it warns that the --enable-fixed-point flag is being ignored is the one where that flag hasn't even been passed in

[PATCH] i386: Disallow sibcall when calling ifunc functions with PIC register

2022-06-14 Thread H.J. Lu via Gcc-patches
Disallow siball when calling ifunc functions with PIC register so that PIC register can be restored. gcc/ PR target/105960 * config/i386/i386.cc (ix86_function_ok_for_sibcall): Return false if PIC register is used when calling ifunc functions. gcc/testsuite/ PR t

Re: [PATCH] opts: improve option suggestion

2022-06-14 Thread Jeff Law via Gcc-patches
On 5/24/2022 2:45 AM, Martin Liška wrote: PING^1 On 5/12/22 09:10, Martin Liška wrote: On 5/11/22 20:49, David Malcolm wrote: On Wed, 2022-05-11 at 16:49 +0200, Martin Liška wrote: In case where we have 2 equally good candidates like -ftrivial-auto-var-init= -Wtrivial-auto-var-init for -f

Re: [committed] openmp: Conforming device numbers and omp_{initial, invalid}_device

2022-06-14 Thread Thomas Schwinge
Hi Jakub! On 2022-06-13T14:06:39+0200, Jakub Jelinek via Gcc-patches wrote: > OpenMP 5.2 changed once more what device numbers are allowed. > libgomp/ > * testsuite/libgomp.c-c++-common/target-is-accessible-1.c (main): Add > test with omp_initial_device. Use -5 instead of -1 for n

c++: Elide calls to NOP module initializers

2022-06-14 Thread Nathan Sidwell via Gcc-patches
This implements NOP module initializer elision. Each CMI gains a new flag informing importers whether its initializer actually does something (initializers its own globals, and/or calls initializers of its imports). This allows an importer to determine whether to call it. nathan -- Nathan S

Re: [PATCH 1/2]middle-end Support optimized division by pow2 bitmask

2022-06-14 Thread Richard Biener via Gcc-patches
> Am 14.06.2022 um 17:58 schrieb Tamar Christina via Gcc-patches > : > >  > >> -Original Message- >> From: Richard Sandiford >> Sent: Tuesday, June 14, 2022 2:43 PM >> To: Richard Biener >> Cc: Tamar Christina ; gcc-patches@gcc.gnu.org; >> nd >> Subject: Re: [PATCH 1/2]middle-end

RE: [PATCH 1/2]middle-end Support optimized division by pow2 bitmask

2022-06-14 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Sandiford > Sent: Tuesday, June 14, 2022 2:43 PM > To: Richard Biener > Cc: Tamar Christina ; gcc-patches@gcc.gnu.org; > nd > Subject: Re: [PATCH 1/2]middle-end Support optimized division by pow2 > bitmask > > Richard Biener writes: > > On Mon, 1

[PATCH v1.1] tree-optimization/105736: Don't let error_mark_node escape for ADDR_EXPR

2022-06-14 Thread Siddhesh Poyarekar
The addr_expr computation does not check for error_mark_node before returning the size expression. This used to work in the constant case because the conversion to uhwi would end up causing it to return size_unknown, but that won't work for the dynamic case. Modify the control flow to explicitly

[PATCH] tree-optimization/105736: Don't let error_mark_node escape for ADDR_EXPR

2022-06-14 Thread Siddhesh Poyarekar
The addr_expr computation does not check for error_mark_node before returning the size expression. This used to work in the constant case because the conversion to uhwi would end up causing it to return size_unknown, but that won't work for the dynamic case. Modify the control flow to explicitly

Re: [PATCH 1/2]middle-end Support optimized division by pow2 bitmask

2022-06-14 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Mon, 13 Jun 2022, Tamar Christina wrote: > >> > -Original Message- >> > From: Richard Biener >> > Sent: Monday, June 13, 2022 12:48 PM >> > To: Tamar Christina >> > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Sandiford >> > >> > Subject: RE: [PATCH 1/2]middle-e

Re: [PATCH take #2] Fold truncations of left shifts in match.pd

2022-06-14 Thread Richard Biener via Gcc-patches
On Sun, Jun 5, 2022 at 1:12 PM Roger Sayle wrote: > > > Hi Richard, > Many thanks for taking the time to explain how vectorization is supposed > to work. I now see that vect_recog_rotate_pattern in tree-vect-patterns.cc > is supposed to handle lowering of rotations to (vector) shifts, and > compl

RE: [PATCH 1/2]middle-end Support optimized division by pow2 bitmask

2022-06-14 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Biener > Sent: Tuesday, June 14, 2022 2:19 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Sandiford > > Subject: RE: [PATCH 1/2]middle-end Support optimized division by pow2 > bitmask > > On Mon, 13 Jun 2022, Tamar Christina wro

Re: [PATCH] Do not erase warning data in gimple_set_location

2022-06-14 Thread Richard Biener via Gcc-patches
On Tue, Jun 14, 2022 at 12:49 PM Eric Botcazou wrote: > > > Hmm, I think instead of special-casing UNKNOWN_LOCATION > > what gimple_set_location should probably do is either not copy > > warnings at all or union them. Btw, gimple_set_location also > > removes a previously set BLOCK (but gimple_se

[PATCH V2]rs6000: Store complicated constant into pool

2022-06-14 Thread Jiufu Guo via Gcc-patches
Hi, This patch is same with nearly: https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595378.html The concept of this patch is similar with the patches which is attached in PR63281. e.g. https://gcc.gnu.org/bugzilla/attachment.cgi?id=42186 I had a test for perlbench from SPEC2017. As expected,

RE: [PATCH 1/2]middle-end Support optimized division by pow2 bitmask

2022-06-14 Thread Richard Biener via Gcc-patches
On Mon, 13 Jun 2022, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Monday, June 13, 2022 12:48 PM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Sandiford > > > > Subject: RE: [PATCH 1/2]middle-end Support optimized division by p

Re: [PATCH][WIP] have configure probe prefix for gmp/mpfr/mpc [PR44425]

2022-06-14 Thread Richard Biener via Gcc-patches
On Mon, Jun 13, 2022 at 4:27 PM Eric Gallager wrote: > > On Mon, Jun 13, 2022 at 7:02 AM Richard Biener > wrote: > > > > On Thu, Jun 2, 2022 at 5:54 PM Eric Gallager via Gcc-patches > > wrote: > > > > > > So, I'm working on fixing PR bootstrap/44425, and have this patch to > > > have the top-lev

Re: [PATCH] predict: Adjust optimize_function_for_size_p [PR105818]

2022-06-14 Thread Segher Boessenkool
On Tue, Jun 14, 2022 at 03:57:08PM +0800, Kewen.Lin wrote: > PR target/105818 Change this to something else? It is not a target bug. "middle-end" perhaps? Thanks for fixing this, Segher

Re: [PATCH RFA] ubsan: default to trap on unreachable at -O0 and -Og [PR104642]

2022-06-14 Thread Jakub Jelinek via Gcc-patches
On Mon, Jun 13, 2022 at 03:53:13PM -0400, Jason Merrill via Gcc-patches wrote: > When not optimizing, we can't do anything useful with unreachability in > terms of code performance, so we might as well improve debugging by turning > __builtin_unreachable into a trap. In the PR richi suggested intr

Re: [PATCH v1 2/3] RISC-V: Split slli+sh[123]add.uw opportunities to avoid zext.w

2022-06-14 Thread Philipp Tomsich
Thanks, applied to master! For [3/3], I'll submit a new standalone patch with the requested changes. On Tue, 7 Jun 2022 at 12:25, Kito Cheng wrote: > > LGTM, you can commit that without [3/3] if you like :) > > On Wed, May 25, 2022 at 5:47 AM Philipp Tomsich > wrote: > > > > When encountering a

Re: [PATCH v1 1/3] RISC-V: add consecutive_bits_operand predicate

2022-06-14 Thread Philipp Tomsich
Thanks, applied to master! On Tue, 7 Jun 2022 at 12:26, Kito Cheng wrote: > > LGTM > > > On Wed, May 25, 2022 at 5:48 AM Philipp Tomsich > wrote: > > > > Provide an easy way to constrain for constants that are a a single, > > consecutive run of ones. > > > > gcc/ChangeLog: > > > > * con

Re: [PATCH] predict: Adjust optimize_function_for_size_p [PR105818]

2022-06-14 Thread Jan Hubicka via Gcc-patches
> Hi, > > Function optimize_function_for_size_p returns OPTIMIZE_SIZE_NO > if func->decl is not null but no cgraph node is available for it. > As PR105818 shows, this could give unexpected result. For the > case in PR105818, when parsing bar decl in function foo, the cfun > is a function structur

Re: [PATCH v2] RISC-V: bitmanip: improve constant-loading for (1ULL << 31) in DImode

2022-06-14 Thread Philipp Tomsich
Thanks, backport applied to releases/gcc-12! On Tue, 7 Jun 2022 at 12:28, Kito Cheng wrote: > > OK for backport? > > OK, it seems no issue after a week :) > > > > > > On Thu, 2 Jun 2022 at 21:23, Philipp Tomsich > wrote: > > > > > > Thanks, applied to trunk! > > > > > > On Thu, 2 Jun 2022 at 1

[PATCH] middle-end/105965 - add missing v_c_e <{ el }> simplification

2022-06-14 Thread Richard Biener via Gcc-patches
When we got the simplification of bit-field-ref to view-convert we lost the ability to detect FMAs since we cannot look through _1 = {_10}; _11 = VIEW_CONVERT_EXPR(_1); the following amends the (view_convert CONSTRUCTOR) pattern to handle this case. Bootstrapped and tested on x86_64-unknown-

Re: [PATCH] Do not erase warning data in gimple_set_location

2022-06-14 Thread Eric Botcazou via Gcc-patches
> Hmm, I think instead of special-casing UNKNOWN_LOCATION > what gimple_set_location should probably do is either not copy > warnings at all or union them. Btw, gimple_set_location also > removes a previously set BLOCK (but gimple_set_block preserves > the location locus and diagnostic override).

[PATCH] tree-optimization/105946 - avoid accessing excess args from uninit diag

2022-06-14 Thread Richard Biener via Gcc-patches
uninit diagnostics uses passing via reference and access attributes but that iterates over function type arguments which can in some cases appearantly outrun the actual arguments leading to ICEs. The following simply ignores not present arguments. Bootstrapped and tested on x86_64-unknown-linux-gn

RE: gcc-patches@gcc.gnu.org

2022-06-14 Thread thereisnotimeforsle...@gmail.com
<>

[PATCH] predict: Adjust optimize_function_for_size_p [PR105818]

2022-06-14 Thread Kewen.Lin via Gcc-patches
Hi, Function optimize_function_for_size_p returns OPTIMIZE_SIZE_NO if func->decl is not null but no cgraph node is available for it. As PR105818 shows, this could give unexpected result. For the case in PR105818, when parsing bar decl in function foo, the cfun is a function structure for foo, for