Re: [PATCH] builtins: Fix up two bugs in access_ref::inform_access [PR98721]

2021-01-20 Thread Richard Biener
On Wed, 20 Jan 2021, Jakub Jelinek wrote: > Hi! > > The following patch fixes two bugs in the access_ref::inform_access function > (plus some formatting nits). > > The first problem is that ref can be various things, e.g. *_DECL, or > SSA_NAME, or IDENTIFIER_NODE. And allocfn is non-NULL only i

[PATCH] tree-optimization/98758 - fix integer arithmetic in data-ref analysis

2021-01-20 Thread Richard Biener
This fixes some int arithmetic issues and a bogus truncation. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-01-20 Richard Biener PR tree-optimization/98758 * tree-data-ref.c (int_divides_p): Use lambda_int arguments. (lambda_matrix_right_hermite): A

Re: [PATCH v2] Add line debug info for virtual thunks [PR97937]

2021-01-20 Thread Bernd Edlinger
Ping? The patch was posted before Stage 4 started: https://gcc.gnu.org/pipermail/gcc-patches/2021-January/563391.html Thanks Bernd. On 1/13/21 3:59 PM, Bernd Edlinger wrote: > Hi, > > this is a new improved version of my patch. > The previous patch had two defects: > It failed with -ffunction-

[PATCH] PING Add input_modes parameter to TARGET_MD_ASM_ADJUST hook

2021-01-20 Thread Ilya Leoshkevich via Gcc-patches
Hello, I would like to ping the following patch: Add input_modes parameter to TARGET_MD_ASM_ADJUST hook https://gcc.gnu.org/pipermail/gcc-patches/2021-January/562898.html It is needed for the following regression fix: IBM Z: Fix usage of "f" constraint with long doubles https://gcc.gnu.org/pipe

[PATCH] Drop profile reproducibility flag as it is not used.

2021-01-20 Thread Martin Liška
Hello. For GCC 11 I've made a change in a way how we track TOP N counters: - dynamic allocation is used for key value pairs - up to 32 values are tracked in parallel - the counters are allocated dynamically and don't occupy so much space in BSS executable Having that we can track more values a

[PATCH] vect: Fix VLA SLP invariant optimisation [PR98535]

