[PATCH v2] PR target/89828 Inernal compiler error on -fno-omit-frame-pointer

2023-03-15 Thread Yoshinori Sato
What about this? It no longer occurs for me. gcc/config/rx/ * rx.cc (add_pop_cfi_notes): Release the frame pointer if it is used. (rx_expand_prologue): Redesigned stack pointer and frame pointer update process. Signed-off-by: Yoshinori Sato --- gcc/config/rx/rx.cc | 50

Re: [PATCH v4 0/9] RISC-V: Add XThead* extension support

2023-03-15 Thread Philipp Tomsich
On Sun, 5 Mar 2023 at 11:19, Kito Cheng wrote: > LGTM :) > Applied to master, thanks! --Philipp. On Thu, Mar 2, 2023 at 4:36 PM Christoph Muellner > wrote: > > > > From: Christoph Müllner > > > > This series introduces support for the T-Head specific RISC-V ISA > extensions > > which are avai

Re: [wwwdocs] gcc-13: riscv: Document the T-Head CPU support

2023-03-15 Thread Philipp Tomsich
Applied to master, thanks! Philipp. On Sun, 5 Mar 2023 at 11:18, Kito Cheng wrote: > LGTM :) > > > On Fri, Feb 24, 2023 at 7:19 PM Christoph Muellner > wrote: > > > > From: Christoph Müllner > > > > This patch documents the new T-Head CPU support for RISC-V. > > > > Signed-off-by: Christoph Mü

Re: [PATCH] Fortran: rank checking with explicit-/assumed-size arrays and CLASS [PR58331]

2023-03-15 Thread Tobias Burnus
Hi Harald, On 14.03.23 20:38, Harald Anlauf wrote: The testcase covers only non-coarray cases, as playing with coarray variants hit pre-exisiting issues in gfortran that are very likely unrelated to the interface checks. I concur (but would not rule out additional interface issues). I consider

[PATCH] tree-optimization/109139 - fix .DEFERRED_INIT removal

2023-03-15 Thread Richard Biener via Gcc-patches
The following make sure to strip MEMs when looking for unused decls on the LHS of .DEFERRED_INIT. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/109139 * tree-ssa-live.cc (remove_unused_locals): Look at the base address for unused decls o

Pushed: [PATCH] builtins: Move the character difference into result instead of reassigning result [PR109086]

2023-03-15 Thread Xi Ruoyao via Gcc-patches
Already approved in bugzilla and bootstrapped on x86_64-linux-gnu. Pushed. expand_simple_binop() is allowed to allocate a new pseudo-register and return it, instead of forcing the result into the provided pseudo-register. This can cause a problem when we expand the unrolled loop for __builtin_str

[PATCH v4] gcov: Fix "do-while" structure in case statement leads to incorrect code coverage [PR93680]

2023-03-15 Thread Xionghu Luo via Gcc-patches
On 2023/3/9 20:02, Richard Biener wrote: On Wed, 8 Mar 2023, Xionghu Luo wrote: On 2023/3/7 19:25, Richard Biener wrote: It would be nice to avoid creating blocks / preserving labels we'll immediately remove again. For that we do need some analysis before creating basic-blocks that determ

[PATCH 1/2] Avoid random stmt order result in pass_waccess::use_after_inval_p

2023-03-15 Thread Richard Biener via Gcc-patches
use_after_inval_p uses stmt UIDs to speed up repeated dominance checks within a basic-block but it fails to assign UIDs to PHIs which means compares with PHIs in the same block get a random result. The following factors renumber_gimple_stmt_uids to expose a new renumber_gimple_stmt_uids_in_block w

[PATCH 2/2] tree-optimization/109123 - run -Wuse-afer-free only early

2023-03-15 Thread Richard Biener via Gcc-patches
The following switches the -Wuse-after-free diagnostics from emitted during the late access warning passes to the early access warning passes to make sure we run before passes performing code motion run which are the source of a lot of false positives on use-after-free not involving memory operatio

Re: [PATCH 1/2] Avoid random stmt order result in pass_waccess::use_after_inval_p

