Re: [PATCH] match.pd: Add new division pattern [PR104992]

2022-07-28 Thread Richard Biener via Gcc-patches
On Wed, Jul 27, 2022 at 9:57 PM Sam Feifer wrote: > > >> _Complex int are strange beasts, I'd simply avoid the transform for them. >> > > I added to the match.pd rule to not simplify if the operands are complex. > There is now a test case for complex types to make sure they do not simplify. > I

Re: [GCC13][Patch][V2][1/2]Add a new option -fstrict-flex-array[=n] and attribute strict_flex_array(n) and use it in PR101836

2022-07-28 Thread Richard Biener via Gcc-patches
On Tue, 19 Jul 2022, Qing Zhao wrote: > From 3854004802b8e2f132ebf218fc35a632f5e80c6a Mon Sep 17 00:00:00 2001 > From: Qing Zhao > Date: Mon, 18 Jul 2022 17:04:12 + > Subject: [PATCH 1/2] Add a new option -fstrict-flex-array[=n] and new > attribute strict_flex_array > > Add the following new

Re: [GCC13][Patch][V2][2/2]Add a new option -fstrict-flex-array[=n] and attribute strict_flex_array(n) and use it in PR101836

2022-07-28 Thread Richard Biener via Gcc-patches
On Tue, 19 Jul 2022, Qing Zhao wrote: > From a09f39ded462611286a44d9e8273de8342673ba2 Mon Sep 17 00:00:00 2001 > From: Qing Zhao > Date: Mon, 18 Jul 2022 18:12:26 + > Subject: [PATCH 2/2] Use new flag DECL_NOT_FLEXARRAY in __builtin_object_size > [PR101836] > > Use new flag DECL_NOT_FLEXARRA

Re: [PATCH] testsuite: Add extra RISC-V options so that -fprefetch-loop-arrays works

2022-07-28 Thread Richard Biener via Gcc-patches
On Thu, 28 Jul 2022, jiawei wrote: > This patch adds the additional options on RISC-V target. > "-fprefetch-loop-arrays" option needs enable prefetch instruction, > for RISC-V that contained in "zicbop" extension. > Use "-march" with "zicbop" will enable this feature. OK. Note -fprefetch-loop-ar

Re: [PATCH] [PR83782] i386 PIE: avoid @GOTOFF for ifuncs and their aliases

2022-07-28 Thread Alexandre Oliva via Gcc-patches
On Jul 27, 2022, "H.J. Lu" wrote: > On Tue, Jul 26, 2022 at 10:14 PM Alexandre Oliva wrote: >> The use of @GOTOFF for locally-bound but externally-visible symbols >> (e.g. protected visibility) also breaks pointer identity if the >> canonical address ends up preempted by a PLT entry. > Here is

PING^3 [PATCH] rs6000: Handle unresolved overloaded builtin [PR105485]

2022-07-28 Thread Kewen.Lin via Gcc-patches
Hi, Gentle ping https://gcc.gnu.org/pipermail/gcc-patches/2022-May/594699.html BR, Kewen > >> on 2022/5/13 13:29, Kewen.Lin via Gcc-patches wrote: >>> Hi, >>> >>> PR105485 exposes that new builtin function framework doesn't handle >>> unresolved overloaded builtin function well. With new built

PING^3 [PATCH v3] rs6000: Fix the check of bif argument number [PR104482]

2022-07-28 Thread Kewen.Lin via Gcc-patches
Hi, Gentle ping https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595208.html BR, Kewen >>> Hi, >>> >>> As PR104482 shown, it's one regression about the handlings when >>> the argument number is more than the one of built-in function >>> prototype. The new bif support only catches the case tha

PING^1 [PATCH v4] rs6000: Adjust mov optabs for opaque modes [PR103353]

2022-07-28 Thread Kewen.Lin via Gcc-patches
Hi, Gentle ping https://gcc.gnu.org/pipermail/gcc-patches/2022-June/597286.html BR, Kewen on 2022/6/27 10:47, Kewen.Lin via Gcc-patches wrote: > Hi Segher! > > on 2022/6/25 00:49, Segher Boessenkool wrote: >> Hi! >> >> On Fri, Jun 24, 2022 at 09:03:59AM +0800, Kewen.Lin wrote: >>> on 2022/6/24

