Re: [PATCH] options, lto: Optimize streaming of optimization nodes

2020-09-14 Thread Jakub Jelinek via Gcc-patches
On Mon, Sep 14, 2020 at 08:39:22AM +0200, Richard Biener wrote: > > When working on the previous patch, I've noticed that all cl_optimization > > fields appart from strings are streamed with bp_pack_value (..., 64); so we > > waste quite a lot of space, given that many of the options are just boole

RISC-V: fix a typo in riscv.h

2020-09-14 Thread Yeting Kuo via Gcc-patches
Hi all, The patch fixes a typo that would make some errors in fast-unaligned-access targets. RISC-V: fix a typo in riscv.h 2020-09-14 Yeting Kuo gcc/ * config/riscv/riscv.h diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h index 9f67d82e74e..b7b4a1c88a5

Re: RISC-V: fix a typo in riscv.h

2020-09-14 Thread Kito Cheng via Gcc-patches
Hi Yeting: Could you provide a test case for that? On Mon, Sep 14, 2020 at 3:15 PM Yeting Kuo via Gcc-patches wrote: > > Hi all, > > The patch fixes a typo that would make some errors in fast-unaligned-access > targets. > > RISC-V: fix a typo in riscv.h > > 2020-09-14 Yeting Kuo > >

[PATCH] Fortran : Two further previously missed ICEs PR53298

2020-09-14 Thread Mark Eggleston
Second attempt this time with patch attached. For review. Fixes the two ICEs reported in PR that remained after the previous fix. There is a side affect that is manifested in the tree dumps. Instead of __builtin_free (ptr2->dat.data); we get __builtin_free ((void *) ptr2->dat.data); I do no

Re: [PATCH] Fortran : ICE in build_field PR95614

2020-09-14 Thread Mark Eggleston
**ping** On 04/09/2020 08:35, Mark Eggleston wrote: Please find attached a fix for PR95614.  The original patch was by Steve Kargl. The original patch resulted in name clashes between global identifiers naming common blocks and local identifiers.  According to the 2018 standard 19.3.1 Classe

Re: [PATCH] options, lto: Optimize streaming of optimization nodes

2020-09-14 Thread Richard Biener
On Mon, 14 Sep 2020, Jakub Jelinek wrote: > On Mon, Sep 14, 2020 at 08:39:22AM +0200, Richard Biener wrote: > > > When working on the previous patch, I've noticed that all cl_optimization > > > fields appart from strings are streamed with bp_pack_value (..., 64); so > > > we > > > waste quite a l

Re: [PATCH] doc: fix spelling of -fprofile-reproducibility

2020-09-14 Thread Richard Biener via Gcc-patches
On Fri, Sep 11, 2020 at 11:55 PM Sergei Trofimovich via Gcc-patches wrote: > > From: Sergei Trofimovich > > gcc/ChangeLog: > > * doc/invoke.texi: fix '-fprofile-reproducibility' option > spelling in maunal. OK also for the branch. > --- > gcc/doc/invoke.texi | 9 + > 1

Re: [PATCH] -fprofile-reproducible: fix option value handling

2020-09-14 Thread Richard Biener via Gcc-patches
On Fri, Sep 11, 2020 at 11:56 PM Sergei Trofimovich via Gcc-patches wrote: > > From: Sergei Trofimovich > > Before the change option handling did not accept an argument: > xgcc: error: unknown profile reproducibility method '=serial' > xgcc: note: valid arguments to '-fprofile-reproducible' a

[patch] Fix dangling references in thunks at -O0

2020-09-14 Thread Eric Botcazou
Hi, when a thunk cannot be emitted in assembly directly, cgraph_node::expand_thunk generates regular GIMPLE code but unconditionally forces a tail call to the target of the thunk. That's theoretically OK because the thunk essentially forwards its parameters to the target, but in practice the R

Re: [PATCH] [PATCH] PR rtl-optimization/96791 Check precision of partial modes

2020-09-14 Thread Richard Biener via Gcc-patches
On Fri, Sep 11, 2020 at 4:18 PM Segher Boessenkool wrote: > > On Fri, Sep 11, 2020 at 08:07:39AM +0200, Richard Biener wrote: > > On Thu, Sep 10, 2020 at 5:12 PM Segher Boessenkool > > wrote: > > > On Thu, Sep 10, 2020 at 04:33:30PM +0200, Richard Biener wrote: > > > > On Thu, Sep 10, 2020 at 4:2

Re: [Patch] OpenMP/Fortran: Fix (re)mapping of allocatable/pointer arrays [PR96668]

2020-09-14 Thread Tobias Burnus
Second version, new is the second testcase, the change in omp-low.c, and around the two asserts in libgomp/target.c The new version now also handles 'omp declare target' variables. This usage occurs in five SPEC ACCEL testcases (all without 'always' clause), hence, real-world code seems to expect

Re: i386: Fix array index in expander

2020-09-14 Thread Richard Biener via Gcc-patches
On Fri, Sep 11, 2020 at 11:19 PM Nathan Sidwell wrote: > > I noticed a compiler warning about out-of-bound access. Fixed thusly. > > gcc/ > * config/i386/sse.md (mov): Fix operand indices. > > pushed as obvious looks like wrong-code as well so could you push to affected branche

Re: [patch] Fix dangling references in thunks at -O0

