Re: [PATCH][stage1] Remove conditionals around free()

2023-03-01 Thread Bernhard Reutner-Fischer via Gcc-patches
On Wed, 1 Mar 2023 22:28:56 +0100 Bernhard Reutner-Fischer wrote: > Remarks: > 1) We should do this in if-conversion (?) on our own. >I suppose. Independently of -fdelete-null-pointer-checks and iff we can prove that ptr was NULL when passed to free(ptr) then we can elide the call, of course

[pushed] analyzer: fixes to side-effects for built-in functions [PR107565]

2023-03-01 Thread David Malcolm via Gcc-patches
Previously, if the analyzer saw a call to a non-pure and non-const built-in function that it didn't have explicit knowledge of the behavior of, it would fall back to assuming that the builtin could have arbitrary behavior, similar to a function defined outside of the current TU. However, this only

Re: [PATCH] c++: ICE with -Wmismatched-tags and member template [PR106259]

2023-03-01 Thread Marek Polacek via Gcc-patches
On Wed, Mar 01, 2023 at 04:44:12PM -0500, Jason Merrill wrote: > On 3/1/23 16:40, Marek Polacek wrote: > > On Wed, Mar 01, 2023 at 04:30:16PM -0500, Jason Merrill wrote: > > > On 3/1/23 15:33, Marek Polacek wrote: > > > > -Wmismatched-tags warns about the (harmless) struct/class mismatch. > > > > F

Re: [PATCH] c++: Add target hook for emit_support_tinfos [PR108883]

2023-03-01 Thread Jason Merrill via Gcc-patches
On 2/27/23 18:51, Jakub Jelinek wrote: On Mon, Feb 27, 2023 at 06:26:04PM -0500, Jason Merrill wrote: The following patch instead adds a target hook which allows the backend to temporarily tweak registered types such that emit_support_tinfos emits whatever is needed. Why handle these types dif

Re: Re: [PATCH] RISC-V: Bugfix for rvv bool mode precision adjustment

2023-03-01 Thread juzhe.zhong
>> Does the eventual value set by ADJUST_BYTESIZE equal the real number of >> bytes loaded by vlm.v and stored by vstm.v (after the appropriate vsetvl)? >> Or is the GCC size larger in some cases than the number of bytes >> loaded and stored? For VNx1BI,VNx2BI,VNx4BI,VNx8BI, we allocate the larger

Re: [PATCH][stage1] Remove conditionals around free()

2023-03-01 Thread Bernhard Reutner-Fischer via Gcc-patches
On Wed, 1 Mar 2023 22:58:59 +0100 Bernhard Reutner-Fischer wrote: > On Wed, 1 Mar 2023 22:28:56 +0100 > Bernhard Reutner-Fischer wrote: > > > Remarks: > > 1) We should do this in if-conversion (?) on our own. > >I suppose. Independently of -fdelete-null-pointer-checks > > and iff we can

Re: [PATCH][stage1] Remove conditionals around free()