Re: Re: [PATCH] testsuite: Add extra RISC-V options so that -fprefetch-loop-arrays works

2022-07-28 Thread jiawei
> -原始邮件- > 发件人: "Richard Biener" > 发送时间: 2022-07-28 15:45:27 (星期四) > 收件人: jiawei > 抄送: gcc-patches@gcc.gnu.org, ja...@redhat.com, pal...@rivosinc.com, kito.ch...@gmail.com, jim.wilson@gmail.com, wuwei2...@iscas.ac.cn > 主题: Re: [PATCH] testsuite: Add extra RISC-V options so that -

Re: Rust frontend patches v1

2022-07-28 Thread Philip Herron
Thanks, for confirming David. I think it was too big in the end. I was trying to figure out how to actually split that up but it seems reasonable that I can split up the front-end patches into patches for each separate pass in the compiler seems like a reasonable approach for now. --Phil On Wed,

Re: [PATCH Rust front-end v1 2/4] Add Rust lang TargetHooks for i386 and x86_64

2022-07-28 Thread Jakub Jelinek via Gcc-patches
Note, the ChangeLog entry formatting is wrong and in various places the code formatting as well. In gcc/rust/ you can choose different formatting if there are strong reasons for that, but at least it should be consistent and ideally documented. None of the gcc/doc, gcc/config, gcc/config/i386 dir

Re: [PATCH Rust front-end v1 2/4] Add Rust lang TargetHooks for i386 and x86_64

2022-07-28 Thread Thomas Schwinge
Hi! On 2022-07-27T14:40:38+0100, "herron.philip--- via Gcc-patches" wrote: > This patch introduces a new set of interfaces to define the target info as > expected by the rust front-end. It takes advantage of the information > within gcc/config/target directories which gets called by the front-en

Re: [PATCH][wwwdocs] gcc-13: Add loongarch '-mexplicit-relocs' support

2022-07-28 Thread Xi Ruoyao via Gcc-patches
On Thu, 2022-07-28 at 10:59 +0800, Lulu Cheng wrote: > > The ASM_PREFERRED_EH_DATA_FORMAT macro before and after modification > > is > as follows: >  #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ >  -  (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_absptr) >  +  (((GLOBAL) ? DW_EH_PE_indire

Re: [PATCH Rust front-end v1 2/4] Add Rust lang TargetHooks for i386 and x86_64

2022-07-28 Thread Philip Herron
Hi Thomas, I think you are right here. There are parts in libstd/liballoc/libpanic which start to look for what CPU features are available iirc. Maintaining our patches here has been becoming difficult as of late, especially when it comes to libcore, which just cares about target pointer width and

Re: [PATCH Rust front-end v1 2/4] Add Rust lang TargetHooks for i386 and x86_64

2022-07-28 Thread Thomas Schwinge
Hi Phil! On 2022-07-28T11:51:37+0100, Philip Herron wrote: > I think you are right here. There are parts in > libstd/liballoc/libpanic which start to look for what CPU features are > available iirc. Aha, good. That -- once we get there ;-) -- shall then guide us on the target options we impleme

Re: [PATCH Rust front-end v1 2/4] Add Rust lang TargetHooks for i386 and x86_64

2022-07-28 Thread Philip Herron
That would be brilliant if you could do that! I can spend my time focused on splitting the front-end into patches. In the meantime, while you work on that, I will use your patch here to disable the target hook stuff so that the patches are buildable. --Phil On Thu, 28 Jul 2022 at 12:09, Thomas Sc

[PATCH V2]HIGH part of symbol ref is invalid for constant pool[PR106460]

2022-07-28 Thread Jiufu Guo via Gcc-patches
Hi, As the issue in PR106460, a rtx 'high:DI (symbol_ref:DI ("var_48")' is tried to store into constant pool. But actually, it indicates partial address, which to be forced to constant memory. In function rs6000_cannot_force_const_mem, we already return true for "HIGH with UNSPEC" rtx. For this

[PATCH] middle-end/106457 - improve array_at_struct_end_p for array objects