2023-03-15 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 15, 2023 at 10:48:32AM +, Richard Biener wrote: > use_after_inval_p uses stmt UIDs to speed up repeated dominance > checks within a basic-block but it fails to assign UIDs to PHIs > which means compares with PHIs in the same block get a random > result. > > The following factors re

Re: [PATCH 2/2] tree-optimization/109123 - run -Wuse-afer-free only early

2023-03-15 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 15, 2023 at 10:49:19AM +, Richard Biener via Gcc-patches wrote: > The following switches the -Wuse-after-free diagnostics from emitted > during the late access warning passes to the early access warning > passes to make sure we run before passes performing code motion run > which ar

Re: [PATCH 2/2] tree-optimization/109123 - run -Wuse-afer-free only early

2023-03-15 Thread Richard Biener via Gcc-patches
On Wed, 15 Mar 2023, Jakub Jelinek wrote: > On Wed, Mar 15, 2023 at 10:49:19AM +, Richard Biener via Gcc-patches > wrote: > > The following switches the -Wuse-after-free diagnostics from emitted > > during the late access warning passes to the early access warning > > passes to make sure we r

Re: [PATCH 1/2] Avoid random stmt order result in pass_waccess::use_after_inval_p

2023-03-15 Thread Richard Biener via Gcc-patches
On Wed, 15 Mar 2023, Jakub Jelinek wrote: > On Wed, Mar 15, 2023 at 10:48:32AM +, Richard Biener wrote: > > use_after_inval_p uses stmt UIDs to speed up repeated dominance > > checks within a basic-block but it fails to assign UIDs to PHIs > > which means compares with PHIs in the same block g

[PATCH] riscv: thead: Add sign/zero extension support for th.ext and th.extu

2023-03-15 Thread Christoph Muellner
From: Christoph Müllner The current support of the bitfield-extraction instructions th.ext and th.extu (XTheadBb extension) only covers sign_extract and zero_extract. This patch add support for sign_extend and zero_extend to avoid any shifts for sign or zero extensions. gcc/ChangeLog: *

[pushed] c++: injected class name as default ttp arg [PR58538]

2023-03-15 Thread Jason Merrill via Gcc-patches
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- This function needs to handle this case like convert_template_argument. PR c++/58538 gcc/cp/ChangeLog: * semantics.cc (check_template_template_default_arg): Check maybe_get_template_decl_from_type_decl. gcc/testsu

[pushed 1/2] c++: coerce_template_template_parms interface tweak

2023-03-15 Thread Jason Merrill via Gcc-patches
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- This should have no semantic effect, but is a prerequisite for the PR108179 fix to follow. PR c++/108179 gcc/cp/ChangeLog: * pt.cc (coerce_template_template_parms): Take the arg and parm templates directly.

[PATCH 2/2] c++: passing one ttp to another [PR108179]

2023-03-15 Thread Jason Merrill via Gcc-patches
I kept trying to improve our choice of how many levels of outer_args to add, when really the problem was that outer_args are for PARM and for this reverse deduction we should be adding the outer arguments for ARG. I spent quite a while trying to get DECL_CONTEXT set consistently on template templa

Re: [PATCH 1/2] Avoid random stmt order result in pass_waccess::use_after_inval_p

2023-03-15 Thread Richard Biener via Gcc-patches
On Wed, 15 Mar 2023, Richard Biener wrote: > On Wed, 15 Mar 2023, Jakub Jelinek wrote: > > > On Wed, Mar 15, 2023 at 10:48:32AM +, Richard Biener wrote: > > > use_after_inval_p uses stmt UIDs to speed up repeated dominance > > > checks within a basic-block but it fails to assign UIDs to PHIs

Re: [PATCH 1/2] Avoid random stmt order result in pass_waccess::use_after_inval_p

2023-03-15 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 15, 2023 at 01:07:56PM +, Richard Biener wrote: > The following patch was bootstrapped and tested on > x86_64-unknown-linux-gnu. It now doesn't regress anything in the > testsuite but on its own it has the chance to (by luck maybe > avoided previosuly due to the PHI compare bug) i