2020-09-14 Thread Richard Biener via Gcc-patches
On Mon, Sep 14, 2020 at 9:46 AM Eric Botcazou wrote: > > Hi, > > when a thunk cannot be emitted in assembly directly, cgraph_node::expand_thunk > generates regular GIMPLE code but unconditionally forces a tail call to the > target of the thunk. That's theoretically OK because the thunk essentiall

Re: [PATCH] Fortran : ICE in build_field PR95614

2020-09-14 Thread Andre Vehreschild
Hi Marc, the patch looks reasonable and ok to me. Ok for trunk. Thanks for the patch. Regards, Andre On Fri, 4 Sep 2020 08:35:59 +0100 Mark Eggleston wrote: > Please find attached a fix for PR95614.  The original patch was by Steve > Kargl. > > The original patch resulted in name cl

Re: [PATCH v2] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-14 Thread luoxhu via Gcc-patches
On 2020/9/10 18:08, Richard Biener wrote: > On Wed, Sep 9, 2020 at 6:03 PM Segher Boessenkool > wrote: >> >> On Wed, Sep 09, 2020 at 04:28:19PM +0200, Richard Biener wrote: >>> On Wed, Sep 9, 2020 at 3:49 PM Segher Boessenkool >>> wrote: Hi! On Tue, Sep 08, 2020 at 10:26:51

Re: [PATCH] options: Save and restore opts_set for Optimization and Target options

2020-09-14 Thread Christophe Lyon via Gcc-patches
On Mon, 14 Sep 2020 at 08:33, Richard Biener wrote: > > On Sun, 13 Sep 2020, Jakub Jelinek wrote: > > > On Fri, Sep 11, 2020 at 11:29:52AM +0200, Jakub Jelinek via Gcc-patches > > wrote: > > > On Fri, Sep 11, 2020 at 09:46:37AM +0200, Christophe Lyon via Gcc-patches > > > wrote: > > > > I'm seei

Re: [patch] Fix dangling references in thunks at -O0

2020-09-14 Thread Eric Botcazou
> ISTR the tailcall flag is only a hint and RTL expansion can decide to > not tailcall based on targets. So to me it looks like a missed > disqualification on the RTL expansion side. That's IMO debatable: the GIMPLE tailcall optimization pass e.g. does: /* Make sure the tail invocation of this

RE: [PATCH] arm: Fix up gcc.target/arm/lto/pr96939_* FAIL

2020-09-14 Thread Kyrylo Tkachov
Hi Jakub, > -Original Message- > From: Jakub Jelinek > Sent: 13 September 2020 09:39 > To: Richard Earnshaw ; Kyrylo Tkachov > > Cc: gcc-patches@gcc.gnu.org > Subject: [PATCH] arm: Fix up gcc.target/arm/lto/pr96939_* FAIL > > Hi! > > The following patch on top of the > https://gcc.gnu.

Re: [PATCH] options, lto: Optimize streaming of optimization nodes

2020-09-14 Thread Jakub Jelinek via Gcc-patches
On Mon, Sep 14, 2020 at 09:31:52AM +0200, Richard Biener wrote: > But does it make any noticable difference in the end? Using Yes. > bp_pack_var_len_unsigned just causes us to [u]leb encode half-bytes > rather than full bytes. Using hardcoded 8/16/32/64 makes it still > dependent on what 'int'

Re: [PATCH] options, lto: Optimize streaming of optimization nodes

2020-09-14 Thread Jan Hubicka
> On Mon, Sep 14, 2020 at 09:31:52AM +0200, Richard Biener wrote: > > But does it make any noticable difference in the end? Using > > Yes. > > > bp_pack_var_len_unsigned just causes us to [u]leb encode half-bytes > > rather than full bytes. Using hardcoded 8/16/32/64 makes it still > > dependen

[PATCH] rtlanal: fix subreg handling in set_noop_p ()

2020-09-14 Thread Ilya Leoshkevich via Gcc-patches
Bootstrapped and regtested on x86_64-redhat-linux. Ok for master? The following s390 rtx is errneously considered a no-op: (set (subreg:DF (reg:TF %f0) 8) (subreg:DF (reg:V1TF %f0) 8)) Here, SET_DEST is a second register in a floating-point register pair, and SET_SRC is the second half of a v

Re: [PATCH] options, lto: Optimize streaming of optimization nodes

2020-09-14 Thread Richard Biener
On Mon, 14 Sep 2020, Jakub Jelinek wrote: > On Mon, Sep 14, 2020 at 09:31:52AM +0200, Richard Biener wrote: > > But does it make any noticable difference in the end? Using > > Yes. > > > bp_pack_var_len_unsigned just causes us to [u]leb encode half-bytes > > rather than full bytes. Using hardc

[PATCH V2] vec: don't select partial vectors when looping on full vectors

2020-09-14 Thread Andrea Corallo
Hi all, here is the update version of the patch implementing suggestions. The check for 'vect_need_peeling_or_partial_vectors_p' (and its comment) has also been move just before so we can short-circuit the partial vector handling if we know we are using full vectors. Bootstrapped and regtested o

[PATCH] libiberty/pex-win32.c: Initialize orig_err

2020-09-14 Thread Christophe Lyon via Gcc-patches
Initializing orig_err avoids a warning: "may be used uninitialized". 2020-09-14 Torbjörn SVENSSON Christophe Lyon libiberty/ * pex-win32 (pex_win32_exec_child): Initialize orig_err. --- libiberty/pex-win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH] tree-optimization/97043 - fix latent wrong-code with SLP vectorization