2022-07-28 Thread Richard Biener via Gcc-patches
Array references to array objects are never at struct end. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR middle-end/106457 * tree.cc (array_at_struct_end_p): Handle array objects specially. --- gcc/tree.cc | 4 1 file changed, 4 insertions(+) diff

Re: [PATCH] Add new target hook: simplify_modecc_const.

2022-07-28 Thread Richard Sandiford via Gcc-patches
Seems this thread has become a bit heated, so I'll try to proceed with caution :-) In the below, I'll use "X-mode const_int" to mean "a const_int that is known from context to represent an X-mode value". Of course, the const_int itself always stores VOIDmode. "Roger Sayle" writes: > Hi Segher,

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

2022-07-28 Thread Jiufu Guo via Gcc-patches
Segher Boessenkool writes: Thanks a lot for your review! > Hi! > > On Tue, Jul 19, 2022 at 10:30:54PM +0800, Jiufu Guo wrote: >> In patch https://gcc.gnu.org/pipermail/gcc-patches/2022-July/597712.html, >> test case was not added. After more check, a testcase is added for it. >> >> The high pa

Re: [PATCH][wwwdocs] gcc-13: Add loongarch '-mexplicit-relocs' support

2022-07-28 Thread Lulu Cheng
在 2022/7/28 下午6:41, Xi Ruoyao 写道: On Thu, 2022-07-28 at 10:59 +0800, Lulu Cheng wrote: The ASM_PREFERRED_EH_DATA_FORMAT macro before and after modification is as follows:  #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \  -  (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_absptr)  +  (

Re: [PING][PATCH v2] RISC-V: Split unordered FP comparisons into individual RTL insns

2022-07-28 Thread Maciej W. Rozycki
Hi Kito, > I am convinced that is OK for now, I agree modeling fflags would be a > rabbit hole, I tried to build a full GNU toolchain with my quick patch > and saw many ICE during build libraries, that definitely should be a > long-term optimization project. > > Although I'm thinking if we should

Re: [PATCH] doc: Clarify FENV_ACCESS pragma semantics WRT `-ftrapping-math'

2022-07-28 Thread Maciej W. Rozycki
On Wed, 27 Jul 2022, Joseph Myers wrote: > > gcc/ > > * doc/implement-c.texi (Floating point implementation): Mention > > `-fno-trapping-math' in the context of FENV_ACCESS pragma. > > * doc/invoke.texi (Optimize Options): Clarify FENV_ACCESS pragma > > implication in the descr

Re: [PATCH] libsanitizer: Cherry-pick 2bfb0fcb51510f22723c8cdfefe from upstream

2022-07-28 Thread Dimitrije Milosevic
Gentle ping, requiring someone to push the change. :) From: Dimitrije Milosevic Sent: Monday, July 25, 2022 8:55 AM To: gcc-patches@gcc.gnu.org Cc: Djordje Todorovic ; xry...@xry111.site Subject: [PATCH] libsanitizer: Cherry-pick 2bfb0fcb51510f22723c8cdfefe from upstream   2bfb0fcb51510f22723

Re: [PATCH] libsanitizer: Cherry-pick 2bfb0fcb51510f22723c8cdfefe from upstream

2022-07-28 Thread Martin Liška
On 7/28/22 15:43, Dimitrije Milosevic wrote: > |Gentle ping, requiring someone to push the change. :)| Sure, I can do that, but please attach output of (git format-patch) as an attachment to an email. The current email has a weird format I can directly apply with git am. Cheers, Martin

[PATCH] c++: Fix location for -Wunused-macros [PR66290]

2022-07-28 Thread Lewis Hyatt via Gcc-patches
In C++, since all tokens are lexed from libcpp up front, diagnostics generated by libcpp after lexing has completed do not get a valid location from libcpp (rather, libcpp thinks they all pertain to the end of the file.) This has long been addressed using the global variable "done_lexing", which t

Re: [PATCH] [PR83782] i386 PIE: avoid @GOTOFF for ifuncs and their aliases

