Re: [PATCH] [PATCH,v4,1/1,AARCH64][PR102768] aarch64: Add compiler support for Shadow Call Stack

2022-02-25 Thread Dan Li via Gcc-patches
On 2/11/22 07:35, Richard Sandiford wrote: Dan Li writes: On 2/11/22 01:53, Richard Sandiford wrote: Dan Li writes: On 2/10/22 01:55, Richard Sandiford wrote: void f(); int g(int x) { if (x == 0) { __asm__ ("":::"x19", "x20"); return 1; } f();

Re: [PATCH][V3][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Richard Biener via Gcc-patches
On Fri, 25 Feb 2022, Qing Zhao wrote: > Hi, Jakub and Richard: > > This is the 3rd version of the patch, the major change compared to the > previous version are: > > 1. Add warning_enabled_at guard before “suppress_warning” > 2. Add location to the call to __builtin_clear_padding for auto init.

[PATCH] AVX512F: Add helper enumeration for ternary logic intrinsics.

2022-02-25 Thread Hongyu Wang via Gcc-patches
Hi, This patch intends to sync with llvm change in https://reviews.llvm.org/D120307 to add enumeration and truncate imm to unsigned char, so users could use ~ on immediates. Bootstraped/regtested on x86_64-pc-linux-gnu{-m32,}. Ok for master? gcc/ChangeLog: * config/i386/avx512fintrin.h

Re: [PATCH] Check if loading const from mem is faster

2022-02-25 Thread Richard Biener via Gcc-patches
On Fri, 25 Feb 2022, Jiufu Guo wrote: > Richard Biener writes: > > > On Thu, 24 Feb 2022, Jiufu Guo wrote: > > > >> Jiufu Guo via Gcc-patches writes: > >> > >> > Segher Boessenkool writes: > >> > > >> >> On Wed, Feb 23, 2022 at 02:02:59PM +0100, Richard Biener wrote: > >> >>> I'm assuming we'

Re: [PATCH][V2][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Jakub Jelinek via Gcc-patches
On Fri, Feb 25, 2022 at 08:11:40AM +0100, Richard Biener via Gcc-patches wrote: > On Thu, 24 Feb 2022, Qing Zhao wrote: > > > I briefly checked all the usages of suppress_warning within the current > > gcc, > > and see that most of them are not guarded by any condition. > > > > So, the current

Re: [PATCH][V2][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Richard Biener via Gcc-patches
On Fri, 25 Feb 2022, Jakub Jelinek wrote: > On Fri, Feb 25, 2022 at 08:11:40AM +0100, Richard Biener via Gcc-patches > wrote: > > On Thu, 24 Feb 2022, Qing Zhao wrote: > > > > > I briefly checked all the usages of suppress_warning within the current > > > gcc, > > > and see that most of them a

Re: [PATCH][V2][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Jakub Jelinek via Gcc-patches
On Fri, Feb 25, 2022 at 10:13:33AM +0100, Richard Biener via Gcc-patches wrote: > I meant > > /* Set the no_warning flag of STMT to NO_WARNING. */ > > static inline void > gimple_set_no_warning (gimple *stmt, bool no_warning) > { > stmt->no_warning = (unsigned) no_warning; > } > > on the arti

[PATCH] match.pd: Don't create BIT_NOT_EXPRs for COMPLEX_TYPE [PR104675]

2022-02-25 Thread Jakub Jelinek via Gcc-patches
Hi! We don't support BIT_{AND,IOR,XOR,NOT}_EXPR on complex types, &/|/^ are just rejected for them, and ~ is parsed as CONJ_EXPR. So, we should avoid simplifications which turn valid complex type expressions into something that will ICE during expansion. Bootstrapped/regtested on x86_64-linux and

Re: [PATCH][V2][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Richard Biener via Gcc-patches
On Fri, 25 Feb 2022, Jakub Jelinek wrote: > On Fri, Feb 25, 2022 at 10:13:33AM +0100, Richard Biener via Gcc-patches > wrote: > > I meant > > > > /* Set the no_warning flag of STMT to NO_WARNING. */ > > > > static inline void > > gimple_set_no_warning (gimple *stmt, bool no_warning) > > { > >

Re: [PATCH] match.pd: Don't create BIT_NOT_EXPRs for COMPLEX_TYPE [PR104675]

2022-02-25 Thread Richard Biener via Gcc-patches
On Fri, 25 Feb 2022, Jakub Jelinek wrote: > Hi! > > We don't support BIT_{AND,IOR,XOR,NOT}_EXPR on complex types, > &/|/^ are just rejected for them, and ~ is parsed as CONJ_EXPR. > So, we should avoid simplifications which turn valid complex type > expressions into something that will ICE during

[PATCH] i386: Use a new temp slot kind for splitter to floatdi2_i387_with_xmm [PR104674]

2022-02-25 Thread Jakub Jelinek via Gcc-patches
Hi! As mentioned in the PR, the following testcase is miscompiled for similar reasons as the already fixed PR78791 - we use SLOT_TEMP slots in various places during expansion and during expansion we can guarantee that the lifetime of those temporary slot doesn't overlap. But the following splitte

[PATCH] internal-fn: Call do_pending_stack_adjust in expand_SPACESHIP [PR104679]

2022-02-25 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase is miscompiled on ia32 at -O2, because when expand_SPACESHIP is called, we have pending stack adjustment from the foo call right before it. Now, ix86_expand_fp_spaceship uses emit_jump_insn several times but then emit_jump also several times. While emit_jump_insn doesn'

Re: [PATCH] internal-fn: Call do_pending_stack_adjust in expand_SPACESHIP [PR104679]

2022-02-25 Thread Richard Biener via Gcc-patches
On Fri, 25 Feb 2022, Jakub Jelinek wrote: > Hi! > > The following testcase is miscompiled on ia32 at -O2, because > when expand_SPACESHIP is called, we have pending stack adjustment > from the foo call right before it. > Now, ix86_expand_fp_spaceship uses emit_jump_insn several times > but then e

[committed] warning-control: Comment spelling fix

2022-02-25 Thread Jakub Jelinek via Gcc-patches
Hi! This fixes a spelling mistake I found while looking at warning-control implementation. Committed as obvious. 2022-02-25 Jakub Jelinek * warning-control.cc (get_nowarn_spec): Comment spelling fix. --- gcc/warning-control.cc.jj 2022-01-17 18:05:04.861306618 +0100 +++ gcc/warning

Re: [PATCH][V2][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Jakub Jelinek via Gcc-patches
On Fri, Feb 25, 2022 at 10:31:50AM +0100, Richard Biener wrote: > I think it's used as fallback for UNKNOWN_LOCATION, but if we "invent" > a creative location for the artificial stmt it will of course > affect other stmts/expressions using that location. > > > I think it will work. > > Yes, I thi

Re: [PATCH][V2][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Richard Biener via Gcc-patches
On Fri, 25 Feb 2022, Jakub Jelinek wrote: > On Fri, Feb 25, 2022 at 10:31:50AM +0100, Richard Biener wrote: > > I think it's used as fallback for UNKNOWN_LOCATION, but if we "invent" > > a creative location for the artificial stmt it will of course > > affect other stmts/expressions using that loc

Re: [PATCH][V2][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Jakub Jelinek via Gcc-patches
On Fri, Feb 25, 2022 at 11:12:13AM +0100, Richard Biener wrote: > On Fri, 25 Feb 2022, Jakub Jelinek wrote: > > > On Fri, Feb 25, 2022 at 10:31:50AM +0100, Richard Biener wrote: > > > I think it's used as fallback for UNKNOWN_LOCATION, but if we "invent" > > > a creative location for the artificia

Re: [PATCH] i386: Use a new temp slot kind for splitter to floatdi2_i387_with_xmm [PR104674]

2022-02-25 Thread Uros Bizjak via Gcc-patches
On Fri, Feb 25, 2022 at 10:33 AM Jakub Jelinek wrote: > > Hi! > > As mentioned in the PR, the following testcase is miscompiled for similar > reasons as the already fixed PR78791 - we use SLOT_TEMP slots in various > places during expansion and during expansion we can guarantee that the > lifetime

[PATCH] tree-optimization/103037 - PRE simplifying valueized expressions

2022-02-25 Thread Richard Biener via Gcc-patches
This fixes a long-standing issue in PRE where we track valueized expressions in our expression sets that we use for PHI translation, code insertion but also feed into match-and-simplify via vn_nary_simplify. But that's not what is expected from vn_nary_simplify or match-and-simplify which assume w

[PATCH] s390: Change SET rtx_cost handling.

2022-02-25 Thread Robin Dapp via Gcc-patches
Hi, the IF_THEN_ELSE detection currently prevents us from properly costing register-register moves which causes the lower-subreg pass to assume that a VR-VR move is as expensive as two GPR-GPR moves. This patch adds handling for SETs containing REGs as well as MEMs and is inspired by the aarch64

Re: [PATCH] tree-optimization/103037 - PRE simplifying valueized expressions

2022-02-25 Thread Richard Biener via Gcc-patches
On Fri, 25 Feb 2022, Richard Biener wrote: > This fixes a long-standing issue in PRE where we track valueized > expressions in our expression sets that we use for PHI translation, > code insertion but also feed into match-and-simplify via > vn_nary_simplify. But that's not what is expected from v

Re: [PATCH 2/2][middle-end/102276] Adding -Wtrivial-auto-var-init and update documentation.

2022-02-25 Thread Richard Biener via Gcc-patches
On Thu, 24 Feb 2022, Qing Zhao wrote: > > > > On Feb 24, 2022, at 4:16 AM, Richard Biener wrote: > > > > On Sat, 19 Feb 2022, Qing Zhao wrote: > > > >> Hi, > >> > >> This is the 2nd patch for fixing pr102276. > >> > >> Adding -Wtrivial-auto-var-init and update documentation. > >> > >> Addi

[committed] arc: Fail conditional move expand patterns

2022-02-25 Thread Claudiu Zissulescu via Gcc-patches
If the movcc comparison is not valid it triggers an assert in the current implementation. This behavior is not needed as we can FAIL the movcc expand pattern. gcc/ * config/arc/arc.cc (gen_compare_reg): Return NULL_RTX if the comparison is not valid. * config/arc/arc.md (m

Re: [committed] arc: Fail conditional move expand patterns

2022-02-25 Thread Robin Dapp via Gcc-patches
> If the movcc comparison is not valid it triggers an assert in the > current implementation. This behavior is not needed as we can FAIL > the movcc expand pattern. In case of a MODE_CC comparison you can also just return it as described here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104154 o

Re: [PATCH] Check if loading const from mem is faster

2022-02-25 Thread Jiufu Guo via Gcc-patches
Richard Biener writes: > On Fri, 25 Feb 2022, Jiufu Guo wrote: > >> Richard Biener writes: >> >> > On Thu, 24 Feb 2022, Jiufu Guo wrote: >> > >> >> Jiufu Guo via Gcc-patches writes: >> >> >> >> > Segher Boessenkool writes: >> >> > >> >> >> On Wed, Feb 23, 2022 at 02:02:59PM +0100, Richard Bi

Re: [PATCH] Check if loading const from mem is faster

2022-02-25 Thread Richard Biener via Gcc-patches
On Fri, 25 Feb 2022, Jiufu Guo wrote: > Richard Biener writes: > > > On Fri, 25 Feb 2022, Jiufu Guo wrote: > > > >> Richard Biener writes: > >> > >> > On Thu, 24 Feb 2022, Jiufu Guo wrote: > >> > > >> >> Jiufu Guo via Gcc-patches writes: > >> >> > >> >> > Segher Boessenkool writes: > >> >>

[PATCH][pushed] testsuite: Fix ASAN error [PR104687]

2022-02-25 Thread Martin Liška
Installed as obvious. Martin PR testsuite/104687 gcc/testsuite/ChangeLog: * gcc.dg/lto/20090717_0.c: Fix asan error. --- gcc/testsuite/gcc.dg/lto/20090717_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/lto/20090717_0.c b/gcc/tests

[PATCH] rtl-optimization/104686 - speed up conflict iteration

2022-02-25 Thread Richard Biener via Gcc-patches
The following replaces /* Skip bits that are zero. */ for (; (word & 1) == 0; word >>= 1) bit_num++; idioms in ira-int.h in the attempt to speedup update_conflict_hard_regno_costs which we're bound on in PR104686. The trick is to use ctz_hwi here which should pay off even

Re: [PATCH][V3][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Qing Zhao
> On Feb 25, 2022, at 2:38 AM, Richard Biener wrote: > > On Fri, 25 Feb 2022, Qing Zhao wrote: > >> Hi, Jakub and Richard: >> >> This is the 3rd version of the patch, the major change compared to the >> previous version are: >> >> 1. Add warning_enabled_at guard before “suppress_warning” >>

Re: [PATCH 2/2][middle-end/102276] Adding -Wtrivial-auto-var-init and update documentation.

2022-02-25 Thread Qing Zhao
> On Feb 25, 2022, at 6:43 AM, Richard Biener wrote: > > On Thu, 24 Feb 2022, Qing Zhao wrote: > >> >> >>> On Feb 24, 2022, at 4:16 AM, Richard Biener wrote: >>> >>> On Sat, 19 Feb 2022, Qing Zhao wrote: >>> Hi, This is the 2nd patch for fixing pr102276. Adding

Re: [PATCH] rtl-optimization/104686 - speed up conflict iteration

2022-02-25 Thread Vladimir Makarov via Gcc-patches
On 2022-02-25 09:14, Richard Biener wrote: The following replaces /* Skip bits that are zero. */ for (; (word & 1) == 0; word >>= 1) bit_num++; idioms in ira-int.h in the attempt to speedup update_conflict_hard_regno_costs which we're bound on in PR104686. The tric

Re: [PATCH] s390: Change SET rtx_cost handling.

2022-02-25 Thread Andreas Krebbel via Gcc-patches
On 2/25/22 12:38, Robin Dapp wrote: > Hi, > > the IF_THEN_ELSE detection currently prevents us from properly costing > register-register moves which causes the lower-subreg pass to assume > that a VR-VR move is as expensive as two GPR-GPR moves. > > This patch adds handling for SETs containing RE

[committed] testsuite: Move pr104540.C test to g++.target/i386/

2022-02-25 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 23, 2022 at 07:45:20PM -0300, Alexandre Oliva via Gcc-patches wrote: > PR middle-end/104540 > * g++.dg/PR104540.C: New. Both -mforce-drap and -mstackrealign options are x86 specific. Tested on x86_64-linux, i686-linux and powerpc64le-linux, committed to trunk. 2022-02-25

[PATCH] match.pd: Further complex simplification fixes [PR104675]

2022-02-25 Thread Jakub Jelinek via Gcc-patches
Hi! Mark mentioned in the PR further 2 simplifications that also ICE with complex types. For these, eventually (but IMO GCC 13 materials) we could support it for vector types if it would be uniform vector constants. Currently integer_pow2p is true only for INTEGER_CSTs and COMPLEX_CSTs and we can'

[committed] rs6000: Use rs6000_emit_move in movmisalign expander [PR104681]

2022-02-25 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs, because for some strange reason it decides to use movmisaligntf during expansion where the destination is MEM and source is CONST_DOUBLE. For normal mov expanders the rs6000 backend uses rs6000_emit_move to ensure that if one operand is a MEM, the other is a REG a

Re: [PATCH] match.pd: Further complex simplification fixes [PR104675]

2022-02-25 Thread Richard Biener via Gcc-patches
> Am 25.02.2022 um 18:58 schrieb Jakub Jelinek via Gcc-patches > : > > Hi! > > Mark mentioned in the PR further 2 simplifications that also ICE > with complex types. > For these, eventually (but IMO GCC 13 materials) we could support it > for vector types if it would be uniform vector consta

Re: [PATCH][V2][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Qing Zhao
Hi, After more study of all the discussion so far and the corresponding code for suppress_warning, I think the following suggestion Should be the best approach right now for this issue: > SET_EXPR_LOCATION (tmp_dst, UNKNOWN_LOCATION); > suppress_warning (tmp_dst, OPT_Wuninitialized)

[PATCH] c++: ICE with attribute on enumerator [PR104667]

2022-02-25 Thread Marek Polacek via Gcc-patches
When processing a template, the enumerators we build don't have a type yet. But is_late_template_attribute is not prepared to see a _DECL without a type, so we crash on enum tree_code code = TREE_CODE (type); (I found that we don't give the "is deprecated" warning for the enumerator 'f' in the

[PATCH] c++: Lost deprecated/unavailable attr in class tmpl [PR104682]

2022-02-25 Thread Marek Polacek via Gcc-patches
[ Most likely a GCC 13 patch, but I'm posting it now so that I don't lose it. ] When looking into the other PR I noticed that we fail to give a warning for a deprecated enumerator when the enum is in a class template. This only happens when the attribute doesn't have an argument. The reason is t

[PATCH][V4][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Qing Zhao
Hi, This is the 4th version based on the discussion so far. The major change is: > SET_EXPR_LOCATION (tmp_dst, UNKNOWN_LOCATION); > suppress_warning (tmp_dst, OPT_Wuninitialized); > with a comment explaing why we do that. The patch has been bootstrapped and regress tested on both x86 an