2020-09-14 Thread Richard Biener
When the unrolling decision comes late and would have prevented eliding a SLP load permutation we can end up generating aligned loads when the load is in fact unaligned. Most of the time alignment analysis figures out the load is in fact unaligned but that cannot be relied upon. The following rem

Re: [PATCH v2] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-14 Thread Richard Biener via Gcc-patches
On Mon, Sep 14, 2020 at 10:05 AM luoxhu wrote: > > > > On 2020/9/10 18:08, Richard Biener wrote: > > On Wed, Sep 9, 2020 at 6:03 PM Segher Boessenkool > > wrote: > >> > >> On Wed, Sep 09, 2020 at 04:28:19PM +0200, Richard Biener wrote: > >>> On Wed, Sep 9, 2020 at 3:49 PM Segher Boessenkool > >>>

Re: [PATCH] options, lto: Optimize streaming of optimization nodes

2020-09-14 Thread Jakub Jelinek via Gcc-patches
On Mon, Sep 14, 2020 at 11:02:26AM +0200, Jan Hubicka wrote: > Especially for the new param machinery, most of streamed values are > probably going to be the default values. Perhaps somehow we could > stream them more effectively. Ah, that seems like a good idea, that brings further savings, the

Re: [PATCH] Fix overflow handling in std::align

2020-09-14 Thread Ville Voutilainen via Gcc-patches
On Mon, 14 Sep 2020 at 09:18, Glen Fernandes via Libstdc++ wrote: > > Edit; Correct patch this time. > > Fix overflow handling in align Should the test verify that space is unmodified when nullptr is returned?

Re: [PATCH] Fix overflow handling in std::align

2020-09-14 Thread Ville Voutilainen via Gcc-patches
On Mon, 14 Sep 2020 at 12:51, Ville Voutilainen wrote: > > On Mon, 14 Sep 2020 at 09:18, Glen Fernandes via Libstdc++ > wrote: > > > > Edit; Correct patch this time. > > > > Fix overflow handling in align > > Should the test verify that space is unmodified when nullptr is returned? ..and same fo

[PATCH]rs6000: Remove useless insns fed into lvx/stvx [PR97019]

2020-09-14 Thread Kewen.Lin via Gcc-patches
Hi, This patch is to extend the existing function find_alignment_op to check all defintions of base_reg are AND operations with mask -16B to force the alignment. If all are satifised, it passes all AND operations and instructions in one vector to recombine_lvx_pattern and recombine_stvx_pattern,

Re: [patch] Fix dangling references in thunks at -O0

2020-09-14 Thread Richard Biener via Gcc-patches
On Mon, Sep 14, 2020 at 10:36 AM Eric Botcazou wrote: > > > ISTR the tailcall flag is only a hint and RTL expansion can decide to > > not tailcall based on targets. So to me it looks like a missed > > disqualification on the RTL expansion side. > > That's IMO debatable: the GIMPLE tailcall optimi

Re: i386: Fix array index in expander

2020-09-14 Thread Hongtao Liu via Gcc-patches
On Mon, Sep 14, 2020 at 3:51 PM Richard Biener via Gcc-patches wrote: > > On Fri, Sep 11, 2020 at 11:19 PM Nathan Sidwell wrote: > > > > I noticed a compiler warning about out-of-bound access. Fixed thusly. > > > > gcc/ > > * config/i386/sse.md (mov): Fix operand indices. > > >

