[PATCH] tree-optimization/108523 - testcase for the bug

2023-01-25 Thread Richard Biener via Gcc-patches
This adds a reduced testcase for the PR. Tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/108523 * gcc.dg/torture/pr108523.c: New testcase. --- gcc/testsuite/gcc.dg/torture/pr108523.c | 16 1 file changed, 16 insertions(+) create mode 100644 gcc/

Re: [PATCH] tree-optimization/108522 Use component_ref_field_offset

2023-01-25 Thread Richard Biener via Gcc-patches
On Thu, Jan 26, 2023 at 4:32 AM Siddhesh Poyarekar wrote: > > Instead of using TREE_OPERAND (expr, 2) directly, use > component_ref_field_offset instead, which does scaling for us. The > function also substitutes PLACEHOLDER_EXPRs, which is probably what we > want anyway but I'm not sure if it's

Re: [PATCH] PR tree-optimization/108447 - Do not try to logical fold floating point relations.

2023-01-25 Thread Richard Biener via Gcc-patches
On Thu, Jan 26, 2023 at 8:09 AM Richard Biener wrote: > > On Wed, Jan 25, 2023 at 7:05 PM Andrew MacLeod wrote: > > > > This boils down to a single place where we are trying to do things with > > relations in ranger that are simply not safe when we need to honor NANs. > > > > I think we can avoid

Re: [PATCH] PR tree-optimization/108447 - Do not try to logical fold floating point relations.

2023-01-25 Thread Richard Biener via Gcc-patches
On Wed, Jan 25, 2023 at 7:05 PM Andrew MacLeod wrote: > > This boils down to a single place where we are trying to do things with > relations in ranger that are simply not safe when we need to honor NANs. > > I think we can avoid all the other shuffling of relations, and simply > not perform this

[PATCH] tree-optimization/108522 Use component_ref_field_offset

2023-01-25 Thread Siddhesh Poyarekar
Instead of using TREE_OPERAND (expr, 2) directly, use component_ref_field_offset instead, which does scaling for us. The function also substitutes PLACEHOLDER_EXPRs, which is probably what we want anyway but I'm not sure if it's relevant for tree-object-size. gcc/ChangeLog: PR tree-optim

Re: [PATCH] opts: SANITIZE_ADDRESS wrongly cleared [PR108543]

2023-01-25 Thread Andrew Pinski via Gcc-patches
On Wed, Jan 25, 2023 at 3:26 PM Marek Polacek via Gcc-patches wrote: > > Here we crash on a null fndecl ultimately because we haven't defined > the built-ins described in sanitizer.def. So > builtin_decl_explicit (BUILT_IN_ASAN_POINTER_SUBTRACT); > returns NULL_TREE, causing an ICE later. > > DEF

Re: [PATCH 2/2] Add VREL_OTHER for FP unsupported relations.