2021-01-20 Thread Richard Sandiford via Gcc-patches
duplicate_and_interleave is the main fallback way of loading a repeating sequence of elements into variable-length vectors. The code handles cases in which the number of elements in the sequence is potentially several times greater than the number of elements in a vector. Let: - NE be the (compil

[PATCH] Handle overflow in dependence analysis lambda ops gracefully

2021-01-20 Thread Richard Biener
The following tries to handle overflow in the integer computations done by lambda ops of dependence analysis by failing instead of silently continuing with overflowed values. It also avoids treating large unsigned CHREC_RIGHT as negative unless the chrec is of pointer type and avoids the most nega

Re: [PATCH] Handle overflow in dependence analysis lambda ops gracefully

2021-01-20 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 20, 2021 at 12:29:23PM +0100, Richard Biener wrote: > +/* Compute the product of signed A and B and indicate in *OVERFLOW whether > + that operation overflowed. */ > + > +inline HOST_WIDE_INT > +mul_hwi (HOST_WIDE_INT a, HOST_WIDE_INT b, bool *overflow) > +{ > + unsigned HOST_WIDE_I

Re: [PATCH] vect: Fix VLA SLP invariant optimisation [PR98535]

2021-01-20 Thread Richard Biener via Gcc-patches
On January 20, 2021 12:17:35 PM GMT+01:00, Richard Sandiford via Gcc-patches wrote: >duplicate_and_interleave is the main fallback way of loading >a repeating sequence of elements into variable-length vectors. >The code handles cases in which the number of elements in the >sequence is potentially

Re: [ARM] PR98636 - ICE on passing incompatible options for fp16

2021-01-20 Thread Martin Liška
On 1/19/21 5:55 PM, Prathamesh Kulkarni wrote: Hi, The attached patch fixes the issue mentioned in PR, by adding arm_fp16_format to checked_options in optc-save-gen.awk. Is this OK to commit in stage-4 if testing passes or should we hold it till next stage-1 ? Please install the patch now. Note

Re: [PATCH] Handle overflow in dependence analysis lambda ops gracefully

2021-01-20 Thread Richard Biener
On Wed, 20 Jan 2021, Jakub Jelinek wrote: > On Wed, Jan 20, 2021 at 12:29:23PM +0100, Richard Biener wrote: > > +/* Compute the product of signed A and B and indicate in *OVERFLOW whether > > + that operation overflowed. */ > > + > > +inline HOST_WIDE_INT > > +mul_hwi (HOST_WIDE_INT a, HOST_WID

Re: [PATCH] Handle overflow in dependence analysis lambda ops gracefully

2021-01-20 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 20, 2021 at 01:15:12PM +0100, Richard Biener wrote: > OK, fixed. Guess we could also use __builtin_mul_overflow directly > if supported via a GCC_VERSION check. Looks like it's present > since GCC 5 at least. So sth like (incremental) > > diff --git a/gcc/hwint.h b/gcc/hwint.h > ind

Re: [PATCH] [PR rtl/optimization/98694] Fix incorrect optimization by cprop_hardreg.

2021-01-20 Thread H.J. Lu via Gcc-patches
On Tue, Jan 19, 2021 at 8:32 PM Hongtao Liu via Gcc-patches wrote: > > On Wed, Jan 20, 2021 at 12:10 AM Richard Sandiford > wrote: > > > > Jakub Jelinek via Gcc-patches writes: > > > On Tue, Jan 19, 2021 at 12:38:47PM +, Richard Sandiford via > > > Gcc-patches wrote: > > >> > actually only

Re: [PATCH] Drop profile reproducibility flag as it is not used.

2021-01-20 Thread Richard Biener via Gcc-patches
On Wed, Jan 20, 2021 at 12:04 PM Martin Liška wrote: > > Hello. > > For GCC 11 I've made a change in a way how we track TOP N counters: > - dynamic allocation is used for key value pairs > - up to 32 values are tracked in parallel > - the counters are allocated dynamically and don't occupy so much

Re: [PATCH] Handle overflow in dependence analysis lambda ops gracefully

2021-01-20 Thread Richard Biener
On Wed, 20 Jan 2021, Jakub Jelinek wrote: > On Wed, Jan 20, 2021 at 01:15:12PM +0100, Richard Biener wrote: > > OK, fixed. Guess we could also use __builtin_mul_overflow directly > > if supported via a GCC_VERSION check. Looks like it's present > > since GCC 5 at least. So sth like (incremental

Re: [PATCH] [PR rtl/optimization/98694] Fix incorrect optimization by cprop_hardreg.

2021-01-20 Thread Richard Sandiford via Gcc-patches
Hongtao Liu writes: > On Wed, Jan 20, 2021 at 12:10 AM Richard Sandiford > wrote: >> >> Jakub Jelinek via Gcc-patches writes: >> > On Tue, Jan 19, 2021 at 12:38:47PM +, Richard Sandiford via >> > Gcc-patches wrote: >> >> > actually only the lower 16bits are needed, the original insn is like

Re: [PATCH] Handle overflow in dependence analysis lambda ops gracefully

2021-01-20 Thread Richard Biener
On Wed, 20 Jan 2021, Richard Biener wrote: > On Wed, 20 Jan 2021, Jakub Jelinek wrote: > > > On Wed, Jan 20, 2021 at 01:15:12PM +0100, Richard Biener wrote: > > > OK, fixed. Guess we could also use __builtin_mul_overflow directly > > > if supported via a GCC_VERSION check. Looks like it's prese

Re: [PATCH] Handle overflow in dependence analysis lambda ops gracefully

2021-01-20 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > diff --git a/gcc/hwint.h b/gcc/hwint.h > index 127b0130c66..8812bc7150f 100644 > --- a/gcc/hwint.h > +++ b/gcc/hwint.h > @@ -333,4 +333,46 @@ absu_hwi (HOST_WIDE_INT x) >return x >= 0 ? (unsigned HOST_WIDE_INT)x : -(unsigned HOST_WIDE_INT)x; > } > > +/* Compute the

Re: [PATCH] Handle overflow in dependence analysis lambda ops gracefully

2021-01-20 Thread Richard Biener
On Wed, 20 Jan 2021, Richard Sandiford wrote: > Richard Biener writes: > > diff --git a/gcc/hwint.h b/gcc/hwint.h > > index 127b0130c66..8812bc7150f 100644 > > --- a/gcc/hwint.h > > +++ b/gcc/hwint.h > > @@ -333,4 +333,46 @@ absu_hwi (HOST_WIDE_INT x) > >return x >= 0 ? (unsigned HOST_WIDE_IN

Re: driver: do not check input file existence here [PR 98452]

2021-01-20 Thread Nathan Sidwell
On 1/19/21 6:27 PM, Joseph Myers wrote: On Tue, 19 Jan 2021, Nathan Sidwell wrote: Joseph, I was relying on this patch on the modules branch, but didn't realize the implications when merging and thought it was just a cleanup. I'm not sure why the driver wants to check here, rather than leave i

[PATCH] debug: Fix up DWARF 5 -g -flto -ffat-lto-objects [PR98765]

2021-01-20 Thread Jakub Jelinek via Gcc-patches
Hi! As mentioned in the PR, with -gdwarf-5 (or -g now) -flto -ffat-lto-objects, users can't strip the LTO sections with strip -p -R .gnu.lto_* -R .gnu.debuglto_* -N __gnu_lto_v1 anymore when GCC is configured against recent binutils. The problem is that in that case .gnu.debuglto_.debug_line_str

Re: [PATCH] debug: Fix up DWARF 5 -g -flto -ffat-lto-objects [PR98765]

2021-01-20 Thread Richard Biener
On Wed, 20 Jan 2021, Jakub Jelinek wrote: > Hi! > > As mentioned in the PR, with -gdwarf-5 (or -g now) -flto -ffat-lto-objects, > users can't strip the LTO sections with > strip -p -R .gnu.lto_* -R .gnu.debuglto_* -N __gnu_lto_v1 > anymore when GCC is configured against recent binutils. > > The

Re: [EXTERNAL] Re: [PATCH][tree-optimization]Optimize combination of comparisons to dec+compare

2021-01-20 Thread Richard Biener via Gcc-patches
On Wed, Jan 20, 2021 at 2:32 AM Eugene Rozenfeld wrote: > > Richard, > > Can you please commit this patch for me? I don't have write access yet, I'm > still working on getting copyright assignment/disclaimer signed by my > employer. Done after re-bootstrapping/testing on x86-64-linux. Richard.

Re: [PATCH] Drop profile reproducibility flag as it is not used.

2021-01-20 Thread Jan Hubicka
> On Wed, Jan 20, 2021 at 12:04 PM Martin Liška wrote: > > > > Hello. > > > > For GCC 11 I've made a change in a way how we track TOP N counters: > > - dynamic allocation is used for key value pairs > > - up to 32 values are tracked in parallel > > - the counters are allocated dynamically and don'

Re: [PATCH] [WIP] openmp: Add OpenMP 5.0 task detach clause support

2021-01-20 Thread Florian Weimer via Gcc-patches
* Kwok Cheung Yeung: > From 788687f87ad41e51258738ce068ee38d7b24defc Mon Sep 17 00:00:00 2001 > From: Kwok Cheung Yeung > Date: Fri, 15 Jan 2021 04:49:36 -0800 > Subject: [PATCH] openmp: Add support for the OpenMP 5.0 task detach clause Sorry, this appears to cause OpenMP task state corruption i

Re: [PATCH] Drop profile reproducibility flag as it is not used.

2021-01-20 Thread Martin Liška
On 1/20/21 2:11 PM, Richard Biener wrote: The option was present on the GCC 10 branch as well so I fear we can't simply remove it. So can you leave it as the usual Ignore entry in common.opt? Sure. Otherwise OK, but I guess the issue can still pop up so I'm not sure whether this is the corr

Re: [PATCH] Drop profile reproducibility flag as it is not used.

2021-01-20 Thread Martin Liška
On 1/20/21 5:00 PM, Jan Hubicka wrote: There are two thinks that I would like to discuss first 1) I think the option is stil used for value profiling of divisors It's not. Right now the only usage lives in get_nth_most_common_value which is an entry point being used for stringops, indirect ca

Re: [PATCH] c++: Fix excessive instantiation inside decltype [PR71879]

2021-01-20 Thread Patrick Palka via Gcc-patches
On Tue, 19 Jan 2021, Jason Merrill wrote: > On 1/18/21 12:31 AM, Patrick Palka wrote: > > Here after resolving the address of a template-id inside decltype, we > > end up instantiating the chosen specialization from the call to > > mark_used in resolve_nondeduced_context, even though only its type

Re: [PATCH] [WIP] openmp: Add OpenMP 5.0 task detach clause support

2021-01-20 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 20, 2021 at 05:04:39PM +0100, Florian Weimer wrote: > Sorry, this appears to cause OpenMP task state corruption in RPM. We > have only seen this on s390x. Haven't actually verified it, but my suspection is that this is a caller stack corruption. We play with fire with the GOMP_task A

c++: Avoid UB in signed shift [PR 98625]

2021-01-20 Thread Nathan Sidwell
Thanks Jakub & Martin for unconfusing me about where the UB was! I'd forgotten that left shifting a negative value is UB until C++20. Insert some casts to do unsigned shifts. PR c++/98625 gcc/cp/ * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of signed

[committed] LRA: patch fixing PR98722

2021-01-20 Thread Vladimir Makarov via Gcc-patches
The following patch fixes   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98722 The patch was successfully bootstrapped and tested on x86-64. [PR98722] LRA: Check that target has no 3-op add insn to transform 2 plus expression. Patch cf2ac1c30af0fa783c8d72e527904dda5d8cc330 for solving PR97969

trapv question

2021-01-20 Thread Andrew MacLeod via Gcc-patches
Im looking at the testcase gcc.dg/torture/ftrapv-2.c int i = 0x7fff; int main(void) {   pid_t child = fork ();   int status = 0;   if (child == 0)     {   volatile int x = i + 1 < i;   exit (0);     } THis is failing with the new relational work... and I'm looking to understand wh

Re: trapv question

2021-01-20 Thread Richard Biener via Gcc-patches
On January 20, 2021 6:52:11 PM GMT+01:00, Andrew MacLeod wrote: >Im looking at the testcase gcc.dg/torture/ftrapv-2.c > >int i = 0x7fff; > >int main(void) >{ >   pid_t child = fork (); >   int status = 0; >   if (child == 0) >     { >   volatile int x = i + 1 < i; >   exit (0); >    

[PATCH] aarch64: Split vec_selects of bottom elements into simple move

2021-01-20 Thread Kyrylo Tkachov via Gcc-patches
Hi all, In certain intrinsics use cases GCC leaves SETs of a bottom-element vec select lying around: (vec_select:DI (reg:V2DI 34 v2 [orig:128 __o ] [128]) (parallel [ (const_int 0 [0]) ]))) This can be treated as a simple move in aarch64 wh

[patch] Re: trapv question

2021-01-20 Thread Andrew MacLeod via Gcc-patches
On 1/20/21 1:43 PM, Richard Biener wrote: On January 20, 2021 6:52:11 PM GMT+01:00, Andrew MacLeod wrote: diff --git a/gcc/testsuite/gcc.dg/torture/ftrapv-2.c b/gcc/testsuite/gcc.dg/torture/ftrapv-2.c index 75e464fe557..5824c2fdbb7 100644 --- a/gcc/testsuite/gcc.dg/torture/ftrapv-2.c +++ b/gc

Re: [PATCH v6] Practical improvement to libgcc complex divide

2021-01-20 Thread Patrick McGehearty via Gcc-patches
Ping. With the holidays coming shortly after I posted this this on Dec 17, 2020, I understand any delays in getting it reviewed. Still, I thought I should give a ping. I very much would like to complete this project while I can still find all my notes related to the design decisions.  :-) - Pat

Re: [PATCH] Drop profile reproducibility flag as it is not used.

2021-01-20 Thread Jan Hubicka
> On 1/20/21 5:00 PM, Jan Hubicka wrote: > > There are two thinks that I would like to discuss first > > 1) I think the option is stil used for value profiling of divisors > > It's not. Right now the only usage lives in get_nth_most_common_value which > is an entry point being used for stringops

[PATCH,AIX] ctype_inline.h cast and thread-safe access to __lc_type

2021-01-20 Thread David Edelsohn via Gcc-patches
aix: make ctype_inline.h thread-safe and avoid _OBJ_DATA char subscript. g++.dg/warn/Wstringop-overflow-6.C tests for a bogus overflow warning in system headers. This testcase was generating a -Wchar-subscript warning on AIX because ctype_inline.h was subscripting AIX _OBJ_DATA usi

[BACKPORT] Apply fix for PR libgcc/97643 to gcc 10 branch

2021-01-20 Thread Michael Meissner via Gcc-patches
PowerPC: Backport fix for libgcc long double support. This patch takes the fix that was applied to the trunk on December 3rd, and it applies it to the GCC 10 branch. I have verified it by building compilers configured for both normal 128-bit IBM long double and 64-bit long double with/without the

[PATCH] avoid -Wnonnull for COND_EXPR in static_cast (PR 98646)

2021-01-20 Thread Martin Sebor via Gcc-patches
Similar to pr96003, bug 98646 reports a spurious instance of -Wnonnull calling a member function on the result of static_cast. The difference here is that the cast argument is a function call, and, besides casting down an inheritance hierarchy, the cast also adds the const qualifier. GCC sets the

Re: [BACKPORT] Apply fix for PR libgcc/97643 to gcc 10 branch

2021-01-20 Thread Segher Boessenkool
On Wed, Jan 20, 2021 at 06:38:37PM -0500, Michael Meissner wrote: > This patch takes the fix that was applied to the trunk on December 3rd, and it > applies it to the GCC 10 branch. > PR libgcc/97543, PR libgcc/97643 > Backport from trunk. > > 2020-12-03 Michael Meissner > >

Re: [PATCH v2] c++: ICE with delayed noexcept and attribute used [PR97966]

2021-01-20 Thread Marek Polacek via Gcc-patches
On Tue, Jan 19, 2021 at 03:37:25PM -0500, Jason Merrill wrote: > On 1/12/21 9:13 PM, Marek Polacek wrote: > > Another ICE with delayed noexcept parsing, but a bit gnarlier. > > > > A function definition marked with __attribute__((used)) ought to be > > emitted even when it is not referenced in a T

Re: [BACKPORT] Apply fix for PR libgcc/97643 to gcc 10 branch

2021-01-20 Thread Michael Meissner via Gcc-patches
On Wed, Jan 20, 2021 at 06:46:14PM -0600, Segher Boessenkool wrote: > On Wed, Jan 20, 2021 at 06:38:37PM -0500, Michael Meissner wrote: > > This patch takes the fix that was applied to the trunk on December 3rd, and > > it > > applies it to the GCC 10 branch. > > > PR libgcc/97543, PR libgcc/

Re: [PATCH] [PR rtl/optimization/98694] Fix incorrect optimization by cprop_hardreg.

2021-01-20 Thread Hongtao Liu via Gcc-patches
> OK with those changes and the one that HJ asked for. > This is the patch I'm checking in, thanks for the review. > Thanks, > Richard -- BR, Hongtao From b806e0cece62620e31a4a861208d37616059a212 Mon Sep 17 00:00:00 2001 From: liuhongt Date: Mon, 18 Jan 2021 16:55:32 +0800 Subject: [PATCH] [

Re: [Ada,FYI] revamp ada.numerics.aux

2021-01-20 Thread Sebastian Huber
Hello Alexandre, On 13/01/2021 19:40, Alexandre Oliva wrote: Would you like to take a stab at it yourself, or should I? I can try to figure out a patch, but I have to guess how it works. What's needed is adding LIBGNAT_TARGET_PAIRS += \ a-nallfl.adsI have this issue also for AArch64. F

Re: [PATCH v2] c++: ICE with delayed noexcept and attribute used [PR97966]

2021-01-20 Thread Jason Merrill via Gcc-patches
On 1/20/21 7:49 PM, Marek Polacek wrote: On Tue, Jan 19, 2021 at 03:37:25PM -0500, Jason Merrill wrote: On 1/12/21 9:13 PM, Marek Polacek wrote: Another ICE with delayed noexcept parsing, but a bit gnarlier. A function definition marked with __attribute__((used)) ought to be emitted even when

Re: [PATCH] [WIP] openmp: Add OpenMP 5.0 task detach clause support

2021-01-20 Thread Thomas Schwinge
Hi! On 2021-01-20T17:40:58+0100, Jakub Jelinek via Gcc-patches wrote: > On Wed, Jan 20, 2021 at 05:04:39PM +0100, Florian Weimer wrote: >> Sorry, this appears to cause OpenMP task state corruption in RPM. We >> have only seen this on s390x. > > Haven't actually verified it, but my suspection is

Re: [PATCH] [WIP] openmp: Add OpenMP 5.0 task detach clause support

2021-01-20 Thread Jakub Jelinek via Gcc-patches
On Thu, Jan 21, 2021 at 08:32:52AM +0100, Thomas Schwinge wrote: > > and which of those depend, priority and detach argument is present depends > > on the bits in flags. > > I'm afraid the compiler just decided to spill the detach = NULL store in > > if ((flags & GOMP_TASK_FLAG_DETACH) == 0) > >