Re: [PATCH v2] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-14 Thread Richard Sandiford
Richard Biener via Gcc-patches writes: > On gimple the above function (after fixing it) looks like > > VIEW_CONVERT_EXPR(u)[_1] = i_4(D); > > and the IFN idea I had would - for non-global memory 'u' only - transform > this to > > vector_register_2 = u; > vector_register_3 = .IFN_VEC_SET (vec

Re: [PATCH] rtlanal: fix subreg handling in set_noop_p ()

2020-09-14 Thread Richard Sandiford
Ilya Leoshkevich writes: > Bootstrapped and regtested on x86_64-redhat-linux. Ok for master? > > > > The following s390 rtx is errneously considered a no-op: > > (set (subreg:DF (reg:TF %f0) 8) (subreg:DF (reg:V1TF %f0) 8)) > > Here, SET_DEST is a second register in a floating-point register pair

Re: [patch] Fix dangling references in thunks at -O0

2020-09-14 Thread Eric Botcazou
> No, so you're right - validity analysis is split. Still the cause you > reference comes from RTL expansion which means RTL expansion should > possibly do the disqualification here. The question is what makes the case > you run into at -O0 impossible to trigger with -O1+? The key test in use_re

Re: [Patch] OpenMP/Fortran: Fix (re)mapping of allocatable/pointer arrays [PR96668]

2020-09-14 Thread Jakub Jelinek via Gcc-patches
On Mon, Sep 14, 2020 at 09:50:08AM +0200, Tobias Burnus wrote: > --- a/gcc/fortran/trans-openmp.c > +++ b/gcc/fortran/trans-openmp.c > @@ -1357,6 +1357,15 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p) >tree type = TREE_TYPE (decl); >tree ptr = gfc_conv_descriptor_data_get (de

Re: [patch] Fix dangling references in thunks at -O0

2020-09-14 Thread Eric Botcazou
> That being said, I can add another bit to cfun, e.g. is_gimple_thunk, and > force the use of a register above only in case the bit is true. In fact I can probably reuse cfun->tail_call_marked for this purpose. -- Eric Botcazou

Re: RISC-V: fix a typo in riscv.h

2020-09-14 Thread Yeting Kuo via Gcc-patches
Hi Kito, > > Could you provide a test case for that? > I add the test case and update the git message. RISC-V: fix a typo in riscv.h The missing parentheses would make shorten-memrefs pass give a wrong base when the offset of load/store is not multiple of 4. 2020-09-14 Yeting Kuo

Re: [PATCH v2] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-14 Thread Richard Biener via Gcc-patches
On Mon, Sep 14, 2020 at 12:47 PM Richard Sandiford wrote: > > Richard Biener via Gcc-patches writes: > > On gimple the above function (after fixing it) looks like > > > > VIEW_CONVERT_EXPR(u)[_1] = i_4(D); > > > > and the IFN idea I had would - for non-global memory 'u' only - transform > > thi

Re: [patch] Fix dangling references in thunks at -O0

2020-09-14 Thread Richard Biener via Gcc-patches
On Mon, Sep 14, 2020 at 12:56 PM Eric Botcazou wrote: > > > No, so you're right - validity analysis is split. Still the cause you > > reference comes from RTL expansion which means RTL expansion should > > possibly do the disqualification here. The question is what makes the case > > you run int

Re: [patch] Fix dangling references in thunks at -O0

2020-09-14 Thread Eric Botcazou
> In fact I can probably reuse cfun->tail_call_marked for this purpose. Like so. * cgraphunit.c (cgraph_node::expand_thunk): Make sure to set cfun->tail_call_marked when forcing a tail call. * function.c (assign_parm_setup_reg): Always use a register to retrieve a

Re: [PATCH v2] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-14 Thread Richard Sandiford
Richard Biener writes: > On Mon, Sep 14, 2020 at 12:47 PM Richard Sandiford > wrote: >> >> Richard Biener via Gcc-patches writes: >> > On gimple the above function (after fixing it) looks like >> > >> > VIEW_CONVERT_EXPR(u)[_1] = i_4(D); >> > >> > and the IFN idea I had would - for non-global

[PATCH] AArch64: Enable fast shifts on Neoverse N1

2020-09-14 Thread Wilco Dijkstra
Enable the fast shift feature in Neoverse N1 tuning - this means additions with a shift left by 1-4 are as fast as addition. This improves multiply by constant expansions, eg. x * 25 is now emitted using shifts rather than a multiply: add w0, w0, w0, lsl 2 add w0, w0, w0, lsl 2 Bootstrap OK, regr

Re: i386: Fix array index in expander

2020-09-14 Thread Nathan Sidwell
On 9/14/20 6:10 AM, Hongtao Liu wrote: On Mon, Sep 14, 2020 at 3:51 PM Richard Biener via Gcc-patches wrote: On Fri, Sep 11, 2020 at 11:19 PM Nathan Sidwell wrote: I noticed a compiler warning about out-of-bound access. Fixed thusly. gcc/ * config/i386/sse.md (mov): Fi

Re: [PATCH] Fix overflow handling in std::align

2020-09-14 Thread Glen Fernandes via Gcc-patches
On Mon, Sep 14, 2020 at 5:52 AM Ville Voutilainen wrote: > On Mon, 14 Sep 2020 at 12:51, Ville Voutilainen > wrote: > > On Mon, 14 Sep 2020 at 09:18, Glen Fernandes > wrote: > > > Edit; Correct patch this time. > > > > > > Fix overflow handling in align > > > > Should the test verify that space is

Re: [Patch] OpenMP: Handle cpp_implicit_alias in declare-target discovery (PR96390)

2020-09-14 Thread Tobias Burnus
Hello Jakub, hi Honza, On 8/31/20 5:53 PM, Jakub Jelinek wrote: On Mon, Aug 03, 2020 at 05:37:40PM +0200, Tobias Burnus wrote: It turned out that the omp_discover_declare_target_tgt_fn_r discovered all nodes – but as it tagged the C++ alias nodes and not the streamed-out nodes, no device functi

Re: Ping: [PATCH 1/2] Fold plusminus_mult expr with multi-use operands (PR 94234)

2020-09-14 Thread Richard Biener via Gcc-patches
On Mon, Sep 14, 2020 at 5:17 AM Feng Xue OS via Gcc-patches wrote: > > Thanks, @@ -3426,8 +3426,16 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) /* Re-fold the toplevel result. It's basically an embedded gimple_build w/o actually building the st

Re: [patch] Fix dangling references in thunks at -O0

2020-09-14 Thread Richard Biener via Gcc-patches
On Mon, Sep 14, 2020 at 1:31 PM Eric Botcazou wrote: > > > In fact I can probably reuse cfun->tail_call_marked for this purpose. > > Like so. Looks reasonable to me. Richard. > > * cgraphunit.c (cgraph_node::expand_thunk): Make sure to set > cfun->tail_call_marked when forcing a

[PATCH 1/2] AArch64: Cleanup CPU option processing code

2020-09-14 Thread Wilco Dijkstra
The --with-cpu/--with-arch configure option processing not only checks valid arguments but also sets TARGET_CPU_DEFAULT with a CPU and extension bitmask. This isn't used however since a --with-cpu is translated into a -mcpu option which is processed as if written on the command-line (so TARGET_

[PATCH 2/2] AArch64: Add support for --with-tune

2020-09-14 Thread Wilco Dijkstra
Add support for --with-tune. Like --with-cpu and --with-arch, the argument is validated and transformed into a -mtune option to be processed like any other command-line option. --with-tune has no effect if a -mcpu or -mtune option is used. The validating code didn't allow --with-cpu=native, so exp

Re: [PATCH 1/2] AArch64: Cleanup CPU option processing code

2020-09-14 Thread Richard Earnshaw (lists)
On 14/09/2020 15:19, Wilco Dijkstra wrote: > The --with-cpu/--with-arch configure option processing not only checks valid > arguments > but also sets TARGET_CPU_DEFAULT with a CPU and extension bitmask. This > isn't used > however since a --with-cpu is translated into a -mcpu option which is >

Re: [PATCH] Fix overflow handling in std::align

2020-09-14 Thread Ville Voutilainen via Gcc-patches
On Mon, 14 Sep 2020 at 15:49, Glen Fernandes wrote: > > On Mon, Sep 14, 2020 at 5:52 AM Ville Voutilainen wrote: > > On Mon, 14 Sep 2020 at 12:51, Ville Voutilainen > > wrote: > > > On Mon, 14 Sep 2020 at 09:18, Glen Fernandes > > wrote: > > > > Edit; Correct patch this time. > > > > > > > > Fix

Re: [PATCH] Ignore the clobbered stack pointer in asm statment

2020-09-14 Thread Jakub Jelinek via Gcc-patches
On Sat, Sep 12, 2020 at 10:11:36AM -0700, H.J. Lu via Gcc-patches wrote: > Clobbering the stack pointer in asm statment has been deprecated. Adding > the stack pointer register to the clobber list has traditionally had some > undocumented and somewhat obscure side-effects, including ICE. Issue >

[PATCH] libstdc++: Pretty printers for std::_Bit_reference, std::_Bit_iterator and std::_Bit_const_iterator

2020-09-14 Thread Michael Weghorn via Gcc-patches
Hi, the attached patch implements pretty printers relevant for iteration over std::vector, thus handling the TODO added in commit 36d0dada6773d7fd7c5ace64c90e723930a3b81e ("Have std::vector printer's iterator return bool for vector", 2019-06-19): TODO add printer for vector's _Bit_iterator an

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-14 Thread Qing Zhao via Gcc-patches
Hi, Richard, > On Sep 11, 2020, at 5:56 PM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 11, 2020, at 4:44 PM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: > On Sep 11, 2020, at 12:32 PM, Richard Sandiford > >> If we go for (

Re: [PATCH] AArch64: Enable fast shifts on Neoverse N1

2020-09-14 Thread Richard Earnshaw (lists)
On 14/09/2020 13:01, Wilco Dijkstra wrote: > Enable the fast shift feature in Neoverse N1 tuning - this means additions > with > a shift left by 1-4 are as fast as addition. This improves multiply by > constant > expansions, eg. x * 25 is now emitted using shifts rather than a multiply: > > add

Re: [PATCH] Ignore the clobbered stack pointer in asm statment

2020-09-14 Thread H.J. Lu via Gcc-patches
On Mon, Sep 14, 2020 at 7:35 AM Jakub Jelinek wrote: > > On Sat, Sep 12, 2020 at 10:11:36AM -0700, H.J. Lu via Gcc-patches wrote: > > Clobbering the stack pointer in asm statment has been deprecated. Adding > > the stack pointer register to the clobber list has traditionally had some > > undocume

Re: PSA: Default C++ dialect is now C++17

2020-09-14 Thread Jason Merrill via Gcc-patches
On Mon, Jun 29, 2020 at 1:25 PM Martin Liška wrote: > > On 6/29/20 4:57 PM, Marek Polacek wrote: > > On Mon, Jun 29, 2020 at 09:51:57AM +0200, Martin Liška wrote: > >> On 6/26/20 9:34 PM, Marek Polacek via Gcc-patches wrote: > >>> As discussed last month: > >>>

Re: [PATCH] [PATCH] PR rtl-optimization/96791 Check precision of partial modes

2020-09-14 Thread Segher Boessenkool
On Mon, Sep 14, 2020 at 09:46:11AM +0200, Richard Biener wrote: > On Fri, Sep 11, 2020 at 4:18 PM Segher Boessenkool > wrote: > > Until 2014 (and documented just days ago ;-) ) all bits of a partial > > integer mode were considered unknown. > > All bits or all bits outside of its precision? I ho

Re: [PATCH] Ignore the clobbered stack pointer in asm statment

2020-09-14 Thread H.J. Lu via Gcc-patches
On Mon, Sep 14, 2020 at 8:12 AM H.J. Lu wrote: > > On Mon, Sep 14, 2020 at 7:35 AM Jakub Jelinek wrote: > > > > On Sat, Sep 12, 2020 at 10:11:36AM -0700, H.J. Lu via Gcc-patches wrote: > > > Clobbering the stack pointer in asm statment has been deprecated. Adding > > > the stack pointer register

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-14 Thread Richard Sandiford
Qing Zhao writes: >> Like I mentioned earlier though, passes that run after >> pass_thread_prologue_and_epilogue can use call-clobbered registers that >> weren't previously used. For example, on x86_64, the function might >> not use %r8 when the prologue, epilogue and returns are generated, >> bu

[committed] analyzer: fix ICE on setjmp with non-pointer-type [PR97029]

2020-09-14 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to master as r11-3188-g35e3f0829d8e9cdc7ea19917c9f3a7add3f14847. gcc/analyzer/ChangeLog: PR analyzer/97029 * analyzer.cc (is_setjmp_call_p): Require the initial arg to be a pointer. * region-model

[committed] analyzer: add regression test for leak false positive

2020-09-14 Thread David Malcolm via Gcc-patches
Downstream bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1878600 describes a false positive from -Wanalyzer-file-leak seen with gcc 10.2, but which has been fixed in gcc 11. This patch adds the reproducer as a regression test. Successfully tested on x86_64-pc-linux-gnu. Pushed to mast

[committed] analyzer: fix constraint explosion on many-cased-switch [PR96653]

2020-09-14 Thread David Malcolm via Gcc-patches
PR analyzer/96653 reports a CPU-time and memory explosion in -fanalyzer seen in Linux 5.9-rc1:drivers/media/v4l2-core/v4l2-ctrls.c on a switch statement with many cases. The issue is some old code in constraint_manager::get_or_add_equiv_class for ensuring that comparisons between equivalence class

[committed] analyzer: add -param=analyzer-max-constraints=

2020-09-14 Thread David Malcolm via Gcc-patches
On attempting to run the full test suite with -fanalyzer via make check RUNTESTFLAGS="-v -v --target_board=unix/-fanalyzer" I saw it get stuck on: gcc.c-torture/compile/20001226-1.c It turns out this was on a debug build, rather than a release build; but a release build with -fanalyzer took:

[PATCH] aarch64: Fix ICE on fpsr fpcr getters [PR96968]

2020-09-14 Thread Andrea Corallo
Hi all, I'd like to submit this patch to fix PR96968 and add the corresponding test. The fix makes sure the target of these getters is a register so the insn can be pattern matched correctly. Regtested and bootsraped on aarch64-linux-gnu. Okay for trunk? Thanks Andrea >From 74f5223724fe8ff

c++: local externs in templates do not get template head

2020-09-14 Thread Nathan Sidwell
Now we consistently mark local externs with DECL_LOCAL_DECL_P, we can teach the template machinery not to give them a TEMPLATE_DECL head, and the instantiation machinery treat them as the local specialiations they are. (openmp UDRs also fall into this category, and are dealt with similarly.)

Re: c++: local externs in templates do not get template head

2020-09-14 Thread Marek Polacek via Gcc-patches
On Mon, Sep 14, 2020 at 12:45:33PM -0400, Nathan Sidwell wrote: > Now we consistently mark local externs with DECL_LOCAL_DECL_P, we can > teach the template machinery not to give them a TEMPLATE_DECL head, > and the instantiation machinery treat them as the local specialiations > they are. (openmp

Re: c++: local externs in templates do not get template head

2020-09-14 Thread Nathan Sidwell
On 9/14/20 12:49 PM, Marek Polacek wrote: On Mon, Sep 14, 2020 at 12:45:33PM -0400, Nathan Sidwell wrote: Now we consistently mark local externs with DECL_LOCAL_DECL_P, we can teach the template machinery not to give them a TEMPLATE_DECL head, and the instantiation machinery treat them as the lo

Re: [PATCH] Ignore the clobbered stack pointer in asm statment

2020-09-14 Thread Jakub Jelinek via Gcc-patches
On Mon, Sep 14, 2020 at 08:57:18AM -0700, H.J. Lu via Gcc-patches wrote: > Something like this for GCC 8 and 9. Guess my preference would be to do this everywhere and then let's discuss if we change the warning into error there or keep it being deprecated. Though, let's see what others want to sa

Re: [PATCH]rs6000: Remove useless insns fed into lvx/stvx [PR97019]

2020-09-14 Thread Segher Boessenkool
Hi! On Mon, Sep 14, 2020 at 05:53:13PM +0800, Kewen.Lin wrote: > This patch is to extend the existing function find_alignment_op to > check all defintions of base_reg are AND operations with mask -16B > to force the alignment. If all are satifised, it passes all AND > operations and instructions

[PATCH] c, c++: Implement -Wsizeof-array-div [PR91741]

2020-09-14 Thread Marek Polacek via Gcc-patches
This patch implements a new warning, -Wsizeof-array-div. It warns about code like int arr[10]; sizeof (arr) / sizeof (short); where we have a division of two sizeof expressions, where the first argument is an array, and the second sizeof does not equal the size of the array element. See e.g

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-14 Thread Qing Zhao via Gcc-patches
> On Sep 14, 2020, at 11:33 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> Like I mentioned earlier though, passes that run after >>> pass_thread_prologue_and_epilogue can use call-clobbered registers that >>> weren't previously used. For example, on x86_64, the function might >>>

[pushed] Darwin, X86, testsuite: Fix pr87767 tests for Darwin.

2020-09-14 Thread Iain Sandoe
Hi The tests assume non-PIC for m32 (which means that they fail on default PIC targets, like Darwin), also on Linux with -fpic, FWIW. There is also a missing space before the closing '}' on one of the dg-require- effective-target which means that test fails on machines without avx512f. Tested on

Re: c++: local externs in templates do not get template head

2020-09-14 Thread Marek Polacek via Gcc-patches
On Mon, Sep 14, 2020 at 12:53:18PM -0400, Nathan Sidwell wrote: > On 9/14/20 12:49 PM, Marek Polacek wrote: > > On Mon, Sep 14, 2020 at 12:45:33PM -0400, Nathan Sidwell wrote: > > > Now we consistently mark local externs with DECL_LOCAL_DECL_P, we can > > > teach the template machinery not to give

Re: [PATCH 1/2] AArch64: Cleanup CPU option processing code

2020-09-14 Thread Wilco Dijkstra
Hi Richard, >On 14/09/2020 15:19, Wilco Dijkstra wrote: >> The --with-cpu/--with-arch configure option processing not only checks valid >> arguments >> but also sets TARGET_CPU_DEFAULT with a CPU and extension bitmask.  This >> isn't used >> however since a --with-cpu is translated into a -mcpu

[COMMITTED 1/2] bpf: use the expected instruction for NOPs

2020-09-14 Thread Jose E. Marchesi via Gcc-patches
The BPF ISA doesn't have a no-operation instruction, but in practice the Linux kernel verifier performs some optimizations that rely on these instructions to be encoded in a particular way. As it turns out, we were using the "wrong" instruction in GCC. This patch makes GCC to generate the expecte

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-14 Thread Richard Sandiford
Qing Zhao writes: >> On Sep 14, 2020, at 11:33 AM, Richard Sandiford >> wrote: >> >> Qing Zhao writes: Like I mentioned earlier though, passes that run after pass_thread_prologue_and_epilogue can use call-clobbered registers that weren't previously used. For example, on x86_64,

[PATCH] PR/fortran 96983 - ICE compiling gfortran.dg/pr96711.f90

2020-09-14 Thread Harald Anlauf
Dear all, my fix for PR fortran/96711 adds a testcase that failed on powerpc64-*-* as well as sparc*-sun-solaris2.11. This is a consequence of the, say, mess, on x86, where we have real kinds 4,8,10,16, with kind=10 being long double and kind=16 being represented as float128, while on sparc real(

Re: [PATCH v2] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-14 Thread Segher Boessenkool
On Thu, Sep 10, 2020 at 12:08:44PM +0200, Richard Biener wrote: > On Wed, Sep 9, 2020 at 6:03 PM Segher Boessenkool > wrote: > > There often are problems over function calls (where the compiler cannot > > usually *see* how something is used). > > Yep. The best way would be to use small loads and

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-14 Thread Qing Zhao via Gcc-patches
> On Sep 14, 2020, at 2:20 PM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 14, 2020, at 11:33 AM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: > Like I mentioned earlier though, passes that run after > pass_thread_prologue_an

Re: [PATCH] mixing of labels and code in C2X

2020-09-14 Thread Joseph Myers
On Sun, 13 Sep 2020, Uecker, Martin wrote: > Hi Joseph, > > here is the (unfinished) patch to support > mixing of labels in C2X. I think there should be explicit tests for old standard versions (c11-labels-1.c etc.) that these usages are errors with -pedantic-errors with the old -std option, a

Re: [PATCH] Ignore the clobbered stack pointer in asm statment

2020-09-14 Thread H.J. Lu via Gcc-patches
On Mon, Sep 14, 2020 at 10:05 AM Jakub Jelinek wrote: > > On Mon, Sep 14, 2020 at 08:57:18AM -0700, H.J. Lu via Gcc-patches wrote: > > Something like this for GCC 8 and 9. > > Guess my preference would be to do this everywhere and then let's discuss if The same patch also works on master branch.

Re: [PATH 3/3] libstdc++: Add std::advance ostreambuf_iterator overload

2020-09-14 Thread François Dumont via Gcc-patches
On 10/09/20 5:19 pm, Jonathan Wakely wrote: On 09/09/20 22:12 +0200, François Dumont via Libstdc++ wrote: libstdc++: Add std::advance overload for ostreambuf_iterator Implement std::advance overload for ostreambuf_iterator using basic_streambuf pubseekof. libstdc++-v3/ChangeLog:      

Re: [PATCH] c, c++: Implement -Wsizeof-array-div [PR91741]

2020-09-14 Thread Joseph Myers
On Mon, 14 Sep 2020, Marek Polacek via Gcc-patches wrote: > so I followed suit. In the C++ FE this was rather easy, because > finish_parenthesized_expr already set TREE_NO_WARNING. In the C FE > it was trickier; I've added a NOP_EXPR to discern between the non-() > and () versions. This sort of

Re: [PATCH v2] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-14 Thread Segher Boessenkool
On Mon, Sep 14, 2020 at 11:47:56AM +0200, Richard Biener wrote: > this should be > >u[n % 4] = i; > > I guess. Is the % 4 mandated by the vec_insert semantics btw? Yes: VEC_INSERT (ARG1, ARG2, ARG3) Purpose: Returns a copy of vector ARG2 with element ARG3 replaced by the value of ARG

Re: [PATCH v2] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-14 Thread Segher Boessenkool
On Mon, Sep 14, 2020 at 11:47:52AM +0100, Richard Sandiford wrote: > Would it be worth changing the optab so that the input and output are > separate? Having a single operand would be justified if the operation > was only supposed to touch the selected bytes, but most targets wouldn't > guarantee

libbacktrace: Add support for MiniDebugInfo

2020-09-14 Thread Ian Lance Taylor via Gcc-patches
This patch to libbacktrace adds support for MiniDebugInfo, as requested in PR 93608. MiniDebugInfo stores compressed symbol tables for an executable, where the executable is otherwise stripped. It is documented at https://fedoraproject.org/wiki/Features/MiniDebugInfo and https://sourceware.org/gd

Re: [PATCH] Fix overflow handling in std::align

2020-09-14 Thread Thomas Rodgers
> On Sep 14, 2020, at 7:30 AM, Ville Voutilainen via Libstdc++ > wrote: > > On Mon, 14 Sep 2020 at 15:49, Glen Fernandes wrote: >> >> On Mon, Sep 14, 2020 at 5:52 AM Ville Voutilainen wrote: >>> On Mon, 14 Sep 2020 at 12:51, Ville Voutilainen >>> wrote: On Mon, 14 Sep 2020 at 09:18, Gl

Re: [PATCH] correct handling of indices into arrays with elements larger than 1 (PR c++/96511)

2020-09-14 Thread Martin Sebor via Gcc-patches
On 9/4/20 11:14 AM, Jason Merrill wrote: On 9/3/20 2:44 PM, Martin Sebor wrote: On 9/1/20 1:22 PM, Jason Merrill wrote: On 8/11/20 12:19 PM, Martin Sebor via Gcc-patches wrote: -Wplacement-new handles array indices and pointer offsets the same: by adjusting them by the size of the element.  Th

[PATCH] bb-reorder: Fix for ICEs caused by 69ca5f3a9882

2020-09-14 Thread Segher Boessenkool
After the previous patch we are left with an unreachable BB. This will ICE if either we have -fschedule-fusion, or we do not have peephole2. This fixes it. Okay for trunk? Segher 2020-09-14 Segher Boessenkool PR rtl-optimization/96475 * bb-reorder.c (duplicate_computed_go

[r11-3192 Regression] FAIL: libgomp.c++/udr-3.C execution test on Linux/x86_64 (-m64 -march=cascadelake)

2020-09-14 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, e9fdb9a73249f95f3da2d7fde6f268ae12d0d22c is the first bad commit commit e9fdb9a73249f95f3da2d7fde6f268ae12d0d22c Author: Nathan Sidwell Date: Mon Sep 14 09:42:29 2020 -0700 c++: local externs in templates do not get template head caused FAIL: libgomp.c++/udr-3.C executio

[r11-3192 Regression] FAIL: libgomp.c++/udr-13.C execution test on Linux/x86_64 (-m64 -march=cascadelake)

2020-09-14 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, e9fdb9a73249f95f3da2d7fde6f268ae12d0d22c is the first bad commit commit e9fdb9a73249f95f3da2d7fde6f268ae12d0d22c Author: Nathan Sidwell Date: Mon Sep 14 09:42:29 2020 -0700 c++: local externs in templates do not get template head caused FAIL: libgomp.c++/udr-13.C executi

Re: c++: local externs in templates do not get template head

2020-09-14 Thread Tobias Burnus
This patch cause run-time fails for g++ -fopenmp libgomp/testsuite/libgomp.c++/udr-13.C The follow-up fix does not help. Namely, in udr-3.C:115: 115 if (t.s != 11 || v.v != 9 || q != 0 || d != 3.0) abort (); (gdb) p t.s $1 = 11 (gdb) p v.v $2 = 4 (gdb) p q $3 = 0 (gdb) p d $4 = 3

Re: [Patch] OpenMP/Fortran: Fix (re)mapping of allocatable/pointer arrays [PR96668]

2020-09-14 Thread Tobias Burnus
On 9/14/20 1:03 PM, Jakub Jelinek wrote: + + if (flag_openmp && !(TYPE_QUALS (TREE_TYPE (ptr)) & TYPE_QUAL_RESTRICT)) +always_modifier = true; I think we don't want to depend on flag_openmp here, ... Guess for now an openacc flag with (ctx->region_type & ORT_ACC) != 0 passed to it seems

Re: [PATCH] -fprofile-reproducible: fix option value handling

2020-09-14 Thread Sergei Trofimovich via Gcc-patches
On Mon, 14 Sep 2020 09:34:08 +0200 Richard Biener wrote: > On Fri, Sep 11, 2020 at 11:56 PM Sergei Trofimovich via Gcc-patches > wrote: > > > > From: Sergei Trofimovich > > > > Before the change option handling did not accept an argument: > > xgcc: error: unknown profile reproducibility metho

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-14 Thread Segher Boessenkool
On Fri, Sep 11, 2020 at 05:41:47PM -0500, Qing Zhao wrote: > > On Sep 11, 2020, at 4:51 PM, Segher Boessenkool > > wrote: > > It is definitely *not* effective if there are gadgets that set rax to > > a value the attacker wants and then do a syscall. > > You mean the following gadget: > > > Gad

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-14 Thread Segher Boessenkool
Hi! On Fri, Sep 11, 2020 at 05:24:58PM -0500, Qing Zhao wrote: > > So IMO the pass should just search for all the > > returns in a function and insert the zeroing instructions before > > each one. > > I was considering this approach too for some time, however, there is one > major issue with thi

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-14 Thread Segher Boessenkool
On Mon, Sep 14, 2020 at 05:33:33PM +0100, Richard Sandiford wrote: > > However, for the cases on Power as Segher mentioned, there are also some > > scratch registers used for > > Other purpose, not sure whether we can correctly generate zeroing in > > middle-end for Power? > > Segher would be be

[r11-3192 Regression] FAIL: libgomp.c++/udr-3.C execution test on Linux/x86_64 (-m64)

2020-09-14 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, e9fdb9a73249f95f3da2d7fde6f268ae12d0d22c is the first bad commit commit e9fdb9a73249f95f3da2d7fde6f268ae12d0d22c Author: Nathan Sidwell Date: Mon Sep 14 09:42:29 2020 -0700 c++: local externs in templates do not get template head caused FAIL: libgomp.c++/udr-3.C executio

  1   2   >