2023-01-25 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 25, 2023 at 06:23:25PM -0500, Andrew MacLeod wrote: > > > --- a/gcc/gimple-range-fold.cc > > > +++ b/gcc/gimple-range-fold.cc > > > @@ -1039,6 +1039,9 @@ fold_using_range::relation_fold_and_or (irange& > > > lhs_range, gimple *s, > > >    if (!ssa1_dep1 || !ssa1_dep2 || !ssa2_dep1 || !

[PATCH] opts: SANITIZE_ADDRESS wrongly cleared [PR108543]

2023-01-25 Thread Marek Polacek via Gcc-patches
Here we crash on a null fndecl ultimately because we haven't defined the built-ins described in sanitizer.def. So builtin_decl_explicit (BUILT_IN_ASAN_POINTER_SUBTRACT); returns NULL_TREE, causing an ICE later. DEF_SANITIZER_BUILTIN only actually defines the built-ins when flag_sanitize has SANIT

Re: [PATCH 2/2] Add VREL_OTHER for FP unsupported relations.

2023-01-25 Thread Andrew MacLeod via Gcc-patches
On 1/25/23 17:35, Jakub Jelinek wrote: On Wed, Jan 25, 2023 at 11:12:11AM -0500, Andrew MacLeod via Gcc-patches wrote: In GCC13, I don't think there are any uses of the relation oracle outside of ranger and range-ops. So, given that, perhaps the simplest thing to do is bail on all this change

Re: [PATCH 2/2] Add VREL_OTHER for FP unsupported relations.

2023-01-25 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 25, 2023 at 11:12:11AM -0500, Andrew MacLeod via Gcc-patches wrote: > In GCC13, I don't think there are any uses of the relation oracle outside of > ranger and range-ops. > > So, given that, perhaps the simplest thing to do is bail on all this change, > and instead simply do the follow

Re: [PATCH] Fortran: fix ICE in check_host_association [PR108544]

2023-01-25 Thread Steve Kargl via Gcc-patches
On Wed, Jan 25, 2023 at 10:59:22PM +0100, Harald Anlauf via Fortran wrote: > Dear all, > > the attached patch fixes two issues: first it addresses a NULL pointer > dereference on invalid input, triggered by the provided testcase. > > Second, while analyzing the context of the affected code, I loo

[PATCH] Fortran: fix ICE in check_host_association [PR108544]

2023-01-25 Thread Harald Anlauf via Gcc-patches
Dear all, the attached patch fixes two issues: first it addresses a NULL pointer dereference on invalid input, triggered by the provided testcase. Second, while analyzing the context of the affected code, I looked into the testcase for PR96102, and by varying it slightly, i.e. replacing functions

[PATCH v5 2/5] libcpp: add a function to determine UTF-8 validity of a C string

2023-01-25 Thread Ben Boeckel via Gcc-patches
This simplifies the interface for other UTF-8 validity detections when a simple "yes" or "no" answer is sufficient. libcpp/ * charset.cc: Add `_cpp_valid_utf8_str` which determines whether a C string is valid UTF-8 or not. * internal.h: Add prototype for `_cpp_valid_utf8_s

[PATCH v5 5/5] c++modules: report module mapper files as a dependency

2023-01-25 Thread Ben Boeckel via Gcc-patches
It affects the build, and if used as a static file, can reliably be tracked using the `-MF` mechanism. gcc/cp/: * mapper-client.cc, mapper-client.h (open_module_client): Accept dependency tracking and track module mapper files as dependencies. * module.cc (make_map

[PATCH v5 4/5] c++modules: report imported CMI files as dependencies

2023-01-25 Thread Ben Boeckel via Gcc-patches
They affect the build, so report them via `-MF` mechanisms. gcc/cp/ * module.cc (do_import): Report imported CMI files as dependencies. Signed-off-by: Ben Boeckel --- gcc/cp/module.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc inde

[PATCH v5 3/5] p1689r5: initial support

2023-01-25 Thread Ben Boeckel via Gcc-patches
This patch implements support for [P1689R5][] to communicate to a build system the C++20 module dependencies to build systems so that they may build `.gcm` files in the proper order. Support is communicated through the following three new flags: - `-fdeps-format=` specifies the format for the out

[PATCH v5 1/5] libcpp: reject codepoints above 0x10FFFF

2023-01-25 Thread Ben Boeckel via Gcc-patches
Unicode does not support such values because they are unrepresentable in UTF-16. libcpp/ * charset.cc: Reject encodings of codepoints above 0x10. UTF-16 does not support such codepoints and therefore all Unicode rejects such values. Signed-off-by: Ben Boeckel --- li

[PATCH v5 0/5] P1689R5 support

2023-01-25 Thread Ben Boeckel via Gcc-patches
Hi, This patch series adds initial support for ISO C++'s [P1689R5][], a format for describing C++ module requirements and provisions based on the source code. This is required because compiling C++ with modules is not embarrassingly parallel and need to be ordered to ensure that `import some_modul

Re: [PATCH] c++: Define built-in for std::tuple_element [PR100157]

2023-01-25 Thread Patrick Palka via Gcc-patches
On Tue, 17 Jan 2023, Jason Merrill wrote: > On 1/9/23 14:25, Patrick Palka via Gcc-patches wrote: > > On Mon, 9 Jan 2023, Patrick Palka wrote: > > > > > On Wed, 5 Oct 2022, Patrick Palka wrote: > > > > > > > On Thu, 7 Jul 2022, Jonathan Wakely via Gcc-patches wrote: > > > > > > > > > This adds

[PATCH] c++ modules: uninstantiated template friend class [PR104234]

2023-01-25 Thread Patrick Palka via Gcc-patches
Here we're not clearing DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P for the instantiated/injected template friend class B, which confuses a later call to get_originating_module_decl for B. This patch fixes this by clearing the flag in tsubst_friend_class (as is already done for template friend functions

[PATCH, committed] Fortran: ICE in gfc_compare_array_spec [PR108528]

2023-01-25 Thread Harald Anlauf via Gcc-patches
Dear all, I've committed the attached simple and obvious patch by Steve after regtesting on x86_64-pc-linux-gnu. Instead of generating an internal error when wrong types are passed to a bounds comparison, simply return false. Committed: https://gcc.gnu.org/g:9fb9da3d38513d320bfea72050f7a59688595e

Re: [PATCH v4] c++: Reject UDLs in certain contexts [PR105300]

2023-01-25 Thread Jason Merrill via Gcc-patches
On 1/13/23 18:22, Marek Polacek wrote: On Sat, Dec 03, 2022 at 02:58:16PM -0500, Jason Merrill wrote: On 12/2/22 18:58, Marek Polacek wrote: On Fri, Nov 18, 2022 at 08:39:10PM -0500, Jason Merrill wrote: On 11/18/22 18:52, Marek Polacek wrote: +/* Parse a string literal or user defined string

[PATCH] minor optimization bug in basic_string move assignment

2023-01-25 Thread François Dumont via Gcc-patches
Let's submit a proper patch proposal then. The occasion for me to ask if there is any reason for cow string not being C++11 allocator compliant ? Just lack of interest ? I wanted to consider it to get rid of the __gnu_debug::_Safe_container _IsCxx11AllocatorAware template parameter.     lib

[PATCH] PR tree-optimization/108447 - Do not try to logical fold floating point relations.

2023-01-25 Thread Andrew MacLeod via Gcc-patches
This boils down to a single place where we are trying to do things with relations in ranger that are simply not safe when we need to honor NANs. I think we can avoid all the other shuffling of relations, and simply not perform this optimization when it comes to floats. The case the routine ha

Re: [PATCH 3/3] arm: Fix MVE predicates synthesis [PR 108443]

2023-01-25 Thread Andre Vieira (lists) via Gcc-patches
Looks like the first patch was missing a change I had made to prevent mve_bool_vec_to_const ICEing if called with a non-vector immediate. Now included. On 24/01/2023 13:56, Andre Vieira (lists) via Gcc-patches wrote: Hi, This patch fixes the way we synthesize MVE predicate immediates and fix

Re: [PATCH 2/2] Add VREL_OTHER for FP unsupported relations.

2023-01-25 Thread Andrew MacLeod via Gcc-patches
On 1/25/23 09:48, Jakub Jelinek wrote: On Wed, Jan 25, 2023 at 09:30:44AM -0500, Andrew MacLeod wrote: But I'm afraid the above has VREL_OTHER for too many important cases, unlike intersect where it is for none unless VREL_OTHER is involved, or just a few ones for union. Im not sure it is qui

Re: [PATCH] Add support for x86_64-*-gnu-* targets to build x86_64 gnumach/hurd

2023-01-25 Thread Flávio Cruz via Gcc-patches
Ping On Mon, Jan 9, 2023 at 1:00 PM Flávio Cruz wrote: > Friendly ping > > On Mon, Dec 26, 2022 at 12:34 PM Flavio Cruz wrote: > >> Tested by building a toolchain and compiling gnumach for x86_64 [1]. >> This is the basic version without unwind support which I think is only >> required to >> im

Re: [PATCH 2/2] Add VREL_OTHER for FP unsupported relations.

2023-01-25 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 25, 2023 at 09:30:44AM -0500, Andrew MacLeod wrote: > > But I'm afraid the above has VREL_OTHER for too many important cases, > > unlike intersect where it is for none unless VREL_OTHER is involved, or just > > a few ones for union. > > Im not sure it is quite that bad.   Floating poin

[Patch][v2] OpenMP/Fortran: Partially fix non-rect loop nests [PR107424]

2023-01-25 Thread Tobias Burnus
Hi Jakub, hi all, updated patch included, i.e. avoiding 'count' for 'j' when a 'j.0' would do (i.e. only local var without the different step calculation). I also now reject if there is a non-unit step on the loop using an outer var. Eventually still to be done: replace the 'sorry' by working co

Re: [PATCH v3 1/2] aarch64: fix warning emission for ABI break since GCC 9.1

2023-01-25 Thread Christophe Lyon via Gcc-patches
On 1/12/23 14:03, Richard Sandiford wrote: Christophe Lyon writes: While looking at PR 105549, which is about fixing the ABI break introduced in GCC 9.1 in parameter alignment with bit-fields, we noticed that the GCC 9.1 warning is not emitted in all the cases where it should be. This patch

Re: [PATCH 2/2] Add VREL_OTHER for FP unsupported relations.

2023-01-25 Thread Andrew MacLeod via Gcc-patches
On 1/25/23 06:15, Jakub Jelinek wrote: On Tue, Jan 24, 2023 at 10:57:12AM -0500, Andrew MacLeod wrote: That is the way VREL_OTHER is implemented in the table. So the problem is not on the true side of the IF condition as in your example, its on the false side. We see this commonly in code lik

Re: [committed] testsuite: Fix up new51.C test on various targets [PR108533]

2023-01-25 Thread Jason Merrill via Gcc-patches
On 1/24/23 18:16, Jakub Jelinek wrote: On Mon, Jan 23, 2023 at 10:26:14PM -0500, Jason Merrill via Gcc-patches wrote: * g++.dg/init/new51.C: New test. The test fails on targets where size_t is not unsigned long due to extra diagnostics. As the testcase is tested in C++98 too, I'm not

Re: [PATCH] c++: Fix up mangling of static lambdas [PR108525]

2023-01-25 Thread Jason Merrill via Gcc-patches
On 1/24/23 18:19, Jakub Jelinek wrote: Hi! Before the P1169R4 changes, operator () of a lambda was always a method, so it was fine to pass method_p = 1 unconditionally, but it isn't always the case, so this patch adds a check for whether it is a method or nor. Bootstrapped/regtested on x86_64-l

[r13-5318 Regression] FAIL: g++.dg/init/new51.C -std=c++98 (test for excess errors) on Linux/x86_64

2023-01-25 Thread Jiang, Haochen via Gcc-patches
This is the recent regression on gcc trunk. Seems it got fixed. If that is the case, plz ignore that. As mentioned in previous thread, before the mail system got fixed on server, I will manually forward this email. BRs, Haochen > -Original Message- > From: haochen.jiang > Sent: Wednes

Re: [PATCH 23/23] arm: fix missing extern "C" in MVE tests

2023-01-25 Thread Andrea Corallo via Gcc-patches
Kyrylo Tkachov writes: [...] > > Ok. > Thanks, > Kyrill Hi Kyrill, thanks for reviewing. These and all the previous ones are in with the requested ChangeLogs changes. Regards Andrea

Re: [PATCH] lto: pass through -funwind-tables and -fasynchronous-unwind-tables

2023-01-25 Thread Andreas Schwab via Gcc-patches
On Jan 25 2023, Richard Biener wrote: > where we'd prefer -funwind-tables over -fno-unwind-tables when the > options do not match > across TUs. Note that you likely want to add > -f[asynchronous-]unwind-tables handling > in lto-options.cc:lto_write_options as well so the default is streamed > as

Re: [PATCH] lto: pass through -funwind-tables and -fasynchronous-unwind-tables

2023-01-25 Thread Richard Biener via Gcc-patches
On Wed, Jan 18, 2023 at 11:17 AM Andreas Schwab via Gcc-patches wrote: > > The -funwind-tables and -fasynchronous-unwind-tables options are relevant > for the output pass, thus they need to be passed through by the lto > wrapper. > > gcc/ > * lto-wrapper.cc (merge_and_complain): Pass throu

[PATCH] tree-optimization/108523 - fix endless iteration in VN

2023-01-25 Thread Richard Biener via Gcc-patches
The following fixes not converging iteration in value-numbering of PHI nodes when we use an equivalence to prove the PHI node is degenerate. We have to avoid the situation where we oscillate between the two equivalent values because the result is fed back via a backedge. Bootstrapped and tested o

[PATCH] Fixup LTO internal docs for option processing

2023-01-25 Thread Richard Biener via Gcc-patches
Andreas noticed that when I removed lto_read_all_file_options I failed to update the internals manual which refers to it. The following attempts to reflect the current situation. Pushed. * doc/lto.texi (Command line options): Reword and update reference to removed lto_read_all_fi

Re: [PATCH] modula-2: Fixes for preprocessing [PR102343, PR108182]

2023-01-25 Thread Gaius Mulley via Gcc-patches
Iain Sandoe writes: > Tested on x86_64, powerpc64 - linux-gnu (with 32b multilibs), > i686, powerpc darwin (with 64b multilibs) x86_64 darwin (with and without > 32b multilib). > OK for trunk? > thanks > Iain > > --- 8< --- > > Modula-2 uses the C preprocessor to implement handling for conditiona

Re: [aarch64] Use wzr/xzr for assigning vector element to 0

2023-01-25 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 23 Jan 2023 at 22:26, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Wed, 18 Jan 2023 at 19:59, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Tue, 17 Jan 2023 at 18:29, Richard Sandiford > >> > wrote: > >> >> > >> >> Prathamesh Kulkarni

Re: [PATCH] tree-optimization/108522 Use COMPONENT_REF offset when available

2023-01-25 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 25, 2023 at 12:27:13PM +0100, Jakub Jelinek via Gcc-patches wrote: > On Wed, Jan 25, 2023 at 06:22:56AM -0500, Siddhesh Poyarekar wrote: > > On 2023-01-25 02:44, Richard Biener wrote: > > > > t = TREE_OPERAND (expr, 1); > > > > - off = size_binop (PLUS_EXPR, DECL_FIELD_OFFS

Re: [PATCH] tree-optimization/108522 Use COMPONENT_REF offset when available

2023-01-25 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 25, 2023 at 06:22:56AM -0500, Siddhesh Poyarekar wrote: > On 2023-01-25 02:44, Richard Biener wrote: > > > t = TREE_OPERAND (expr, 1); > > > - off = size_binop (PLUS_EXPR, DECL_FIELD_OFFSET (t), > > > + off = size_binop (PLUS_EXPR, > > > + (TREE_O

[pushed] aarch64: Restore generation of SVE UQDEC instructions

2023-01-25 Thread Richard Sandiford via Gcc-patches
The addition of TARGET_CSSC meant that we wouldn't generate SVE UQDEC instructions unless +cssc was also enabled. Fixes: - gcc.target/aarch64/sve/slp_4.c - gcc.target/aarch64/sve/slp_10.c - gcc.target/aarch64/sve/while_4.c Tested on aarch64-linux-gnu & pushed. Richard gcc/ * config/aar

[pushed] aarch64: Update sizeless tests

2023-01-25 Thread Richard Sandiford via Gcc-patches
The sizeless-*.c tests contained (deliberately) invalid constructors that had two errors. The first error now suppresses the second error, but the second error was the main focus of the test. This patch therefore rewrites it into a different form. Tested on aarch64-linux-gnu & pushed. Richard

Re: [PATCH] tree-optimization/108522 Use COMPONENT_REF offset when available

2023-01-25 Thread Siddhesh Poyarekar
On 2023-01-25 02:44, Richard Biener wrote: t = TREE_OPERAND (expr, 1); - off = size_binop (PLUS_EXPR, DECL_FIELD_OFFSET (t), + off = size_binop (PLUS_EXPR, + (TREE_OPERAND (expr, 2) ? TREE_OPERAND (expr, 2) +: DECL_FIELD_OFFSET (t)),

Re: [PATCH 2/2] Add VREL_OTHER for FP unsupported relations.

2023-01-25 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 24, 2023 at 10:57:12AM -0500, Andrew MacLeod wrote: > That is the way VREL_OTHER is implemented in the table. > > So the problem is not on the true side of the IF condition as in your > example, its on the false side. We see this commonly in code like this > > > if (x <= y) // FA

[pushed] wwwdocs: gcc-6: Switch www.open-std.org links to https

2023-01-25 Thread Gerald Pfeifer
Pushed. Gerald --- htdocs/gcc-6/changes.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/gcc-6/changes.html b/htdocs/gcc-6/changes.html index 612ea48d..b400dd9c 100644 --- a/htdocs/gcc-6/changes.html +++ b/htdocs/gcc-6/changes.html @@ -300,7 +300,7 @@ within strings

[pushed] doc/contrib.texi: Add Jose E. Marchesi

2023-01-25 Thread Gerald Pfeifer
This fixes an obvious submission (of which I believe there are more - please feel free to help address those). Gerald gcc/ChangeLog: * doc/contrib.texi: Add Jose E. Marchesi. --- gcc/doc/contrib.texi | 4 1 file changed, 4 insertions(+) diff --git a/gcc/doc/contrib.texi b/gcc/do

Re: [PATCH] store-merging: Disable string_concatenate mode if start or end aren't byte aligned [PR108498]

2023-01-25 Thread Richard Biener via Gcc-patches
On Wed, 25 Jan 2023, Jakub Jelinek wrote: > Hi! > > The first of the following testcases is miscompiled on powerpc64-linux -O2 > -m64 at least, the latter at least on x86_64-linux -m32/-m64. > Since GCC 11 store-merging has a separate string_concatenation mode which > turns stores into setting a

Re: [committed] C-SKY: Define SYSROOT_SUFFIX_SPEC.

2023-01-25 Thread Cooper Qu via Gcc-patches
On Fri, Jan 20, 2023 at 05:27:26PM +, Joseph Myers wrote: > I think this caused the build failures with build-many-glibcs.py shown by > my bot. SYSROOT_SUFFIX_SPEC should not be defined for a > --disable-multilib build; in such a build you can expect a single sysroot > without a suffix inv

[PATCH] store-merging: Disable string_concatenate mode if start or end aren't byte aligned [PR108498]

2023-01-25 Thread Jakub Jelinek via Gcc-patches
Hi! The first of the following testcases is miscompiled on powerpc64-linux -O2 -m64 at least, the latter at least on x86_64-linux -m32/-m64. Since GCC 11 store-merging has a separate string_concatenation mode which turns stores into setting a MEM_REF from a STRING_CST. This mode is triggered if at

[PATCH] modula-2: Fixes for preprocessing [PR102343, PR108182]

2023-01-25 Thread Iain Sandoe via Gcc-patches
Tested on x86_64, powerpc64 - linux-gnu (with 32b multilibs), i686, powerpc darwin (with 64b multilibs) x86_64 darwin (with and without 32b multilib). OK for trunk? thanks Iain --- 8< --- Modula-2 uses the C preprocessor to implement handling for conditional code and macros. However, this is not

Re: [PATCH] tree-optimization/108522 Use COMPONENT_REF offset when available

2023-01-25 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 25, 2023 at 08:44:31AM +0100, Richard Biener wrote: > > --- a/gcc/tree-object-size.cc > > +++ b/gcc/tree-object-size.cc > > @@ -412,7 +412,9 @@ compute_object_offset (const_tree expr, const_tree var) > > return base; > > > >t = TREE_OPERAND (expr, 1); > > - off = si