Re: [PATCH] RISC-V: Fix reg order of RVV registers.

2023-03-15 Thread Kito Cheng via Gcc-patches
Hi Jeff: We promised only to commit intrinsic implication and bug fix this moment, so yes, those optimization and non-bug fix pattern turning include this will all defer to gcc-14. On Wed, Mar 15, 2023 at 2:02 AM Jeff Law via Gcc-patches wrote: > > > > On 3/13/23 02:19, juzhe.zh...@rivai.ai wrot

[PATCH] Avoid duplicate diagnostic in g++.dg/warn/Wuse-after-free3.C

2023-03-15 Thread Richard Biener via Gcc-patches
We are diagnosing operator delete (this_3(D)); A::f (this_3(D)); *this_3(D) ={v} CLOBBER; where the CLOBBER appears at the end of the DTOR for C++11 and later. The following avoids this by simply never diagnosing clobbers as use-after-free. Bootstrap and regtest running on x86_64-unknown-l

[Patch] OpenMP: Add omp_in_explicit_task to omp_runtime_api_call

2023-03-15 Thread Tobias Burnus
When adding a new OpenMP routine, also omp_runtime_api_call needs to be adapted - to get proper error like: error: OpenMP runtime API call ‘omp_in_explicit_task’ in a region with ‘order(concurrent)’ clause OK for mainline? Tobias PS: This routine was added in commit r13-3258-g0ec4e93fb9fa5e9

Re: [Patch] OpenMP: Add omp_in_explicit_task to omp_runtime_api_call

2023-03-15 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 15, 2023 at 03:24:04PM +0100, Tobias Burnus wrote: > When adding a new OpenMP routine, also omp_runtime_api_call needs > to be adapted - to get proper error like: > > error: OpenMP runtime API call ‘omp_in_explicit_task’ in a region with > ‘order(concurrent)’ clause > > OK for mainli

Ping: [PATCH resend] Make -Wuse-after-free=3 the default one in -Wall

2023-03-15 Thread Alejandro Colomar via Gcc-patches
Ping On 2/18/23 00:05, Alejandro Colomar wrote: > Link: > > Link: > Cc: Andreas Schwab > Cc: David Malcolm > Cc: Florian Weimer > Cc: I

[PATCH v2] c++: ICE with constexpr lambda [PR107280]

2023-03-15 Thread Marek Polacek via Gcc-patches
On Fri, Mar 10, 2023 at 01:47:46PM -0500, Jason Merrill wrote: > On 3/10/23 11:17, Marek Polacek wrote: > > We crash here since r10-3661, the store_init_value hunk in particular. > > Before, we called cp_fully_fold_init, so e.g. > > > >{.str=VIEW_CONVERT_EXPR("")} > > > > was folded into > >

Re: [PATCH 2/2] tree-optimization/109123 - run -Wuse-afer-free only early

2023-03-15 Thread Richard Biener via Gcc-patches
On Wed, 15 Mar 2023, Richard Biener wrote: > On Wed, 15 Mar 2023, Jakub Jelinek wrote: > > > On Wed, Mar 15, 2023 at 10:49:19AM +, Richard Biener via Gcc-patches > > wrote: > > > The following switches the -Wuse-after-free diagnostics from emitted > > > during the late access warning passes

Re: [V4][PATCH 2/2] Update documentation to clarify a GCC extension

2023-03-15 Thread Qing Zhao via Gcc-patches
Hi, Sandra, Thanks a lot for your review and comment. Yes, the issue you raised in below was a really tough one that I didn’t feel very comfortable to handle it well… This documentation change is mainly to fix: PR77650 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77650). The real user case

Re: [PATCH, OpenACC, v3] Non-contiguous array support for OpenACC data clauses