2023-03-01 Thread Andrew Pinski via Gcc-patches
On Wed, Mar 1, 2023 at 1:31 PM Bernhard Reutner-Fischer via Fortran wrote: > > Hi! > > Mere cosmetics. > > - if (foo != NULL) > free (foo); > > With the caveat that coccinelle ruins replacement whitespace or i'm > uneducated enough to be unable to _not_ run the diff through > sed -e 's/^+\([[

Re: [PATCH 1/2] testsuite: Fix analyzer errors for newlib-errno

2023-03-01 Thread Bernhard Reutner-Fischer via Gcc-patches
On Wed, 1 Mar 2023 17:02:31 +0100 Hans-Peter Nilsson via Gcc-patches wrote: > > From: Hans-Peter Nilsson > > Date: Wed, 1 Mar 2023 16:36:46 +0100 > > > ... this is what I intend to commit later > > today, just keeping the added comment as brief as > > reasonable: > > Except I see the hook

[PATCH] Fix PR 108980: note without warning due to array bounds check

2023-03-01 Thread Andrew Pinski via Gcc-patches
The problem here is after r13-4748-g2a27ae32fabf85, in some cases we were calling inform without a corresponding warning. This changes the logic such that we only cause that to happen if there was a warning happened before hand. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

Re: [PATCH] Fix PR 108980: note without warning due to array bounds check

2023-03-01 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 01, 2023 at 03:25:00PM -0800, Andrew Pinski via Gcc-patches wrote: > The problem here is after r13-4748-g2a27ae32fabf85, in some > cases we were calling inform without a corresponding warning. > This changes the logic such that we only cause that to happen > if there was a warning happe

Re: [PATCH][stage1] Remove conditionals around free()

2023-03-01 Thread Bernhard Reutner-Fischer via Gcc-patches
On Wed, 1 Mar 2023 14:59:44 -0800 Andrew Pinski wrote: > On Wed, Mar 1, 2023 at 1:31 PM Bernhard Reutner-Fischer via Fortran > wrote: > > > > Hi! > > > > Mere cosmetics. > > > > - if (foo != NULL) > > free (foo); > > > > With the caveat that coccinelle ruins replacement whitespace or i'm > >

Re: [PATCH 1/2] testsuite: Fix analyzer errors for newlib-errno

2023-03-01 Thread Hans-Peter Nilsson via Gcc-patches
> Date: Thu, 2 Mar 2023 00:23:36 +0100 > From: Bernhard Reutner-Fischer > On Wed, 1 Mar 2023 17:02:31 +0100 > Hans-Peter Nilsson via Gcc-patches wrote: > > > > From: Hans-Peter Nilsson > > > Date: Wed, 1 Mar 2023 16:36:46 +0100 > > > > > ... this is what I intend to commit later > > > today

Re: [PATCH, gfortran] Escalate failure when Hollerith constant to real conversion fails [PR103628]

2023-03-01 Thread Bernhard Reutner-Fischer via Gcc-patches
On Wed, 1 Mar 2023 10:40:15 +0100 Tobias Burnus wrote: > Hi, > > Please CC fortran@gcc for Fortran patches. > > --- a/gcc/fortran/target-memory.cc > > +++ b/gcc/fortran/target-memory.cc > > @@ -417,10 +417,13 @@ gfc_interpret_float (int kind, unsigned char *buffer, > > size_t buffer_size, > >

Re: [PATCH][stage1] Remove conditionals around free()

2023-03-01 Thread Steve Kargl via Gcc-patches
On Wed, Mar 01, 2023 at 10:28:56PM +0100, Bernhard Reutner-Fischer via Fortran wrote: > libgfortran/caf/single.c |6 ++ > libgfortran/io/async.c |6 ++ > libgfortran/io/format.c |3 +-- > libgfortran/io/transfer.c|6 ++ > libgfortran/io/unix.c

Re: [PATCH, gfortran] Escalate failure when Hollerith constant to real conversion fails [PR103628]

2023-03-01 Thread Bernhard Reutner-Fischer via Gcc-patches
On Wed, 1 Mar 2023 07:39:40 -0800 Steve Kargl via Gcc-patches wrote: > In fact, Hollerith should be hidden behind a -fallow-hollerith > option and added to -std=legacy. While i'd be all for that, in my mind this will block off literally all consultants and quite some scientists unless we error o

Re: [PATCH 1/2] testsuite: Fix analyzer errors for newlib-errno

2023-03-01 Thread Bernhard Reutner-Fischer via Gcc-patches
On Thu, 2 Mar 2023 00:54:33 +0100 Hans-Peter Nilsson wrote: > > Date: Thu, 2 Mar 2023 00:23:36 +0100 > > From: Bernhard Reutner-Fischer > > > On Wed, 1 Mar 2023 17:02:31 +0100 > > Hans-Peter Nilsson via Gcc-patches wrote: > > > > > > From: Hans-Peter Nilsson > > > > Date: Wed, 1 Mar 2023

Re: [PATCH][stage1] Remove conditionals around free()

2023-03-01 Thread Andrew Pinski via Gcc-patches
On Wed, Mar 1, 2023 at 3:52 PM Bernhard Reutner-Fischer wrote: > > On Wed, 1 Mar 2023 14:59:44 -0800 > Andrew Pinski wrote: > > > On Wed, Mar 1, 2023 at 1:31 PM Bernhard Reutner-Fischer via Fortran > > wrote: > > > > > > Hi! > > > > > > Mere cosmetics. > > > > > > - if (foo != NULL) > > > fr

Re: [PATCH 1/2] testsuite: Fix analyzer errors for newlib-errno

2023-03-01 Thread Hans-Peter Nilsson via Gcc-patches
> Date: Thu, 2 Mar 2023 01:37:12 +0100 > From: Bernhard Reutner-Fischer > On Thu, 2 Mar 2023 00:54:33 +0100 > Hans-Peter Nilsson wrote: > > > > Date: Thu, 2 Mar 2023 00:23:36 +0100 > > > From: Bernhard Reutner-Fischer > > > > > On Wed, 1 Mar 2023 17:02:31 +0100 > > > Hans-Peter Nilsson via

Re: [PATCH, gfortran] Escalate failure when Hollerith constant to real conversion fails [PR103628]

2023-03-01 Thread Steve Kargl via Gcc-patches
On Thu, Mar 02, 2023 at 01:07:32AM +0100, Bernhard Reutner-Fischer wrote: > On Wed, 1 Mar 2023 07:39:40 -0800 > Steve Kargl via Gcc-patches wrote: > > > In fact, Hollerith should be hidden behind a -fallow-hollerith > > option and added to -std=legacy. > > While i'd be all for that, in my mind t

[COMMITTED] testsuite: Fix gcc.dg/attr-copy-6.c for user-label-prefixed targets

2023-03-01 Thread Hans-Peter Nilsson via Gcc-patches
Trivia: I copied that ASMNAME construct from the 18-year-minus-a-month old commit of r0-66993-gc5221531453e02, where it fixed a similar testsuite error. Committed as obvious. -- >8 -- This fixes: Running /x/gcc/testsuite/gcc.dg/dg.exp ... ... FAIL: gcc.dg/attr-copy-6.c (test for excess errors)

Re: [PATCH][stage1] Remove conditionals around free()

2023-03-01 Thread Jerry D via Gcc-patches
On 3/1/23 4:07 PM, Steve Kargl via Fortran wrote: On Wed, Mar 01, 2023 at 10:28:56PM +0100, Bernhard Reutner-Fischer via Fortran wrote: libgfortran/caf/single.c |6 ++ libgfortran/io/async.c |6 ++ libgfortran/io/format.c |3 +-- libgfortran/io/transfer.c

[COMMITTED] testsuite: Fix g++.dg/ext/attr-copy-2.C for default_packed targets

2023-03-01 Thread Hans-Peter Nilsson via Gcc-patches
Committed as obvious. FWIW, I'm on the side that emitting the warning when the reason is just that it's the default layout, is bad. A discussion took place years ago when the warning was added. -- >8 -- For targets where the byte-wise structure element layout is the same as for attribute-packed,

Re: [PATCH, gfortran] Escalate failure when Hollerith constant to real conversion fails [PR103628]

2023-03-01 Thread Kewen.Lin via Gcc-patches
Hi Haochen, on 2023/3/1 15:09, HAO CHEN GUI wrote: > Hi, > The patch escalates the failure when Hollerith constant to real conversion > fails in native_interpret_expr. It finally reports an "Unclassifiable > statement" error. > > The patch of pr95450 added a verification for decoding/encoding

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

2023-03-01 Thread Xionghu Luo via Gcc-patches
When spliting edge with self loop, the split edge should be placed just next to the edge_in->src, otherwise it may generate different position latch bbs for two consecutive self loops. For details, please refer to: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93680#c4 Regression tested pass on x8

[PATCH 2/2] gcov: Fix incorrect gimple line LOCATION [PR97923]

2023-03-01 Thread Xionghu Luo via Gcc-patches
For case like belowi test.c: 1:int foo(char c) 2:{ 3: return ((c >= 'A' && c <= 'Z') 4: || (c >= 'a' && c <= 'z') 5: || (c >= '0' && c <='0'));} the generated line number is incorrect for condition c>='A' of block 2: Thus correct the condition op0 location. gcno diff before and with

Re: [PATCH][stage1] Remove conditionals around free()

2023-03-01 Thread Ian Lance Taylor
Bernhard Reutner-Fischer writes: > libgo/runtime/go-setenv.c|6 ++ > libgo/runtime/go-unsetenv.c |3 +-- Files in the libgo directory are mirrored from upstream sources, as described in libgo/README.gcc. Please don't change them in the gcc repository. Thanks. Ian

Re: [PATCH] libstdc++: Limit allocations in _Rb_tree 2/2

2023-03-01 Thread François Dumont via Gcc-patches
Just forget about this patch, bad idea. The key_type might have additional data not used for the comparison. This data would not be preserved if we were inserting the already stored equivalent key instead of the user provided. On 22/02/23 07:08, François Dumont wrote: This one is a refineme

[PATCH v2] RISC-V: Bugfix for rvv bool mode precision adjustment

2023-03-01 Thread pan2.li--- via Gcc-patches
From: Pan Li Fix the bug of the rvv bool mode precision with the adjustment. The bits size of vbool*_t will be adjusted to [1, 2, 4, 8, 16, 32, 64] according to the rvv spec 1.0 isa. The adjusted mode precison of vbool*_t will help underlying pass to make t

RE: Re: [PATCH] RISC-V: Bugfix for rvv bool mode precision adjustment

2023-03-01 Thread Li, Pan2 via Gcc-patches
Thanks all for help. I tried and validated the way Richard mentioned, it works well as expected. Meanwhile, I updated the PR as below (I take the in-reply-to option for send-email but looks failed). Could you please help to review continuously? Additionally, I would like to learn if we can land

Re: [PATCH] libiberty: fix memory leak in pex-win32.c and refactor

2023-03-01 Thread Richard Biener via Gcc-patches
On Wed, Mar 1, 2023 at 7:14 PM Costas Argyris via Gcc-patches wrote: > > Hi > > It seems that the win32_spawn function in libiberty/pex-win32.c is leaking > the cmdline buffer in 2/3 exit scenarios (it is only free'd in 1/3).The > problem here is that the cleanup code is written 3 times, one a

[pushed] wwwdocs: testing: Avoid a duplicate link

2023-03-01 Thread Gerald Pfeifer
This came up in a conversation with Jan. (We already have a link a bit earlier on that page.) Pushed. Gerald --- htdocs/testing/index.html | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/testing/index.html b/htdocs/testing/index.html index bd6219ab..012ac287 100

Re: [PATCH] debug/108772 - ICE with late debug generated with -flto

2023-03-01 Thread Richard Biener via Gcc-patches
On Wed, 1 Mar 2023, Jason Merrill wrote: > On 3/1/23 08:09, Jakub Jelinek wrote: > > On Wed, Mar 01, 2023 at 01:07:02PM +, Richard Biener wrote: > >> When combining -g1 with -flto we run into the DIE location annotation > >> machinery for globals calling dwarf2out_late_global_decl but not > >>

Re: [PATCH] vect: Check that vector factor is a compile-time constant

2023-03-01 Thread Richard Biener via Gcc-patches
On Wed, Mar 1, 2023 at 10:00 PM Michael Collison wrote: > > Okay there seems to be consensus on using constant_lower_bound (vf), but > I don't understand how that is a replacement for "vf.is_constant ()"? In > one case we are checking if "vf" is a constant, on the other we are > asking for the low

<    1   2