2022-07-28 Thread H.J. Lu via Gcc-patches
On Thu, Jul 28, 2022 at 1:26 AM Alexandre Oliva wrote: > > On Jul 27, 2022, "H.J. Lu" wrote: > > > On Tue, Jul 26, 2022 at 10:14 PM Alexandre Oliva wrote: > > >> The use of @GOTOFF for locally-bound but externally-visible symbols > >> (e.g. protected visibility) also breaks pointer identity if t

[x86_64 PATCH] PR target/106450: Tweak timode_remove_non_convertible_regs.

2022-07-28 Thread Roger Sayle
This patch resolves PR target/106450, some more fall-out from more aggressive TImode scalar-to-vector (STV) optimizations. I continue to be caught out by how far TImode STV has diverged from DImode/SImode STV, and therefore requires additional (unexpected) tweaking. Many thanks to H.J. Lu for po

http://pdtlreviewboard.cambridge.arm.com/r/16099/

2022-07-28 Thread Richard Earnshaw via Gcc-patches
A SET operation that writes memory may have the same value as an earlier store but if the alias sets of the new and earlier store do not conflict then the set is not truly redundant. This can happen, for example, if objects of different types share a stack slot. To fix this we define a new fu

cselib: add function to check if SET is redundant [PR106187]

2022-07-28 Thread Richard Earnshaw via Gcc-patches
[resend with correct subject line] A SET operation that writes memory may have the same value as an earlier store but if the alias sets of the new and earlier store do not conflict then the set is not truly redundant. This can happen, for example, if objects of different types share a stack s

Re: [x86_64 PATCH] PR target/106450: Tweak timode_remove_non_convertible_regs.

2022-07-28 Thread H.J. Lu via Gcc-patches
On Thu, Jul 28, 2022 at 9:43 AM Roger Sayle wrote: > > > This patch resolves PR target/106450, some more fall-out from more > aggressive TImode scalar-to-vector (STV) optimizations. I continue > to be caught out by how far TImode STV has diverged from DImode/SImode > STV, and therefore requires a

[PATCH] libgo: Explicitly define SYS_timer_settime for 32-bit musl targets