2023-03-15 Thread Thomas Schwinge
Hi Chung-Lin! On 2019-11-26T22:49:21+0800, Chung-Lin Tang wrote: > this is a reorg of the last non-contiguous arrays patch. (Sorry, this is still not the master branch integration email...) I noticed the following while working on something else: > --- libgomp/oacc-parallel.c (revision 2786

Re: [PATCH 2/2] tree-optimization/109123 - run -Wuse-afer-free only early

2023-03-15 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 15, 2023 at 02:39:43PM +, Richard Biener via Gcc-patches wrote: > I've tested and most of the -Wuse-after-free testcases work with -Og > before and after the change (unfortunately adding -Og via RUNTESTFLAGS > doesn't work since explicit -O2 in the testcases overrides that). > > We

Re: Ping: [PATCH resend] Make -Wuse-after-free=3 the default one in -Wall

2023-03-15 Thread Richard Biener via Gcc-patches
On Wed, Mar 15, 2023 at 3:30 PM Alejandro Colomar via Gcc-patches wrote: > > Ping -Wuse-after-free=3 was explicitly added to cover cases with a high false-positive rate. If you want to make that the default then instead merge the equality compare case back to the =2 case. But as I said elsewher

Re: Ping: [PATCH resend] Make -Wuse-after-free=3 the default one in -Wall

2023-03-15 Thread Alejandro Colomar via Gcc-patches
Hi Richard, On 3/15/23 15:52, Richard Biener wrote: > On Wed, Mar 15, 2023 at 3:30 PM Alejandro Colomar via Gcc-patches > wrote: >> >> Ping > > -Wuse-after-free=3 was explicitly added to cover cases with a high > false-positive rate. If you want to > make that the default then instead merge the

Now gcc-13: [Fwd: [PATCH] gcc-12: Re-enable split-stack support for GNU/Hurd.]

2023-03-15 Thread Svante Signell via Gcc-patches
Package: gcc-snapshot Version: 1:20230315-1 Severity: important Tags: patch User: debian-h...@lists.debian.org Usertags: hurd Affects: gcc-snapshot X-Debbugs-CC: debian-h...@lists.debian.org Hello, seems like the patch gcc_config_gnu.h.diff, in debian gcc-12 named: pr104290-followup.diff was lost

Re: [PATCH v2] c++: ICE with constexpr lambda [PR107280]

2023-03-15 Thread Jason Merrill via Gcc-patches
On 3/15/23 10:37, Marek Polacek wrote: On Fri, Mar 10, 2023 at 01:47:46PM -0500, Jason Merrill wrote: On 3/10/23 11:17, Marek Polacek wrote: We crash here since r10-3661, the store_init_value hunk in particular. Before, we called cp_fully_fold_init, so e.g. {.str=VIEW_CONVERT_EXPR("")} wa

Re: [PATCH v2] c++: ICE with constexpr lambda [PR107280]

2023-03-15 Thread Marek Polacek via Gcc-patches
On Wed, Mar 15, 2023 at 12:48:27PM -0400, Jason Merrill wrote: > On 3/15/23 10:37, Marek Polacek wrote: > > On Fri, Mar 10, 2023 at 01:47:46PM -0500, Jason Merrill wrote: > > > On 3/10/23 11:17, Marek Polacek wrote: > > > > We crash here since r10-3661, the store_init_value hunk in particular. > >

[PATCH v2 1/2] libstdc++: use copy_file_range, improve sendfile in filesystem::copy_file

2023-03-15 Thread Jannik Glückert via Gcc-patches
This iteration improves error handling for copy_file_range, particularly around undocumented error codes in earlier kernel versions. Additionally this fixes the userspace copy fallback to handle zero-length files such as in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108178. Lastly, the case "src

[PATCH v2 2/2] libstdc++: use copy_file_range, improve sendfile in filesystem::copy_file

2023-03-15 Thread Jannik Glückert via Gcc-patches
From c028a0072c7573cfac90289b3606ba19cb8272a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20Gl=C3=BCckert?= Date: Wed, 8 Mar 2023 19:37:43 +0100 Subject: [PATCH 2/2] libstdc++: use copy_file_range MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit copy_

Re: [PATCH] Fortran: rank checking with explicit-/assumed-size arrays and CLASS [PR58331]

