[PATCH] libgfortran: avoid duplicate libraries in spec

2023-12-19 Thread FX Coudert
When gfortran invokes the linker, it reads the linking spec from libgfortran. This ends up doing things like: -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc where you can see that libgcc (both -lgcc and -lgcc_s) is linked in twice. This wasn’t a problem, until the new macOS linker, which gives a warning f

Re: [PATCH] fold-const: Handle AND, IOR, XOR with stepped vectors [PR112971].

2023-12-19 Thread Richard Biener
On Tue, 19 Dec 2023, ??? wrote: > Thanks Robin send initial patch to fix this ICE bug. > > CC to Richard S, Richard B, and Andrew. Just one comment, it seems that VECTOR_CST_STEPPED_P should implicitly include VECTOR_CST_DUPLICATE_P since it would be a step of zero (but as implemented it doesn't

Re: [x86 PATCH] Improved TImode (128-bit) integer constants on x86_64.

2023-12-19 Thread Uros Bizjak
On Mon, Dec 18, 2023 at 6:18 PM Roger Sayle wrote: > > > This patch fixes two issues with the handling of 128-bit TImode integer > constants in the x86_64 backend. The main issue is that GCC always > tries to load 128-bit integer constants via broadcasts to vector SSE > registers, even if the res

Re: [PATCH] strub: use opt_for_fn during ipa

2023-12-19 Thread Richard Biener
On Tue, 19 Dec 2023, Alexandre Oliva wrote: > On Dec 15, 2023, Richard Biener wrote: > > > You have to be generally careful when working within IPA > > with function bodies without push/pop_cfun around that, several APIs > > have variants with struct function sepcified, using the wrong one > > w

Re: [PATCH v2] MIPS: Put the ret to the end of args of reconcat [PR112759]

2023-12-19 Thread Jakub Jelinek
On Tue, Dec 19, 2023 at 09:30:49AM +0800, YunQiang Su wrote: > The function `reconcat` cannot append string(s) to NULL, > as the concat process will stop at the first NULL. > > Let's always put the `ret` to the end, as it may be NULL. > We keep use reconcat here, due to that reconcat can make it >

[PATCH v1] LoongArch: Fix builtin function prototypes for LASX in doc.

2023-12-19 Thread chenxiaolong
gcc/ChangeLog: * doc/extend.texi:According to the documents submitted earlier, Two problems with function return types and using the actual types of parameters instead of variable names were found and fixed. --- gcc/doc/extend.texi | 24 1 file cha

Re: [PATCH] c: Split -Wcalloc-transposed-args warning from -Walloc-size, -Walloc-size fixes

2023-12-19 Thread Jakub Jelinek
On Tue, Dec 19, 2023 at 08:11:11AM +0100, Martin Uecker wrote: > Am Montag, dem 18.12.2023 um 20:14 +0100 schrieb Jakub Jelinek: > > Hi! > > > > The following patch changes -Walloc-size warning to no longer warn > > about int *p = calloc (1, sizeof (int));, because as discussed earlier, > > the si

Re: Re: [PATCH] fold-const: Handle AND, IOR, XOR with stepped vectors [PR112971].

2023-12-19 Thread juzhe.zh...@rivai.ai
Hi,Richard. Do you mean add the check as follows ? if (VECTOR_CST_NELTS_PER_PATTERN (arg1) == 1 && VECTOR_CST_NELTS_PER_PATTERN (arg2) == 3 && integer_zerop (VECTOR_CST_ELT (arg1, 0))) step_ok_p = (code == BIT_AND_EXPR || code == BIT_IOR_EXPR || code ==

RE: [PATCH] aarch64: Fix parens in aarch64_stp_reg_operand [PR113061]

2023-12-19 Thread Kyrylo Tkachov
> -Original Message- > From: Alex Coplan > Sent: Monday, December 18, 2023 10:29 PM > To: gcc-patches@gcc.gnu.org > Cc: Richard Earnshaw ; Richard Sandiford > ; Kyrylo Tkachov > Subject: [PATCH] aarch64: Fix parens in aarch64_stp_reg_operand [PR113061] > > In r14-6603-gfcdd2757c76bf925

[PATCH] i386: Fix mmx.md signbit expanders [PR112816]

2023-12-19 Thread Jakub Jelinek
Hi! Apparently when looking for "signbit2" vector expanders, I've only looked at sse.md and forgot mmx.md, which has two further ones and the following patch still ICEd. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2023-12-19 Jakub Jelinek PR tar

Re: [PATCH] i386: Fix mmx.md signbit expanders [PR112816]

2023-12-19 Thread Uros Bizjak
On Tue, Dec 19, 2023 at 10:00 AM Jakub Jelinek wrote: > > Hi! > > Apparently when looking for "signbit2" vector expanders, I've only > looked at sse.md and forgot mmx.md, which has two further ones and the > following patch still ICEd. > > Fixed thusly, bootstrapped/regtested on x86_64-linux and i

Re: Re: [PATCH] fold-const: Handle AND, IOR, XOR with stepped vectors [PR112971].

2023-12-19 Thread Richard Biener
On Tue, 19 Dec 2023, juzhe.zh...@rivai.ai wrote: > Hi?Richard. Do you mean add the check as follows ? > > if (VECTOR_CST_NELTS_PER_PATTERN (arg1) == 1 > && VECTOR_CST_NELTS_PER_PATTERN (arg2) == 3 Or <= 3 which would allow combining. As said, not sure what == 2 would be and whet

Re: Fwd: [PATCH] LoongArch: Fix FP vector comparsons [PR113034]

2023-12-19 Thread Chenghui Pan
Hi, I checked the correctness of spec2017 and regression test of gcc, it seems ok! On 2023/12/18 17:04, chenglulu wrote: 转发的消息 主题: [PATCH] LoongArch: Fix FP vector comparsons [PR113034] 日期: Sun, 17 Dec 2023 23:12:18 +0800 发件人:Xi Ruoyao 收件人:gcc-patches@gcc.gnu.

[PATCH] aarch64: Validate register operands early in ldp fusion pass [PR113062]

2023-12-19 Thread Alex Coplan
We were missing validation of the candidate register operands in the ldp/stp pass. I was relying on recog rejecting such cases when we formed the final pair insn, but the testcase shows that with -fharden-conditionals we attempt to combine two insns with asm_operands, both containing mem rtxes. T

Re: Re: [PATCH] fold-const: Handle AND, IOR, XOR with stepped vectors [PR112971].

2023-12-19 Thread juzhe.zh...@rivai.ai
Hi, Richard. After investigating the codes: /* Return true if EXPR is the integer constant zero or a complex constant of zero, or a location wrapper for such a constant. */ bool integer_zerop (const_tree expr) { STRIP_ANY_LOCATION_WRAPPER (expr); switch (TREE_CODE (expr)) { case

Re: Re: [PATCH] fold-const: Handle AND, IOR, XOR with stepped vectors [PR112971].

2023-12-19 Thread Jakub Jelinek
On Tue, Dec 19, 2023 at 05:35:14PM +0800, juzhe.zh...@rivai.ai wrote: > I wonder whether we can simplify the codes as follows :? > if (integer_zerop (arg1) || integer_zerop (arg2)) > step_ok_p = (code == BIT_AND_EXPR || code == BIT_IOR_EXPR > || code == BIT_XOR_EX

Re: Re: [PATCH] fold-const: Handle AND, IOR, XOR with stepped vectors [PR112971].

2023-12-19 Thread juzhe.zh...@rivai.ai
>> (x & -1) == x >>(x | -1) == -1 >>(x ^ -1) == ~x Looks reasonable to me. Do you mean modify the code as follows ? if (integer_zerop (arg1) || integer_zerop (arg2)) || integer_onep (arg1) || integer_onep(arg2)) step_ok_p = (code == BIT_AND_EXPR || code == BIT_IOR_EXPR

[PATCH v2 0/3] RISC-V: vectorised memory operations

2023-12-19 Thread Sergei Lewis
This patchset permits generation of inlined vectorised code for movmem, setmem and cmpmem, if and only if the operation size is at least one and at most eight vector registers' worth of data. Further vectorisation rapidly becomes debatable due to code size concerns; however, for these simple cas

[PATCH v2 1/3] RISC-V: movmem for RISCV with V extension

2023-12-19 Thread Sergei Lewis
gcc/ChangeLog * config/riscv/riscv.md (movmem): Use riscv_vector::expand_block_move, if and only if we know the entire operation can be performed using one vector load followed by one vector store gcc/testsuite/ChangeLog PR target/112109 * gcc.target/riscv/rvv/base/movmem-1.

[PATCH v2 3/3] RISC-V: cmpmem for RISCV with V extension

2023-12-19 Thread Sergei Lewis
gcc/ChangeLog: * config/riscv/riscv-protos.h (riscv_vector::expand_vec_cmpmem): New function declaration. * config/riscv/riscv-string.cc (riscv_vector::expand_vec_cmpmem): New function; this generates an inline vectorised memory compare, if and only if we know the entire oper

[PATCH v2 2/3] RISC-V: setmem for RISCV with V extension

2023-12-19 Thread Sergei Lewis
gcc/ChangeLog * config/riscv/riscv-protos.h (riscv_vector::expand_vec_setmem): New function declaration. * config/riscv/riscv-string.cc (riscv_vector::expand_vec_setmem): New function: this generates an inline vectorised memory set, if and only if we know the entire operation

Re: Re: [PATCH] fold-const: Handle AND, IOR, XOR with stepped vectors [PR112971].

2023-12-19 Thread Jakub Jelinek
On Tue, Dec 19, 2023 at 05:49:48PM +0800, juzhe.zh...@rivai.ai wrote: > >> (x & -1) == x > >>(x | -1) == -1 > >>(x ^ -1) == ~x > > Looks reasonable to me. > > Do you mean modify the code as follows ? > >if (integer_zerop (arg1) || integer_zerop (arg2)) || integer_onep > (arg1) || integ

RE: [PATCH 3/21]middle-end: Implement code motion and dependency analysis for early breaks

2023-12-19 Thread Tamar Christina
> > > > + /* Save destination as we go, BB are visited in order and the > > > > last one > > > > + is where statements should be moved to. */ > > > > + if (!dest_bb) > > > > + dest_bb = gimple_bb (c); > > > > + else > > > > + { > > > > + basic_block curr_b

Re: Re: [PATCH] fold-const: Handle AND, IOR, XOR with stepped vectors [PR112971].

2023-12-19 Thread Richard Biener
On Tue, 19 Dec 2023, juzhe.zh...@rivai.ai wrote: > Hi, Richard. > > After investigating the codes: > /* Return true if EXPR is the integer constant zero or a complex constant >of zero, or a location wrapper for such a constant. */ > > bool > integer_zerop (const_tree expr) > { > STRIP_ANY

[PATCH]middle-end: Handle hybrid SLP induction vectorization with early breaks.

2023-12-19 Thread Tamar Christina
Hi All, While we don't support SLP for early break vectorization, we can land in the situation where the induction was vectorized through hybrid SLP. This means when vectorizing the early break live operation we need to get the results of the SLP operation. Bootstrapped Regtested on aarch64-non

Re: [PATCH] aarch64: Validate register operands early in ldp fusion pass [PR113062]

2023-12-19 Thread Richard Sandiford
Alex Coplan writes: > We were missing validation of the candidate register operands in the > ldp/stp pass. I was relying on recog rejecting such cases when we > formed the final pair insn, but the testcase shows that with > -fharden-conditionals we attempt to combine two insns with asm_operands,

Re: [PATCH] aarch64: Validate register operands early in ldp fusion pass [PR113062]

2023-12-19 Thread Alex Coplan
On 19/12/2023 10:15, Richard Sandiford wrote: > Alex Coplan writes: > > We were missing validation of the candidate register operands in the > > ldp/stp pass. I was relying on recog rejecting such cases when we > > formed the final pair insn, but the testcase shows that with > > -fharden-conditio

Re: [PATCH] c: Split -Wcalloc-transposed-args warning from -Walloc-size, -Walloc-size fixes

2023-12-19 Thread Martin Uecker
Am Dienstag, dem 19.12.2023 um 09:47 +0100 schrieb Jakub Jelinek: > On Tue, Dec 19, 2023 at 08:11:11AM +0100, Martin Uecker wrote: > > Am Montag, dem 18.12.2023 um 20:14 +0100 schrieb Jakub Jelinek: > > > Hi! > > > > > > The following patch changes -Walloc-size warning to no longer warn > > > abou

Re: [PATCH] fold-const: Handle AND, IOR, XOR with stepped vectors [PR112971].

2023-12-19 Thread Richard Sandiford
Richard Biener writes: > On Tue, 19 Dec 2023, juzhe.zh...@rivai.ai wrote: > >> Hi, Richard. >> >> After investigating the codes: >> /* Return true if EXPR is the integer constant zero or a complex constant >>of zero, or a location wrapper for such a constant. */ >> >> bool >> integer_zerop

Re: Fwd: [PATCH] LoongArch: Fix FP vector comparsons [PR113034]

2023-12-19 Thread Xi Ruoyao
On Tue, 2023-12-19 at 17:15 +0800, Chenghui Pan wrote: > Hi, I checked the correctness of spec2017 and regression test of gcc, it > seems ok! /* snip */ > > For every RTX code for which the LSX/LASX code is different from the > > scalar code, the scalar code is correct and the LSX/LASX code is w

[Committed] RISC-V: Refine some codes of expand_const_vector [NFC]

2023-12-19 Thread Juzhe-Zhong
gcc/ChangeLog: * config/riscv/riscv-v.cc (expand_const_vector): Use builder.inner_mode (). --- gcc/config/riscv/riscv-v.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc index d1eb7a0a9a5..486f5deb296 1

Re: Re: [PATCH] fold-const: Handle AND, IOR, XOR with stepped vectors [PR112971].

2023-12-19 Thread juzhe.zh...@rivai.ai
OK. I just take a look at match.pd. If we changed bit_and. Do we need to adapt for these 2 ? /* x | ~0 -> ~0 */ (simplify (bit_ior @0 integer_all_onesp@1) @1) /* x | 0 -> x */ (simplify (bit_ior @0 integer_zerop) @0) I am not sure since we currently only face the ICE on BIT_AND for RVV.

Re: [PATCH] c++: Check null pointer deref when calling memfn in constexpr [PR102420]

2023-12-19 Thread Nathaniel Shead
On Mon, Dec 18, 2023 at 01:32:58PM -0500, Jason Merrill wrote: > On 12/17/23 16:51, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > An alternative approach for the lambda issue would be to modify > > 'maybe_add_lambda_conv_op' to not pass a null

[PATCH] LoongArch: Added TLS Le Relax support.

2023-12-19 Thread Lulu Cheng
Check whether the assembler supports tls le relax. If it supports it, the assembly instruction sequence of tls le relax will be generated by default. The original way to obtain the tls le symbol address: lu12i.w $rd, %le_hi20(sym) ori $rd, $rd, %le_lo12(sym) add.{w/d} $rd, $rd, $tp I

[PATCH] Regression FIX: Remove vect_variable_length XFAIL from some tests

2023-12-19 Thread Juzhe-Zhong
Hi, this patch fixes these following regression FAILs on RVV: XPASS: gcc.dg/tree-ssa/pr84512.c scan-tree-dump optimized "return 285;" XPASS: gcc.dg/vect/bb-slp-43.c -flto -ffat-lto-objects scan-tree-dump-not slp2 "vector operands from scalars" XPASS: gcc.dg/vect/bb-slp-43.c scan-tree-dump-not sl

Unify OpenACC/C and C++ behavior re duplicate OpenACC 'declare' directives for 'extern' variables [PR90868] (was: [committed] [PR90868] Document status quo for duplicate OpenACC 'declare' directives f

2023-12-19 Thread Thomas Schwinge
Hi! On 2019-06-19T00:25:49+0200, I wrote: > This doesn't resolve PR90868, but at least in trunk r272445 we now > "Document status quo for duplicate OpenACC 'declare' directives for > 'extern' variables", see attached. > --- a/gcc/testsuite/c-c++-common/goacc/declare-1.c > +++ b/gcc/testsuite/c-c+

[PATCH] RISC-V: Fix FAIL of bb-slp-cond-1.c for RVV

2023-12-19 Thread Juzhe-Zhong
Due to recent VLSmode changes (Change for fixing ICE and run-time FAIL). The dump check is same as ARM SVE now. So adapt test for RISC-V. gcc/testsuite/ChangeLog: * gcc.dg/vect/bb-slp-cond-1.c: Adapt for RISC-V. --- gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c | 4 ++-- 1 file changed, 2

[patch,avr,ping] PR112944: Support .rodata in RAM for AVR64* and AVR128* devices

2023-12-19 Thread Georg-Johann Lay
Ping #1 https://gcc.gnu.org/pipermail/gcc-patches/2023-December/640140.html FYI, Binutils https://sourceware.org/PR31124 us upstream. Johann This is a patch that locates .rodata in flash for some AVR devices that can support it. All new functionality depends on Binutils PR31124 and is switc

RE: [PATCH] Regression FIX: Remove vect_variable_length XFAIL from some tests

2023-12-19 Thread Tamar Christina
Hi Juzhe, > -Original Message- > From: Juzhe-Zhong > Sent: Tuesday, December 19, 2023 11:19 AM > To: gcc-patches@gcc.gnu.org > Cc: rguent...@suse.de; Tamar Christina ; Juzhe- > Zhong > Subject: [PATCH] Regression FIX: Remove vect_variable_length XFAIL from some > tests > > Hi, this patc

Re: [PATCH] RISC-V: Fix FAIL of bb-slp-cond-1.c for RVV

2023-12-19 Thread Richard Biener
On Tue, 19 Dec 2023, Juzhe-Zhong wrote: > Due to recent VLSmode changes (Change for fixing ICE and run-time FAIL). > > The dump check is same as ARM SVE now. So adapt test for RISC-V. OK. > gcc/testsuite/ChangeLog: > > * gcc.dg/vect/bb-slp-cond-1.c: Adapt for RISC-V. > > --- > gcc/test

[PATCH] tree-optimization/113073 - amend PR112736 fix

2023-12-19 Thread Richard Biener
The PR112736 testcase fails on RISC-V because the aligned exception uses the wrong check. The alignment support scheme can be dr_aligned even when the access isn't aligned to the vector size but some targets are happy with element alignment. The following fixes that. Bootstrapped and tested on x

[PATCH] tree-optimization/113080 - missing final value replacement

2023-12-19 Thread Richard Biener
When performing final value replacement we guard against exponential (temporary) code growth due to unsharing of trees (SCEV heavily relies on tree sharing). The following relaxes this a tiny bit to cover some more optimizations and puts in comments as to what the real fix would be. Bootstrapped

Re: [PATCH] LoongArch: Added TLS Le Relax support.

2023-12-19 Thread Xi Ruoyao
On Tue, 2023-12-19 at 19:04 +0800, Lulu Cheng wrote: > +(define_insn "@add_tls_le_relax" > +  [(set (match_operand:P 0 "register_operand" "=r") > +   (unspec:P [(match_operand:P 1 "register_operand" "r") > +  (match_operand:P 2 "register_operand" "r") > +   (match_op

Re: [PATCH]middle-end: Handle hybrid SLP induction vectorization with early breaks.

2023-12-19 Thread Richard Biener
On Tue, 19 Dec 2023, Tamar Christina wrote: > Hi All, > > While we don't support SLP for early break vectorization, we > can land in the situation where the induction was vectorized > through hybrid SLP. This means when vectorizing the early > break live operation we need to get the results of t

Re: [PATCH] Optimize A < B ? A : B to MIN_EXPR.

2023-12-19 Thread Richard Biener
On Tue, Dec 19, 2023 at 6:39 AM liuhongt wrote: > > Similar for A < B ? B : A to MAX_EXPR. > There're codes in the frontend to optimize such pattern but failed to > handle testcase in the PR since it's exposed at gimple level when > folding backend builtins. > > pr95906 now can be optimized to MAX

Re: [PATCH] LoongArch: Added TLS Le Relax support.

2023-12-19 Thread chenglulu
在 2023/12/19 下午8:37, Xi Ruoyao 写道: On Tue, 2023-12-19 at 19:04 +0800, Lulu Cheng wrote: +(define_insn "@add_tls_le_relax" +  [(set (match_operand:P 0 "register_operand" "=r") +   (unspec:P [(match_operand:P 1 "register_operand" "r") +  (match_operand:P 2 "register_operand"

Re: RE: [PATCH] Regression FIX: Remove vect_variable_length XFAIL from some tests

2023-12-19 Thread 钟居哲
Do you mean for ARM SVE, these tests need to be specified as only ARM SVE ? Actually, for RVV, is same situation as ARM. We are using VLS modes (fixed-length vectors) to vectorize these cases so that they are XPASS. The difference between RVV and ARM is that: variable-length and fixed-length ve

RE: RE: [PATCH] Regression FIX: Remove vect_variable_length XFAIL from some tests

2023-12-19 Thread Tamar Christina
> Do you mean for ARM SVE, these tests need to be specified as only ARM SVE ? I think that would be the right thing to do. I think these tests are checking if we support VLA SLP. changing it to a PASS unconditionally means that if someone runs the testsuite in SVE only mode they’ll fail. > The

Re: [PATCH] aarch64: Validate register operands early in ldp fusion pass [PR113062]

2023-12-19 Thread Richard Sandiford
Alex Coplan writes: > On 19/12/2023 10:15, Richard Sandiford wrote: >> Alex Coplan writes: >> > We were missing validation of the candidate register operands in the >> > ldp/stp pass. I was relying on recog rejecting such cases when we >> > formed the final pair insn, but the testcase shows that

Re: [PATCH] aarch64: Validate register operands early in ldp fusion pass [PR113062]

2023-12-19 Thread Alex Coplan
On 19/12/2023 13:38, Richard Sandiford wrote: > Alex Coplan writes: > > On 19/12/2023 10:15, Richard Sandiford wrote: > >> Alex Coplan writes: > >> > We were missing validation of the candidate register operands in the > >> > ldp/stp pass. I was relying on recog rejecting such cases when we > >>

RE: [PATCH 3/21]middle-end: Implement code motion and dependency analysis for early breaks

2023-12-19 Thread Richard Biener
On Tue, 19 Dec 2023, Tamar Christina wrote: > > > > > + /* Save destination as we go, BB are visited in order and the > > > > > last one > > > > > + is where statements should be moved to. */ > > > > > + if (!dest_bb) > > > > > + dest_bb = gimple_bb (c); > > > > > + else >

RE: RE: [PATCH] Regression FIX: Remove vect_variable_length XFAIL from some tests

2023-12-19 Thread Richard Biener
On Tue, 19 Dec 2023, Tamar Christina wrote: > > Do you mean for ARM SVE, these tests need to be specified as only ARM SVE ? > > I think that would be the right thing to do. I think these tests are > checking if we support VLA SLP. > changing it to a PASS unconditionally means that if someone ru

[COMMITTED] ada: Further cleanup in finalization machinery

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou This streamlines the submachinery that makes it so that the finalization of temporaries created for EWAs and conditional expressions is deferred to the enclosing context. The original implementation was using a deep tree traversal for EWAs, which was later restricted to immed

[COMMITTED] ada: Illegal instance of Generic_1.Generic_2 incorrectly accepted

2023-12-19 Thread Marc Poulhiès
From: Steve Baird If G1 is a generic package and G1.G2 is a child unit (also a generic package) then it would be illegal if some third generic unit (declared outside of G1) takes a formal instance of G1.G2, as in "with package I2 is new G1.G2;". This construct was incorrectly accepted in some cas

[COMMITTED] ada: Cleanup SPARK legality checking

2023-12-19 Thread Marc Poulhiès
From: Yannick Moy Move one SPARK legality check from GNAT to GNATprove, and cleanup other uses of SPARK_Mode for legality checking. gcc/ada/ * sem_ch4.adb (Analyze_Selected_Component): Check correct mode variable for GNATprove. * sem_prag.adb (Refined_State): Call SPARK_

[COMMITTED] ada: Restore object constraint optimization

2023-12-19 Thread Marc Poulhiès
From: Ronan Desplanques This patch relaxes the requirement that discriminants values should be known at compile time for a particular optimization to be applied. That optimization is the one that treats an unconstrained object as constrained when the object is of a limited type, in order to reduc

[COMMITTED] ada: Plug small loophole in finalization machinery

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou The path in Expand_N_If_Expression implementing the special optimization for an unidimensional array type and dependent expressions with static bounds fails to call Process_Transients_In_Expression on their list of actions. gcc/ada/ * exp_ch4.adb (Expand_N_If_Express

[COMMITTED] ada: Adapt Ada.Command_Line to work on configurable runtimes

2023-12-19 Thread Marc Poulhiès
From: Patrick Bernardi The behaviour of the binder when handling command line arguments and exit codes is simplified so that references to the corresponding runtime symbols are always generated when the runtime is configured with command line argument and exit code support. This allows Ada.Comman

[COMMITTED] ada: Cope with Sem_Util.Enclosing_Declaration oddness.

2023-12-19 Thread Marc Poulhiès
From: Steve Baird Sem_Util.Enclosing_Declaration can return a non-empty result which is not a declaration; clients may need to compensate for the case where an N_Subprogram_Specification node is returned. One such client is the function Is_Actual_Subp_Of_Inst. gcc/ada/ * sem_ch8.adb (Is

[COMMITTED] ada: Fix SPARK expansion of container aggregates

2023-12-19 Thread Marc Poulhiès
From: Yannick Moy GNATprove supports container aggregates, except for indexed aggregates. It needs all expressions to have suitable target types and Do_Range_Check flags, which are added by the special expansion for GNATprove. There is no impact on code generation. gcc/ada/ * exp_spark

[COMMITTED] ada: Fix spurious visibility error on parent's component in instance

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou This occurs for an aggregate of a derived tagged type in the body of the instance, because the full view of the parent type, which was visible in the generic construct (otherwise the aggregate would have been illegal), is not restored in the body of the instance. Copy_Generic

[COMMITTED] ada: Remove No_Dynamic_Priorities from Restricted_Tasking

2023-12-19 Thread Marc Poulhiès
From: Johannes Kliemann Some of our restricted runtimes support dynamic priorities. The binder needs to generate code for a restricted runtime even if the restriction No_Dynamic_Priorities is not in place. gcc/ada/ * libgnat/s-rident.ads: Remove No_Dynamic_Priorities from Restri

[COMMITTED] ada: Ignore unconstrained components as inputs for Depends

2023-12-19 Thread Marc Poulhiès
From: Piotr Trojanek The current wording of SPARK RM 6.1.5(5) about the inputs for the Depends contract doesn't mention "a record with at least one unconstrained component". gcc/ada/ * sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Update comment and body. Tested on x86_64-pc-

[COMMITTED] ada: Fix crash on concurrent type aggregate

2023-12-19 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, the compiler would fail to examine the corresponding record types of concurrent types when building aggregate components. This patch fixes this, and adds a precondition and additional documentation on the subprogram that triggered the crash, as it never

[COMMITTED] ada: Add makefile targets for building/installing html doc

2023-12-19 Thread Marc Poulhiès
Add the ada.html and ada.install-html targets so that we can build the html with `make html`. gcc/ada/ * gcc-interface/Make-lang.in (ada.html, ada.install-html): Add. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/Make-lang.in | 35 +++

[COMMITTED] ada: Remove unreferenced utility routine Get_Logical_Line_Number_Img

2023-12-19 Thread Marc Poulhiès
From: Piotr Trojanek Routine Get_Logical_Line_Number_Img was introduced for splitting of Pre/Post contracts, but subsequent patch for that feature removed its only use. It was then used by GNATprove, but that use is now removed as well. gcc/ada/ * sinput.adb, sinput.ads (Get_Logical_Lin

[COMMITTED] ada: Fix style and typos in comments

2023-12-19 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup. gcc/ada/ * exp_ch9.adb, sem_ch10.adb, sem_util.adb: Fix comments. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch9.adb | 4 ++-- gcc/ada/sem_ch10.adb | 2 +- gcc/ada/sem_util.adb | 2 +- 3 files changed, 4 insertions(+), 4 de

[COMMITTED] ada: Further cleanup in finalization machinery

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou This removes the setting of the Is_Ignored_Transient flag on the temporaries needing finalization created by Expand_Ctrl_Function_Call when invoked from within the dependent expressions of conditional expressions. This flag tells the general finalization machinery to disregar

[COMMITTED] ada: Compiler hangs on container aggregate with function call as key expression

2023-12-19 Thread Marc Poulhiès
From: Gary Dismukes The compiler hangs (or may crash, if assertions are enabled) when compiling an iterated association of a container aggregate that has a key expression given by a function call. The resolution of the call leads to a blowup in Build_Call_Marker, because the temporary copy of the

[COMMITTED] ada: Optimize performance and remove dynamic frame requirement.

2023-12-19 Thread Marc Poulhiès
From: Vasiliy Fofanov gcc/ada/ * libgnat/i-cstrin.adb (Value): Optimize. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/i-cstrin.adb | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/gcc/ada/libgnat/i-cstrin.adb b/gcc/ada/l

[COMMITTED] ada: Check all interfaces for valid iterator type

2023-12-19 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ * sem_ch13.adb (Valid_Default_Iterator): Check all interfaces for valid iterator type. Also improve error reporting. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch13.adb | 103 +-- 1 fi

[COMMITTED] ada: Rework comment in Expand_Ctrl_Function_Call

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou This expands on the reason for properly guarding the transformation. gcc/ada/ * exp_ch6.adb (Expand_Ctrl_Function_Call): Rework last comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch6.adb | 7 ++- 1 file changed, 6 insertions(+),

[COMMITTED] ada: Add missing guard to previous change

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou Ancestor_Type is overloaded with Aggregate_Bounds on N_Aggregate nodes so its access needs to be guarded in Copy_Generic_Node. gcc/ada/ * sem_ch12.adb (Copy_Generic_Node): Add guard for Ancestor_Type. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada

[COMMITTED] ada: Rename Is_Constr_Subt_For_UN_Aliased flag

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou The flag is set on the constructed subtype of an object with unconstrained nominal subtype that is aliased and is used by the code generator to adjust the layout of the object. But it is actually only used for array subtypes, where it determines whether the object is allocate

[COMMITTED] ada: gnatbind: Do not generate Ada.Command_Line references when not used

2023-12-19 Thread Marc Poulhiès
From: Patrick Bernardi It was previously assumed that configurable runtimes could not return exit statuses, however this assumption no longer holds. Instead, only import the required symbols from Ada.Command_Line's support packages if Ada.Command_Line is in the closure of the partition when a con

[COMMITTED] ada: Remove GNATcheck violations

2023-12-19 Thread Marc Poulhiès
From: Sheri Bernstein Remove GNATcheck violations by refactoring code and also using pragma Annotate to exempt them. gcc/ada/ * libgnat/a-comlin.adb (Argument_Count): Rewrite code so there is only one return, to remove Improper_Returns violation. (Command_Name): Add prag

[COMMITTED] ada: Missing error on positional container aggregates for types with Add_Named

2023-12-19 Thread Marc Poulhiès
From: Gary Dismukes The compiler fails to reject a container aggregate written using positional notation when the container type specifies an Add_Named operation in its Aggregate aspect. Container aggregates for such types must be written using named associations. The compiler ignores the positio

[COMMITTED] ada: Fix internal error on call with parameter of predicated subtype

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou The problem is that the predicated subtype does not inherit all the required attributes of a string subtype with a static predicate. gcc/ada/ * sem_ch3.adb (Analyze_Subtype_Declaration): Remove a short-circuit for subtypes without aspects when it comes to pre

Re: [PATCH 2/3] Add generated .opt.urls files

2023-12-19 Thread Marc Poulhiès
Marc Poulhiès writes: >> Perhaps this script could also deal directly with Sphinx-generated >> HTML? > > I investigated a bit... The Ada part doesn't handle the html target, so > it's expected you don't have anything to parse. The online docs are > generated using a different script, not using t

Re: [PATCH v7 5/5] OpenMP/OpenACC: Reorganise OMP map clause handling in gimplify.cc

2023-12-19 Thread Tobias Burnus
Hi Julian, On 16.12.23 14:25, Julian Brown wrote: OpenMP/OpenACC: Reorganise OMP map clause handling in gimplify.cc This patch has been separated out from the C++ "declare mapper" support patch. It contains just the gimplify.cc rearrangement work, mostly moving gimplificati

Re: [PATCH v2] RISC-V: Supports RISC-V Profiles in '-march' option.

2023-12-19 Thread Palmer Dabbelt
On Tue, 12 Dec 2023 04:08:09 PST (-0800), jia...@iscas.ac.cn wrote: Supports RISC-V profiles[1] in -march option. Default input set the profile is before other formal extensions. V2: Fixes some format errors and adds code comments for parse function Thanks for Jeff Law's review and comments. [

Re: [PATCH] c: Split -Wcalloc-transposed-args warning from -Walloc-size, -Walloc-size fixes

2023-12-19 Thread Jason Merrill
On 12/19/23 03:47, Jakub Jelinek wrote: On Tue, Dec 19, 2023 at 08:11:11AM +0100, Martin Uecker wrote: Am Montag, dem 18.12.2023 um 20:14 +0100 schrieb Jakub Jelinek: Hi! The following patch changes -Walloc-size warning to no longer warn about int *p = calloc (1, sizeof (int));, because as dis

[PATCH] tree-object-size: Clean up unknown propagation

2023-12-19 Thread Siddhesh Poyarekar
Narrow down scope of the unknowns bitmap so that it is only accessible within the reexamination process. This also removes any role of unknown propagation from object_sizes_set, thus simplifying that code path a bit. gcc/ChangeLog: * tree-object-size.cc (object_size_info): Remove UNKNOWN

Re: [PATCH] btf: change encoding of forward-declared enums [PR111735]

2023-12-19 Thread Indu Bhagat
On 12/12/23 14:35, David Faust wrote: The BTF specification does not formally define a representation for forward-declared enum types such as: enum Foo; Forward-declarations for struct and union types are represented by BTF_KIND_FWD, which has a 1-bit flag distinguishing the two. The de-fac

Ping Re: [PATCH] contrib: add git gcc-style alias

2023-12-19 Thread Jason Merrill
On 12/11/23 22:00, Jason Merrill wrote: OK for trunk? Ping. CCing Alex because this could plausibly be considered build machinery, and he's had useful feedback on my sh code before. -- 8< -- I thought it could be easier to use check_GNU_style.py. With this alias, 'git gcc-style' will tak

Re: [PATCH] c: Split -Wcalloc-transposed-args warning from -Walloc-size, -Walloc-size fixes

2023-12-19 Thread Martin Uecker
Am Dienstag, dem 19.12.2023 um 12:20 -0500 schrieb Jason Merrill: > On 12/19/23 03:47, Jakub Jelinek wrote: > > On Tue, Dec 19, 2023 at 08:11:11AM +0100, Martin Uecker wrote: > > > Am Montag, dem 18.12.2023 um 20:14 +0100 schrieb Jakub Jelinek: > > > > Hi! > > > > > > > > The following patch chang

Re: [pushed] c++: array DMI and member fn [PR109666]

2023-12-19 Thread Patrick Palka
On Mon, 1 May 2023, Jason Merrill wrote: > Tested x86_64-pc-linux-gnu, applying to trunk. > > Patrick, can you verify that this resolves 109506 and add whatever testcase(s) > seem appropriate from that PR? > > -- 8< -- > > Here it turns out I also needed to adjust cfun when stepping out of the

Re: [PATCH] c: Split -Wcalloc-transposed-args warning from -Walloc-size, -Walloc-size fixes

2023-12-19 Thread Joseph Myers
On Mon, 18 Dec 2023, Jakub Jelinek wrote: > Hi! > > The following patch changes -Walloc-size warning to no longer warn > about int *p = calloc (1, sizeof (int));, because as discussed earlier, > the size is IMNSHO sufficient in that case, for alloc_size with 2 > arguments warns if the product of

Re: [pushed] c++: array DMI and member fn [PR109666]

2023-12-19 Thread Jason Merrill
On 12/19/23 14:08, Patrick Palka wrote: On Mon, 1 May 2023, Jason Merrill wrote: Tested x86_64-pc-linux-gnu, applying to trunk. Patrick, can you verify that this resolves 109506 and add whatever testcase(s) seem appropriate from that PR? -- 8< -- Here it turns out I also needed to adjust cfu

Re: [PATCH 1/5] OpenMP, NVPTX: memcpy[23]D bias correction

2023-12-19 Thread Tobias Burnus
Hi Julian & Thomas, the patch LGTM - and seemingly also Thomas is somewhat fine with it - and it includes the stand-alone testcase. * * * I guess, you don't know the answer to Thomas question, i.e. whether that's a bug in CUDA or in our use of the CUDA API? CUDA's spec itself, https://docs.nvi

Fwd: [PATCH] gprofng: a new GNU profiler

2023-12-19 Thread Vladimir Mezentsev
PING. If the patch is approved, can anyone apply this patch. I don't have permissions for `git push`. Thank you, -Vladimir Forwarded Message Subject:[PATCH] gprofng: a new GNU profiler Date: Wed, 13 Dec 2023 17:23:01 -0800 From: vladimir.mezent...@oracle.com To:

Re: [V5] [C PATCH 1/4] c23: tag compatibility rules for struct and unions

2023-12-19 Thread Joseph Myers
On Sun, 17 Dec 2023, Martin Uecker wrote: > Here is the revised series. The first three patches only > have changes in the tests as well as the return value > changes.   The fourth patch was now also revised, > with changes and tests to make sure that the composite > type works correctly for bit-

Re: [V5] [C PATCH 2/4] c23: tag compatibility rules for enums

2023-12-19 Thread Joseph Myers
On Sun, 17 Dec 2023, Martin Uecker wrote: > diff --git a/gcc/testsuite/gcc.dg/c23-tag-enum-1.c > b/gcc/testsuite/gcc.dg/c23-tag-enum-1.c > new file mode 100644 > index 000..a81a5afc456 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/c23-tag-enum-1.c > +void test2(void) > +{ > + enum ee *a;

Re: [V5] [C PATCH 3/4] c23: aliasing of compatible tagged types

2023-12-19 Thread Joseph Myers
On Sun, 17 Dec 2023, Martin Uecker wrote: > +/* While tese tests check that incompatible definitions > + * of enums can alias. */ s/tese/these/ Patch 3 is OK with that fix. -- Joseph S. Myers jos...@codesourcery.com

[PATCH RFA] opts: -Werror=foo always implies -Wfoo [PR106213]

2023-12-19 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, OK for trunk? -- 8< -- -Werror=foo implying -Wfoo wasn't working for -Wdeprecated-copy-dtor, because it is specified as the value 2 of warn_deprecated_copy, which shows up as CLVC_EQUAL, which is not one of the three var_types handled by control_warning_option. It see

[PATCH] sccopy: remove unused data member [PR113069]

2023-12-19 Thread Marek Polacek
Should be obvious, but... tested on x86_64, ok for trunk? -- >8 -- PR tree-optimization/113069 gcc/ChangeLog: * gimple-ssa-sccopy.cc (scc_discovery): Remove unused member. --- gcc/gimple-ssa-sccopy.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/gcc/gimple-ssa-sccopy.cc

Re: [V5] [C PATCH 4/4] c23: construct composite type for tagged types

2023-12-19 Thread Joseph Myers
On Sun, 17 Dec 2023, Martin Uecker wrote: > + tree f = build_decl (input_location, FIELD_DECL, DECL_NAME (a), > +composite_type_internal (ta, tb, cache)); > + > + DECL_PACKED (f) = DECL_PACKED (a); > + SET_DECL_ALIGN (f, DECL_ALIGN (a))

Re: [PATCH] sccopy: remove unused data member [PR113069]

2023-12-19 Thread Jakub Jelinek
On Tue, Dec 19, 2023 at 05:19:35PM -0500, Marek Polacek wrote: > Should be obvious, but... tested on x86_64, ok for trunk? > > -- >8 -- > > PR tree-optimization/113069 > > gcc/ChangeLog: > > * gimple-ssa-sccopy.cc (scc_discovery): Remove unused member. Ok, thanks. > diff --git a/

Re: [PATCH] tree-object-size: Always set computed bit for bdos [PR113012]

2023-12-19 Thread Jakub Jelinek
On Mon, Dec 18, 2023 at 11:42:52AM -0500, Siddhesh Poyarekar wrote: > It is always safe to set the computed bit for dynamic object sizes at > the end of collect_object_sizes_for because even in case of a dependency > loop encountered in nested calls, we have an SSA temporary to actually > finish th

ping^2: [PATCH] diagnostics: Fix behavior of permerror options after diagnostic pop [PR111918]

2023-12-19 Thread Lewis Hyatt
Hello- May I please ping this one? Thanks... https://gcc.gnu.org/pipermail/gcc-patches/2023-November/638692.html -Lewis On Wed, Nov 29, 2023 at 7:05 PM Lewis Hyatt wrote: > > On Thu, Nov 09, 2023 at 04:16:10PM -0500, Lewis Hyatt wrote: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111918 > >

  1   2   >