2022-07-28 Thread soeren--- via Gcc-patches
From: Sören Tempel On 32-bit systems, musl only defines SYS_timer_settime32 not SYS_timer_settime. This causes the following compilation error: os_linux.go:251:30: error: reference to undefined name '_SYS_timer_settime' 251 | return int32(syscall(_SYS_timer_set

[PATCH] RISC-V/testsuite: Restrict remaining `fmin'/`fmax' tests to hard float

2022-07-28 Thread Maciej W. Rozycki
Complement commit 7915f6551343 ("RISC-V/testsuite: constraint some of tests to hard_float") and also restrict the remaining `fmin'/`fmax' tests to hard-float test configurations. gcc/testsuite/ * gcc.target/riscv/fmax-snan.c: Add `dg-require-effective-target hard_float'.

[PATCH] Fortran: detect blanks within literal constants in free-form mode [PR92805]

2022-07-28 Thread Harald Anlauf via Gcc-patches
Dear all, in free-form mode, blanks are significant, so they cannot appear in literal constants, especially not before or after the "_" that separates the literal and the kind specifier. The initial patch from Steve addressed numerical literals, which I completed by adjusting the parsing of strin

Re: [PATCH, v2] Fortran: fix invalid rank error in ASSOCIATED when rank is remapped [PR77652]

2022-07-28 Thread Mikael Morin
Hello, Le 27/07/2022 à 21:45, Harald Anlauf via Fortran a écrit : ok, I have thought about your comments in the review process, and played with the Cray compiler.  Attached is a refined version of the patch that now rejects in addition these cases for which there are no possible related pointer

[committed] jit: update docs to reflect .c to .cc renaming

2022-07-28 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-1878-gb8ce0c4361c267. gcc/jit/ChangeLog: * docs/internals/index.rst: Remove reference to ".c" extensions of source files. Signed-off-by: David Malcolm --- gcc/jit/docs/internals/index.rst | 3 +

[committed] analyzer: add CWE identifier URLs to docs

2022-07-28 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-1880-g9c60338061bf36. gcc/analyzer/ChangeLog: * sm-malloc.cc (free_of_non_heap::emit): Add comment about CWE. * sm-taint.cc (tainted_size::emit): Likewise. gcc/ChangeLog: * doc/invoke.tex

[committed] analyzer: new warning: -Wanalyzer-putenv-of-auto-var [PR105893]

2022-07-28 Thread David Malcolm via Gcc-patches
This patch implements a new -fanalyzer warning: -Wanalyzer-putenv-of-auto-var which complains about stack pointers passed to putenv(3) calls, as per SEI CERT C Coding Standard rule POS34-C ("Do not call putenv() with a pointer to an automatic variable as the argument"). For example, given: #inc

[committed] analyzer: expand the comment in region.h

2022-07-28 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-1879-g9cac6811cf0d6c. gcc/analyzer/ChangeLog: * region.h: Add notes to the comment describing the region class hierarchy. Signed-off-by: David Malcolm --- gcc/analyzer/region.h | 52 +++

[x86 PATCH] Support logical shifts by (some) integer constants in TImode STV.

2022-07-28 Thread Roger Sayle
This patch improves TImode STV by adding support for logical shifts by integer constants that are multiples of 8. For the test case: __int128 a, b; void foo() { a = b << 16; } on x86_64, gcc -O2 currently generates: movqb(%rip), %rax movqb+8(%rip), %rdx shldq

[PATCH v1] LoongArch: Define the macro ASM_PREFERRED_EH_DATA_FORMAT by checking the assembler's support for eh_frame encoding.

2022-07-28 Thread Lulu Cheng
The ASM_PREFERRED_EH_DATA_FORMAT macro before and after modification is as follows: #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ - (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_absptr) + (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) Use the following tests

Re: [PATCH v1] LoongArch: Define the macro ASM_PREFERRED_EH_DATA_FORMAT by checking the assembler's support for eh_frame encoding.

2022-07-28 Thread Xi Ruoyao via Gcc-patches
On Fri, 2022-07-29 at 10:43 +0800, Lulu Cheng wrote: > .eh_frame DW_EH_PE_pcrel encoding format is not supported by gas <= 2.39. > Check if the assembler support DW_EH_PE_PCREL encoding and define .eh_frame > encoding type. > > gcc/ChangeLog: > > * config.in: Regenerate. > * conf

Re: [PATCH v1] LoongArch: Define the macro ASM_PREFERRED_EH_DATA_FORMAT by checking the assembler's support for eh_frame encoding.

2022-07-28 Thread Lulu Cheng
在 2022/7/29 上午11:18, Xi Ruoyao 写道: On Fri, 2022-07-29 at 10:43 +0800, Lulu Cheng wrote: .eh_frame DW_EH_PE_pcrel encoding format is not supported by gas <= 2.39. Check if the assembler support DW_EH_PE_PCREL encoding and define .eh_frame encoding type. gcc/ChangeLog: * config.in: R

Re: [PATCH v1] LoongArch: Define the macro ASM_PREFERRED_EH_DATA_FORMAT by checking the assembler's support for eh_frame encoding.

2022-07-28 Thread Xi Ruoyao via Gcc-patches
On Fri, 2022-07-29 at 11:51 +0800, Lulu Cheng wrote: > > > gcc/ChangeLog: > > > > > > * config.in: Regenerate. > > > * config/loongarch/loongarch.h (ASM_PREFERRED_EH_DATA_FORMAT): > > > Select the value of the macro definition according to whether > > > HAVE_AS_EH_F

[PATCH v2] LoongArch: Define the macro ASM_PREFERRED_EH_DATA_FORMAT by checking the assembler's support for eh_frame encoding.

2022-07-28 Thread Lulu Cheng
The ASM_PREFERRED_EH_DATA_FORMAT macro before and after modification is as follows: #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ - (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_absptr) + (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) Use the following tests t

Re: [GCC13][Patch][V2][1/2]Add a new option -fstrict-flex-array[=n] and attribute strict_flex_array(n) and use it in PR101836

2022-07-28 Thread Kees Cook via Gcc-patches
On Thu, Jul 28, 2022 at 07:26:57AM +, Richard Biener wrote: > On Tue, 19 Jul 2022, Qing Zhao wrote: > > [...] > > +@cindex @code{strict_flex_array} variable attribute > > +@item strict_flex_array (@var{level}) > > +The @code{strict_flex_array} attribute should be attached to the trailing > > +a

[x86_64 PATCH] Add rotl64ti2_doubleword pattern to i386.md

2022-07-28 Thread Roger Sayle
This patch adds rot[lr]64ti2_doubleword patterns to the x86_64 backend, to move splitting of 128-bit TImode rotates by 64 bits after reload, matching what we now do for 64-bit DImode rotations by 32 bits with -m32. In theory moving when this rotation is split should have little influence on code

[PATCH v2 00/10] Introduce strub: machine-independent stack scrubbing

2022-07-28 Thread Alexandre Oliva via Gcc-patches
This patch adds the strub attribute for function and variable types, command-line options, passes and adjustments to implement it, documentation, and tests. Stack scrubbing is implemented in a machine-independent way: functions with strub enabled are modified so that they take an extra stack wat

Re: [GCC13][Patch][V2][1/2]Add a new option -fstrict-flex-array[=n] and attribute strict_flex_array(n) and use it in PR101836

2022-07-28 Thread Richard Biener via Gcc-patches
On Thu, 28 Jul 2022, Kees Cook wrote: > On Thu, Jul 28, 2022 at 07:26:57AM +, Richard Biener wrote: > > On Tue, 19 Jul 2022, Qing Zhao wrote: > > > [...] > > > +@cindex @code{strict_flex_array} variable attribute > > > +@item strict_flex_array (@var{level}) > > > +The @code{strict_flex_array}

[PATCH v2 01/10] Introduce strub: documentation, and new command-line options

2022-07-28 Thread Alexandre Oliva via Gcc-patches
Ada already has some strub documentation in gcc/ada/doc/gnat_rm/security_hardening_features.rst. for gcc/ChangeLog * common.opt (fstrub=*): New options. * doc/extend.texi (strub): New type attribute. (__builtin_stack_address): New function. (Stack Scrubbing): Ne

[PATCH v2 02/10] Introduce strub: torture tests for C and C++

2022-07-28 Thread Alexandre Oliva via Gcc-patches
for gcc/testsuite/ChangeLog * c-c++-common/torture/strub-callable1.c: New. * c-c++-common/torture/strub-callable2.c: New. * c-c++-common/torture/strub-const1.c: New. * c-c++-common/torture/strub-const2.c: New. * c-c++-common/torture/strub-const3.c: New.

[PATCH v2 03/10] Introduce strub: non-torture tests for C and C++

2022-07-28 Thread Alexandre Oliva via Gcc-patches
for gcc/testsuite/ChangeLog * c-c++-common/strub-O0.c: New. * c-c++-common/strub-O1.c: New. * c-c++-common/strub-O2.c: New. * c-c++-common/strub-O2fni.c: New. * c-c++-common/strub-O3.c: New. * c-c++-common/strub-O3fni.c: New. * c-c++-commo

[PATCH v2 04/10] Introduce strub: tests for C++ and Ada

2022-07-28 Thread Alexandre Oliva via Gcc-patches
for gcc/testsuite/ChangeLog * g++.dg/strub-run1.C: New. * g++.dg/torture/strub-init1.C: New. * g++.dg/torture/strub-init2.C: New. * g++.dg/torture/strub-init3.C: New. * gnat.dg/strub_attr.adb, gnat.dg/strub_attr.ads: New. * gnat.dg/strub_ind.adb,

[PATCH v2 05/10] Introduce strub: builtins and runtime

2022-07-28 Thread Alexandre Oliva via Gcc-patches
for gcc/ChangeLog * builtins.def (BUILT_IN_STACK_ADDRESS): New. (BUILT_IN___STRUB_ENTER): New. (BUILT_IN___STRUB_UPDATE): New. (BUILT_IN___STRUB_LEAVE): New. * builtins.cc: Include ipa-strub.h. (STACK_STOPS, STACK_UNSIGNED): Define. (expan

[PATCH v2 06/10] Introduce strub: attributes

2022-07-28 Thread Alexandre Oliva via Gcc-patches
Ada already has support for the strub attributes stubbed-out, and the front-end code already has support for them and their effects in the type system. for gcc/ChangeLog * attribs.cc: Include ipa-strub.h. (decl_attributes): Support applying attributes to function type,

[PATCH v2 07/10] Introduce strub: infrastructure interfaces and adjustments

2022-07-28 Thread Alexandre Oliva via Gcc-patches
Introduce the new strub passes, adjust other passes and front-end declaration for strub. for gcc/ChangeLog * Makefile.in (OBJS): Add ipa-strub.o. * ipa-inline.cc: Include ipa-strub.h. (can_inline_edge_p): Test strub_inlinable_to_p. * ipa-split.cc: Include ipa-st

[PATCH] Avoid vect_get_vector_types_for_stmt

2022-07-28 Thread Richard Biener via Gcc-patches
This replaces vect_get_vector_types_for_stmt with get_vectype_for_scalar_type in vect_recog_bool_pattern. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-vect-patterns.cc (vect_recog_bool_pattern): Use get_vectype_for_scalar_type instead of vect_get_vec

[PATCH v2 08/10] Introduce strub: strub modes

2022-07-28 Thread Alexandre Oliva via Gcc-patches
This initial fragment of ipa-strub.cc covers strub modes and their internal representation. for gcc/ChangeLog * ipa-strub.cc: New. diff --git a/gcc/ipa-strub.cc b/gcc/ipa-strub.cc new file mode 100644 index 0..d61b7e2e36e43 --- /dev/null +++ b/gcc/ipa-strub.cc @@ -0,0 +1,3

[PATCH] Use CONVERT_EXPR_CODE_P

2022-07-28 Thread Richard Biener via Gcc-patches
Bootstrapped on x86_64-unknown-linux-gnu, pushed. * gimple-ssa-warn-restrict.cc (builtin_memref::set_base_and_offset): Use CONVERT_EXPR_CODE_P. --- gcc/gimple-ssa-warn-restrict.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/gimple-ssa-warn-restrict.cc

[PATCH v2 09/10] Introduce strub: strubm (mode assignment) pass

2022-07-28 Thread Alexandre Oliva via Gcc-patches
This middle fragment of ipa-strub.cc covers strub mode selection and assignment logic, and most of the pass that performs that assignment. +/* Return TRUE iff NODE calls builtin va_start. */ + +static bool +calls_builtin_va_start_p (cgraph_node *node) +{ + bool result = false; + + for (cgraph

[PATCH v2 10/10] Introduce strub: strub pass

2022-07-28 Thread Alexandre Oliva via Gcc-patches
This final fragment of ipa-strub.cc adds the strub pass, that implements the needed function interface changes and adds calls to the strub builtins. +/* Define a pass to introduce strub transformations. */ +const pass_data pass_data_ipa_strub = { + SIMPLE_IPA_PASS, + "strub", + OPTGROUP_NONE

Re: [PATCH v2 00/10] Introduce strub: machine-independent stack scrubbing

2022-07-28 Thread Alexandre Oliva via Gcc-patches
On Jul 29, 2022, Alexandre Oliva wrote: > This patch adds the strub attribute for function and variable types, > command-line options, passes and adjustments to implement it, > documentation, and tests. The entire patch, and the patchlets used for testing, are available from the GCC git repo, br

Re: [PATCH] libsanitizer: Cherry-pick 2bfb0fcb51510f22723c8cdfefe from upstream

2022-07-28 Thread Dimitrije Milosevic
Thanks Martin! I'm sending out the output from git format-patch as an attachment to this email. From: Martin Liška Sent: Thursday, July 28, 2022 3:48 PM To: Dimitrije Milosevic ; gcc-patches@gcc.gnu.org Cc: ma...@embecosm.com ; Djordje Todorovic ; jos...@codesourcery.com Subject: Re: [PATC

RE: [PATCH] Some additional zero-extension related optimizations in simplify-rtx.

2022-07-28 Thread Roger Sayle
Hi Segher, > On Wed, Jul 27, 2022 at 02:42:25PM +0100, Roger Sayle wrote: > > This patch implements some additional zero-extension and > > sign-extension related optimizations in simplify-rtx.cc. The original > > motivation comes from PR rtl-optimization/71775, where in comment #2 > Andrew Pin