2023-03-15 Thread Harald Anlauf via Gcc-patches
Hi Tobias, Am 15.03.23 um 10:10 schrieb Tobias Burnus: Hi Harald, On 14.03.23 20:38, Harald Anlauf wrote: The testcase covers only non-coarray cases, as playing with coarray variants hit pre-exisiting issues in gfortran that are very likely unrelated to the interface checks. I concur (but wou

[PATCH] i386: Fix blend vector permutation for 8-byte modes

2023-03-15 Thread Uros Bizjak via Gcc-patches
8-byte modes should be processed only for TARGET_MMX_WITH_SSE. Handle V2SFmode and fix V2HImode handling. The resulting BLEND instructions are always faster than MOVSS/MOVSD, so prioritize them w.r.t MOVSS/MOVSD for TARGET_SSE4_1. gcc/ChangeLog: * config/i386/i386-expand.cc (expand_vec_perm_b

[PATCH] compiler built in is_scalar, use built-in is_scalar in libstdc++ std::is_scalar

2023-03-15 Thread Berke Yavas via Gcc-patches
From: Berke Signed-off-by: Berke Yavas --- gcc/cp/constraint.cc| 3 +++ gcc/cp/cp-trait.def | 1 + gcc/cp/cxx-pretty-print.cc | 3 ++- gcc/cp/parser.cc| 1 + gcc/cp/semantics.cc

[PATCH] c++, libstdc++: new compiler built in is_scalar, use built-in is_scalar in libstdc++ std::is_scalar

2023-03-15 Thread Berke Yavas via Gcc-patches
Have implemented a new compiler built-in for the scalar types(is_scalar). Changed the libstdc++ std::is_scalar implementation to use this new compiler built_in when available. tested on x86_64-redhat-linux. Compared test results and configured with --enable-bootstrap gcc/cp/ChangeLog:

Re: Now gcc-13: [Fwd: [PATCH] gcc-12: Re-enable split-stack support for GNU/Hurd.]

2023-03-15 Thread Ian Lance Taylor via Gcc-patches
On Wed, Mar 15, 2023 at 9:14 AM Svante Signell wrote: > > Package: gcc-snapshot > Version: 1:20230315-1 > Severity: important > Tags: patch > User: debian-h...@lists.debian.org > Usertags: hurd > Affects: gcc-snapshot > X-Debbugs-CC: debian-h...@lists.debian.org >

Re: [PATCH v2] PR target/89828 Inernal compiler error on -fno-omit-frame-pointer

2023-03-15 Thread Jeff Law via Gcc-patches
On 3/15/23 01:51, Yoshinori Sato wrote: What about this? It no longer occurs for me. gcc/config/rx/ * rx.cc (add_pop_cfi_notes): Release the frame pointer if it is used. (rx_expand_prologue): Redesigned stack pointer and frame pointer update process. That fixes the problems b

[pushed] diagnostics: attempt to capture crash info in SARIF output [PR109097]

2023-03-15 Thread David Malcolm via Gcc-patches
As noted in PR analyzer/109097, if an internal compiler error occurs when -fdiagnostics-format=sarif-file is specified, we currently fail to write out a .sarif file, and the output to stderr doesn't contain "internal compiler error" or "Internal compiler error"; just the backtrace if we're lucky, a

[pushed] c++: co_await and initializer_list [PR103871]

2023-03-15 Thread Jason Merrill via Gcc-patches
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- When flatten_await_stmt processes the backing array for an initializer_list, we call cp_build_modify_expr to initialize the promoted variable from the TARGET_EXPR; that needs to be accepted. PR c++/103871 PR c++/98056 gcc/c

Re: [wwwdocs] document modula-2 in gcc-13/changes.html (and index.html)

2023-03-15 Thread Gerald Pfeifer
The patch is now in, alas all the GNU M2 manual links now point to non-existant locations. Does maintainer-scripts/update_web_docs_git require an update to cover Modula-2 and actually build the manual we are now linking to (or rather trying to)? Gerald

Re: [PATCH] c++: noexcept and copy elision [PR109030]

2023-03-15 Thread Patrick Palka via Gcc-patches
On Thu, 9 Mar 2023, Jason Merrill wrote: > On 3/9/23 14:32, Patrick Palka wrote: > > On Mon, 6 Mar 2023, Marek Polacek via Gcc-patches wrote: > > > > > When processing a noexcept, constructors aren't elided: build_over_call > > > has > > >/* It's unsafe to elide the constructor when handling

[pushed] maintainer-scripts: Abstract BUGURL in update_web_docs_git

2023-03-15 Thread Gerald Pfeifer
The URL where to report bugs is hard coded in two places; abstract that into one variable, defined up front. maintainer-scripts/ChangeLog: * update_web_docs_git (BUGURL): Introduce and use throughout. --- maintainer-scripts/update_web_docs_git | 5 +++-- 1 file changed, 3 insertions(+),

[PATCH] [testsuite] test for weak_undefined support and add options

2023-03-15 Thread Alexandre Oliva via Gcc-patches
A number of tests that depend on weak undefined symbols fail to require that support, and arrange to skip some targets and add special options to others on a test-by-test basis. Fix this by stating the requirement explicitly, and adding a proc to return any required options. Others rely on weak

[PATCH] [testsuite] fix array element count

2023-03-15 Thread Alexandre Oliva via Gcc-patches
This test is similar to pr103116-1.c, but instead of writing to 4*COUNT elements of x, it writes to 8*COUNT elements, but the definition of x seems to have been adjusted along with the loop. Fix the array size so that it doesn't scribble over unrelated statically-allocated objects. Regstrapped

[PATCH RFC] c++: co_await and move-only type [PR105406]

2023-03-15 Thread Jason Merrill via Gcc-patches
Tested x86_64-pc-linux-gnu. As with the array issue, I know you have WIP to deal with larger issues, but this seems like a reasonable local fix. Does it make sense to you? -- 8< -- Here we were building a temporary MoveOnlyAwaitable to hold the result of evaluating 'o', but since 'o' is an lval

Re: [wwwdocs] document modula-2 in gcc-13/changes.html (and index.html)

2023-03-15 Thread Gaius Mulley via Gcc-patches
Gerald Pfeifer writes: > The patch is now in, alas all the GNU M2 manual links now point to > non-existant locations. > > Does maintainer-scripts/update_web_docs_git require an update to cover > Modula-2 and actually build the manual we are now linking to (or rather > trying to)? > > Gerald Ap

[PATCH] rs6000: suboptimal code for returning bool value on target ppc

2023-03-15 Thread Ajit Agarwal via Gcc-patches
Hello All: This patch eliminates unnecessary zero extension instruction from power generated assembly. Bootstrapped and regtested on powerpc64-linux-gnu. Thanks & Regards Ajit rs6000: suboptimal code for returning bool value on target ppc. New pass to eliminate unnecessary zer

[PATCH-1, rs6000] Put constant into pseudo at expand when it needs two insns [PR86106]

2023-03-15 Thread HAO CHEN GUI via Gcc-patches
Hi, Currently, rs6000 directly expands to 2 insns if an integer constant is the second operand and it needs two insns. For example, addi/addis and ori/oris. It may not benefit when the constant is used for more than 2 times in an extended basic block, just like the case in PR shows. One possib

[PATCH-2, rs6000] Put constant into pseudo at expand when it needs two insns [PR86106]

2023-03-15 Thread HAO CHEN GUI via Gcc-patches
Hi, The background and motivation of the patch are listed in the note of PATCH-1. This patch changes the expander of ior/xor and force constant to a pseudo when it needs 2 insn. Also a combine and split pattern for ior/xor is defined. rtx_cost of ior insn is adjusted as now it may have 2 insns

Re: [PATCH] [testsuite] test for weak_undefined support and add options

2023-03-15 Thread Alexandre Oliva via Gcc-patches
On Mar 15, 2023, Alexandre Oliva wrote: > Regstrapped on ppc64-linux-gnu. Also tested (with gcc-12) on multiple > *-vxworks7r2 targets (arm, aarch64, ppc64, x86, x86_64). Ok to install? Further testing revealed a problem in my attempted use of lappend in aapcs64.exp, in the previous version of