[Ada] Remove kludge for validity checks on Long_Float type

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
This patch reverts a fix for a spurious warning for validity checks on type Long_Float. This fix was dubious (as it was only affecting Long_Float and not Float) and apparently is no longer needed. Cleanup related to improved detection of uninitialised scalar objects. Tested on

Re: [PATCH] Mips: Enable asynchronous unwind tables with both ASAN and TSAN

2022-07-05 Thread Xi Ruoyao via Gcc-patches
On Tue, 2022-07-05 at 12:51 +0800, Xi Ruoyao via Gcc-patches wrote: > I agree it's fine, but the problem is TSAN is currently "unsupported" > within GCC (i. e. when you build gcc libtsan is not built).  So it > does > not make any benefit to commit this change before making TSAN > supported > on

Re: [PATCH][wwwdocs] gcc-12/changes.html: document LoongArch -m{no-,}check-zero-division default change for 12.2

2022-07-05 Thread Gerald Pfeifer
On Mon, 4 Jul 2022, Xi Ruoyao wrote: > Document a behavior change in r12-8546. Ok for wwwdocs? Thanks also for including the GCC 12.2 bug query as part of this. :) Gerald

[11, committed] d: Fix error: aggregate value used where floating point was expected (PR106139)

2022-07-05 Thread Iain Buclaw via Gcc-patches
Hi, This is the GCC-11 backport of the fix for PR106139 posted last week. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, and committed to releases/gcc-11. Regards, Iain. --- PR d/106139 gcc/d/ChangeLog: * d-convert.cc (convert_expr): Handle casting from

[PATCH] tree-optimization/106186 - propagate out virtual LC PHI nodes properly

2022-07-05 Thread Richard Biener via Gcc-patches
The code to remove LC PHI nodes in clean_up_loop_closed_phi does not handle virtual operands because may_propagate_copy generally returns false for them. The following copies the merge_blocks variant for dealing with them. This fixes a missed jump threading in gcc.dg/auto-init-uninit-4.c which

[PATCH] Remove dead loop-based LC SSA rewrite

2022-07-05 Thread Richard Biener via Gcc-patches
The following removes the now unused per-loop path in LC SSA rewrite. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-ssa-loop-manip.cc (find_uses_to_rename_def): Remove. (find_uses_to_rename_in_loop): Likewise. (rewrite_into_loop_closed_ssa_1): Remove

[Ada] Fix spurious error on object renaming with ghost type

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Renaming of an object of ghost type leads to a spurious error. Now fixed. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * ghost.adb (Is_OK_Ghost_Context): Detect ghost type inside object renaming.diff --git a/gcc/ada/ghost.adb b/gcc/ada/ghost.adb ---

[Ada] qnx-7.1: ACATS cxag001 failure on qnx - realpath

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
The implementation of __gnat_full_name uses the CRTL realpath, however this function returns a null string so use the default implementation instead. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * cstreams.c (__gnat_full_name) [QNX]: Remove block.diff --git

[Ada] Couple of small cleanups for Cloned_Subtype

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_util.adb (Make_Subtype_From_Expr): Do not set field to Empty. * sem_util.adb (Visit_Itype): Remove ??? comment.diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb ---

Re: [PATCH] libstdc++: testsuite: avoid predictable mkstemp

2022-07-05 Thread Alexandre Oliva via Gcc-patches
On Jun 27, 2022, Alexandre Oliva wrote: > On Jun 23, 2022, Jonathan Wakely wrote: >> The attached makes this a bit more efficient, and makes more of the >> code common to the mkstemp and non-mkstmp branches. I'll wait to hear >> back from you before pushing it (since it has Joel's name on the

[PATCH] tree-optimization/106198 - CFG cleanup vs LC SSA

2022-07-05 Thread Richard Biener via Gcc-patches
This is another case like PR106182 where for the 2nd testcase in the bug there are no removed or discovered loops but still changing loop exits invalidates LC SSA and it is not enough to just scan for uses in the blocks that changed loop depth. One might argue that if we'd include former exit

[Ada] Reorder processing of default expressions to avoid repeated calls

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup related to improved detection of uninitialised objects; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch6.adb (Process_Formals): Avoid repeated calls to Expression.diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb ---

[Ada] Remove repeated setting of Never_Set_In_Source

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Formal parameters have their flag Never_Set_In_Source set at the beginning of Process_Formals routine (regardless of the parameter mode). There is no need to set it again when Process_Formals calls Set_Formal_Mode (for parameters of mode IN OUT and OUT). Code cleanup related to improved detection

Re: [PATCH] aarch64: testsuite: symbol-range compile only

2022-07-05 Thread Alexandre Oliva via Gcc-patches
On Jun 30, 2022, Hans-Peter Nilsson wrote: > On Thu, 23 Jun 2022, Alexandre Oliva via Gcc-patches wrote: >> +proc check_effective_target_two_plus_gigs { } { >> +return [check_no_compiler_messages two_plus_gigs executable { >> +int dummy[0x8000]; > Don't you mean "char" as in "char

Re: [PATCH] Mips: Enable asynchronous unwind tables with both ASAN and TSAN

2022-07-05 Thread Xi Ruoyao via Gcc-patches
On Mon, 2022-07-04 at 21:21 -0700, Fangrui Song wrote: > > > > > > > FAIL: c-c++-common/tsan/tls_race.c   -O0  output pattern test > > > > Output was: > > > > ThreadSanitizer: CHECK failed: tsan_platform_linux.cpp:452 > > > > "((thr_end)) <= ((tls_addr + tls_size))" (0xffec35f8c0, > > > >

Re: [PATCH] c++: generic targs and identity substitution [PR105956]

2022-07-05 Thread Patrick Palka via Gcc-patches
On Fri, 1 Jul 2022, Jason Merrill wrote: > On 6/29/22 13:42, Patrick Palka wrote: > > In r13-1045-gcb7fd1ea85feea I assumed that substitution into generic > > DECL_TI_ARGS corresponds to an identity mapping of the given arguments, > > and hence its safe to always elide such substitution. But

[Ada] Warn about obsolete uses of renamed Ada 83 packages

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Ada 83 packages like Unchecked_Conversion or Text_IO are obsolete since Ada 95. GNAT now warns about their uses when warnings on obsolescent featured (Annex J) is active. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst

[10, committed] d: Fix error: aggregate value used where floating point was expected (PR106139)

2022-07-05 Thread Iain Buclaw via Gcc-patches
Hi, This is the GCC-10 backport of the fix for PR106139 posted last week. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, and committed to releases/gcc-10. Regards, Iain. --- PR d/106139 gcc/d/ChangeLog: * d-convert.cc (convert_expr): Handle casting from

Re: [PATCH 4/12] arm: Add testsuite library support for PACBTI target

2022-07-05 Thread Richard Earnshaw via Gcc-patches
On 04/07/2022 15:47, Andrea Corallo wrote: Richard Earnshaw writes: On 01/07/2022 14:03, Richard Earnshaw via Gcc-patches wrote: On 28/04/2022 10:40, Andrea Corallo via Gcc-patches wrote: Add targeting-checking entities for PACBTI in testsuite framework. Pre-approved with the requested

Re: [PATCH] Maintain LC SSA when doing SVE vectorization

2022-07-05 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > The final loop IV use after the loop has that not in LC SSA > (and inserts not simplified _2 = _3 - 0 stmts). In particular > since it splits the exit edge when there's a virtual PHI in the > destination it breaks virtual LC SSA form (but likely also > non-virtual). > >

[Ada] Fix comments mentioning ancient flags related to objects references

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Flag May_Be_Modified under go a series of renamings between 1996 and 2002. It was changed to Not_Assigned, then to Not_Source_Assigned and finally to Never_Set_In_Source. Fix remaining references in comments. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.ads

[Ada] Remove use of a global name buffer when locating a file

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * osint.adb (Locate_File): Use Name_Find with a parameter and not with a global buffer.diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb --- a/gcc/ada/osint.adb +++

[PATCH] tree-optimization/106196 - properly update virtual SSA for vector stores

2022-07-05 Thread Richard Biener via Gcc-patches
The following properly handles aggregate returns of the const marked STORE_LANES internal function to update virtual SSA form on-the-fly rather than relying on a costly virtual SSA rewrite. Bootstrap and regtest running on x86_64-unknown-linux-gnu. PR tree-optimization/106196 *

[Ada] Fix dangling bounds for array result of BIP functions

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
The implementation of the build-in-place return protocol for functions whose result type is an unconstrained array type generates dangling references to local bounds built on the stack for the result as soon as these bounds are not static. The reason is that the implementation treats the return

[Ada] Reuse Get_Pragma_Arg to handle pragma argument associations

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup related to looking at pragma Thread_Local_Storage. Semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch3.adb (Build_Init_Statements): Reuse Get_Pragma_Arg. * exp_prag.adb (Arg_N): Likewise.diff --git a/gcc/ada/exp_ch3.adb

Re: [PATCH] libstdc++: testsuite: avoid predictable mkstemp

2022-07-05 Thread Jonathan Wakely via Gcc-patches
On Tue, 5 Jul 2022 at 10:10, Alexandre Oliva via Libstdc++ wrote: > > On Jun 27, 2022, Alexandre Oliva wrote: > > > On Jun 23, 2022, Jonathan Wakely wrote: > >> The attached makes this a bit more efficient, and makes more of the > >> code common to the mkstemp and non-mkstmp branches. I'll wait

[PING] nvptx: Allow '--with-arch' to override the default '-misa' (was: nvptx multilib setup)

2022-07-05 Thread Thomas Schwinge
Hi Tom! Ping. Grüße Thomas On 2022-06-15T23:18:10+0200, I wrote: > Hi Tom! > > On 2022-05-13T16:20:14+0200, I wrote: >> On 2022-02-04T13:09:29+0100, Tom de Vries via Gcc wrote: >>> On 2/4/22 08:21, Thomas Schwinge wrote: On 2022-02-03T13:35:55+, "vries at gcc dot gnu.org via

Re: [PATCH 2/2] analyzer: reorder initialization of state m_invalid in sm-fd.cc [PR106184]

2022-07-05 Thread David Malcolm via Gcc-patches
On Tue, 2022-07-05 at 23:08 +0530, Mir Immad wrote: > From 3de908fa0c3e515b49df24460f85924211802d6c Mon Sep 17 00:00:00 > 2001 > From: Immad Mir > Date: Tue, 5 Jul 2022 21:21:13 +0530 > Subject: [PATCH 2/2] analyzer: reorder initialization of state > m_invalid in >  sm-fd.cc [PR106184] > > This

[r13-1509 Regression] FAIL: gcc.target/i386/pr65105-5.c scan-assembler ptest on Linux/x86_64

2022-07-05 Thread skpandey--- via Gcc-patches
On Linux/x86_64, c73e8d45ca0111f51d7187641963df97f5c9c63f is the first bad commit commit c73e8d45ca0111f51d7187641963df97f5c9c63f Author: Roger Sayle Date: Tue Jul 5 18:06:13 2022 +0100 Doubleword version of and;cmp to not;test optimization on x86. caused FAIL:

Floating-point allocation sizes? (was Re: [PATCH] analyzer: Fix handling of non-ints inside allocation size checker [PR106181])

2022-07-05 Thread David Malcolm via Gcc-patches
On Tue, 2022-07-05 at 21:49 +0200, Tim Lange wrote: > This patch fixes the ICE reported in PR106181 by Arseny Solokha. With > this patch, the allocation size checker tries to handle floating-point > operands of allocation size arguments. Constant sizes get implicitly > converted and symbolic sizes

Go patch committed: Propagate array length error marker

2022-07-05 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend propagates the array length error marker farther, to avoid a compiler crash on invalid code. This fixes https://go.dev/issue/53639. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian c70a48a8f8f6a43b35f783b5672c9a3c0a363c31 diff

Re: [PATCH 1/2] analyzer: show close event for use_after_close diagnostic

2022-07-05 Thread David Malcolm via Gcc-patches
On Tue, 2022-07-05 at 23:07 +0530, Mir Immad wrote: [...snip...] >  gcc/analyzer/sm-fd.cc    | 13 +++-- >  gcc/testsuite/gcc.dg/analyzer/fd-4.c |  4 ++-- >  2 files changed, 13 insertions(+), 4 deletions(-) > > diff --git a/gcc/analyzer/sm-fd.cc b/gcc/analyzer/sm-fd.cc >

Re: [PATCH] c++, v3: Add support for __real__/__imag__ modifications in constant expressions [PR88174]

2022-07-05 Thread Jakub Jelinek via Gcc-patches
On Tue, Jul 05, 2022 at 04:44:41PM -0400, Jason Merrill wrote: > On 7/4/22 11:50, Jakub Jelinek wrote: > > On Mon, Jun 27, 2022 at 06:31:18PM +0200, Jakub Jelinek via Gcc-patches > > wrote: > > > > > Hmm, why do we need to handle complex in the !preeval case? I'd think > > > > we > > > > want

[PATCH] Fortran: error recovery simplifying PACK with invalid arguments [PR106049]

2022-07-05 Thread Harald Anlauf via Gcc-patches
Dear all, poor error recovery while trying to simplify intrinsics with given invalid arguments seems to be a recurrent theme in testcases submitted by Gerhard. In the present case, simplification of PACK() chokes on the array argument being a bad decl. The most general approach that came to my

Re: [PATCH]middle-end simplify complex if expressions where comparisons are inverse of one another.

2022-07-05 Thread Andrew Pinski via Gcc-patches
On Tue, Jul 5, 2022 at 8:16 AM Tamar Christina via Gcc-patches wrote: > > > > > -Original Message- > > From: Richard Biener > > Sent: Monday, June 20, 2022 9:57 AM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; nd > > Subject: Re: [PATCH]middle-end simplify complex if

Re: [PATCH] c++, v3: Add support for __real__/__imag__ modifications in constant expressions [PR88174]

2022-07-05 Thread Jason Merrill via Gcc-patches
On 7/4/22 11:50, Jakub Jelinek wrote: On Mon, Jun 27, 2022 at 06:31:18PM +0200, Jakub Jelinek via Gcc-patches wrote: Hmm, why do we need to handle complex in the !preeval case? I'd think we want to preevaluate all complex values or components thereof. Because the late evaluation of the

Re: [PATCH RFA] ubsan: do return check with -fsanitize=unreachable

2022-07-05 Thread Jason Merrill via Gcc-patches
On 6/29/22 13:26, Jakub Jelinek wrote: On Wed, Jun 29, 2022 at 12:42:04PM -0400, Jason Merrill wrote: The usual case is that people just use -fsanitize=undefined and get both return and unreachable sanitization, for fall through into end of functions returning non-void done through return

Re: Floating-point allocation sizes? (was Re: [PATCH] analyzer: Fix handling of non-ints inside allocation size checker [PR106181])

2022-07-05 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 6 Jul 2022 at 03:08, David Malcolm via Gcc-patches wrote: > > On Tue, 2022-07-05 at 21:49 +0200, Tim Lange wrote: > > This patch fixes the ICE reported in PR106181 by Arseny Solokha. With > > this patch, the allocation size checker tries to handle floating-point > > operands of allocation

Re: Floating-point allocation sizes? (was Re: [PATCH] analyzer: Fix handling of non-ints inside allocation size checker [PR106181])

2022-07-05 Thread Tim Lange
On Tue, Jul 5 2022 at 05:37:46 PM -0400, David Malcolm wrote: On Tue, 2022-07-05 at 21:49 +0200, Tim Lange wrote: This patch fixes the ICE reported in PR106181 by Arseny Solokha. With this patch, the allocation size checker tries to handle floating-point operands of allocation size

Re: [PATCH] c++: generic targs and identity substitution [PR105956]

2022-07-05 Thread Jason Merrill via Gcc-patches
On 7/5/22 10:06, Patrick Palka wrote: On Fri, 1 Jul 2022, Jason Merrill wrote: On 6/29/22 13:42, Patrick Palka wrote: In r13-1045-gcb7fd1ea85feea I assumed that substitution into generic DECL_TI_ARGS corresponds to an identity mapping of the given arguments, and hence its safe to always elide

Go patch committed: Better error message for unknown package name

2022-07-05 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend gives a better error message for an unknown package name, saying "undefined reference" rather than "expected package". This requires updating a test. This fixes https://go.dev/issue/51237. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to

libstdc++: Minor codegen improvement for atomic wait spinloop

2022-07-05 Thread Thomas Rodgers via Gcc-patches
This patch merges the spin loops in the atomic wait implementation which is a minor codegen improvement. libstdc++-v3/ChangeLog: * include/bits/atomic_wait.h (__atomic_spin): Merge spin loops. 0001-libstdc-Minor-codegen-improvement-for-atomic-wait-sp.patch Description: Binary data

c++: Prune ordinary locations

2022-07-05 Thread Nathan Sidwell via Gcc-patches
Like macro locations, we only need to emit ordinary location information for locations emitted into the CMI. This adds a hash table noting which ordinary lines are needed. These are then sorted and (sufficiently) adjacent lines are coalesced to a single map. There is a tradeoff here, allowing

RE: [PATCH 2/2]middle-end: Support recognition of three-way max/min.

2022-07-05 Thread Tamar Christina via Gcc-patches
> > } > > + else if (EDGE_SUCC (bb1, 0)->dest == EDGE_SUCC (bb2, 0)->dest > > + && single_succ_p (bb1) > > + && single_succ_p (bb2) > > + && single_pred_p (bb1) > > + && single_pred_p (bb2) > > + && single_succ_p (EDGE_SUCC (bb1, 0)->dest)) >

Re: [PATCH v2] Enable __memcmpeq after seeing __memcmpeq prototype

2022-07-05 Thread H.J. Lu via Gcc-patches
On Fri, Jul 1, 2022 at 12:51 AM Richard Biener wrote: > > On Mon, Jun 20, 2022 at 5:44 PM H.J. Lu wrote: > > > > extern int __memcmpeq (const void *, const void *, size_t); > > > > was was added to GLIBC 2.35. Expand BUILT_IN_MEMCMP_EQ to __memcmpeq > > after seeing __memcmpeq prototype > > Can

[PATCH v3] Enable __memcmpeq after seeing __memcmpeq prototype

2022-07-05 Thread H.J. Lu via Gcc-patches
extern int __memcmpeq (const void *, const void *, size_t); was was added to GLIBC 2.35. Expand BUILT_IN_MEMCMP_EQ to __memcmpeq after seeing __memcmpeq prototype gcc/ * builtins.cc (expand_builtin): Issue an error for BUILT_IN___MEMCMPEQ if there is no __memcmpeq prototype.

Re: [PATCH] libstdc++: testsuite: avoid predictable mkstemp

2022-07-05 Thread Alexandre Oliva via Gcc-patches
On Jul 5, 2022, Jonathan Wakely wrote: > The cast itself is fine, but I'd like a comment like "N.B. pid_t is a > pointer on vxworks" so I don't "simplify" it again. libstdc++: testsuite: why cast getpid result Add a comment next to the getpid call to explain why the typecast is needed.

Re: [PATCH] c-family: Prevent -Wformat warnings with u8 strings [PR105626]

2022-07-05 Thread Jason Merrill via Gcc-patches
On 7/5/22 15:26, Marek Polacek wrote: The thread seems to have concluded that -Wformat shouldn't warn about printf((const char*) u8"test %d\n", 1); saying "format string is not an array of type 'char'". This code is not an aliasing

[PATCH]middle-end: don't lower past veclower [PR106063]

2022-07-05 Thread Tamar Christina via Gcc-patches
Hi All, My previous patch can cause a problem if the pattern matches after veclower as it may replace the construct with a vector sequence which the target may not directly support. As such don't perform the rewriting if after veclower. Bootstrapped Regtested on aarch64-none-linux-gnu,

RE: [PATCH]middle-end Use subregs to expand COMPLEX_EXPR to set the lowpart.

2022-07-05 Thread Tamar Christina via Gcc-patches
> > so that the multiple_p test is skipped if the structure is undefined. > > Actually, we should probably skip the constant_multiple_p test as well. > Keeping it would only be meaningful for little-endian. > > simplify_gen_subreg should alread do the necessary checks to make sure > that the

Re: [PATCH] libstdc++: testsuite: avoid predictable mkstemp

2022-07-05 Thread Jonathan Wakely via Gcc-patches
On Tue, 5 Jul 2022 at 18:46, Alexandre Oliva wrote: > > On Jul 5, 2022, Jonathan Wakely wrote: > > > The cast itself is fine, but I'd like a comment like "N.B. pid_t is a > > pointer on vxworks" so I don't "simplify" it again. > > > libstdc++: testsuite: why cast getpid result > > Add a comment

[committed][wwwdocs] Add notes about and header dependencies

2022-07-05 Thread Jonathan Wakely via Gcc-patches
I backported a change to the header which meant it no longer includes , which broke some (incorrect) packages. This updates the GCC 12 docs to mention it. Pushed to wwwdocs. -- >8 -- Also fix missing closing tag for . --- htdocs/gcc-12/porting_to.html | 8 1 file changed, 8

Re: [PATCH] libstdc++: retry removal of dir entries if dir removal fails

2022-07-05 Thread Alexandre Oliva via Gcc-patches
On Jun 30, 2022, Sebastian Huber wrote: > From my point of view this is behaviour is an RTEMS bug. Instead of > adding tweaks for RTEMS, it would be better to report the issues and > fix them in RTEMS. It could be also a Newlib issue. Thanks, I've just filed https://devel.rtems.org/ticket/4674

[PATCH 2/2] analyzer: reorder initialization of state m_invalid in sm-fd.cc [PR106184]

2022-07-05 Thread Mir Immad via Gcc-patches
>From 3de908fa0c3e515b49df24460f85924211802d6c Mon Sep 17 00:00:00 2001 From: Immad Mir Date: Tue, 5 Jul 2022 21:21:13 +0530 Subject: [PATCH 2/2] analyzer: reorder initialization of state m_invalid in sm-fd.cc [PR106184] This patch reorders the initization of state m_invalid in sm-fd.cc to

[PATCH] c-family: Prevent -Wformat warnings with u8 strings [PR105626]

2022-07-05 Thread Marek Polacek via Gcc-patches
The thread seems to have concluded that -Wformat shouldn't warn about printf((const char*) u8"test %d\n", 1); saying "format string is not an array of type 'char'". This code is not an aliasing violation, and there are no I/O functions

Re: [PATCH]middle-end Use subregs to expand COMPLEX_EXPR to set the lowpart.

2022-07-05 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: >> > so that the multiple_p test is skipped if the structure is undefined. >> >> Actually, we should probably skip the constant_multiple_p test as well. >> Keeping it would only be meaningful for little-endian. >> >> simplify_gen_subreg should alread do the necessary

[PATCH] analyzer: Fix handling of non-ints inside allocation size checker [PR106181]

2022-07-05 Thread Tim Lange
This patch fixes the ICE reported in PR106181 by Arseny Solokha. With this patch, the allocation size checker tries to handle floating-point operands of allocation size arguments. Constant sizes get implicitly converted and symbolic sizes are handled as long as the floating-point operand could

Re: [PATCH] c-family: Add names to diagnostics for known headers

2022-07-05 Thread Marek Polacek via Gcc-patches
On Mon, Jul 04, 2022 at 05:25:42PM +0100, Jonathan Wakely wrote: > On Thu, 30 Jun 2022 at 16:15, Marek Polacek wrote: > > > > On Thu, Jun 30, 2022 at 04:11:42PM +0100, Jonathan Wakely via Gcc-patches > > wrote: > > > I recently changed to no longer include an unnecessary header, > > > which

[PING^2] nvptx: forward '-v' command-line option to assembler, linker

2022-07-05 Thread Thomas Schwinge
Hi Tom! Ping. Grüße Thomas On 2022-06-07T17:41:16+0200, I wrote: > Hi! > > On 2022-05-30T09:06:21+0200, Tobias Burnus wrote: >> On 29.05.22 22:49, Thomas Schwinge wrote: >>> Not sure if that's what you had in mind, but what do you think about the >>> attached "nvptx: forward '-v'

[COMMITTED] Provide a relation verification mechanism.

2022-07-05 Thread Andrew MacLeod via Gcc-patches
the relation oracle works on a purely symbolic basis. It assumes for instance that x == x, along with everything in the equivalency set. With the coming introduction of floating point ranges, we have circumstances beyond the symbol relation which can affect the result.  If the range of X may

RE: [PATCH]middle-end simplify complex if expressions where comparisons are inverse of one another.

2022-07-05 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Biener > Sent: Monday, June 20, 2022 9:57 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd > Subject: Re: [PATCH]middle-end simplify complex if expressions where > comparisons are inverse of one another. > > On Thu, 16 Jun 2022, Tamar

[PATCH 1/2] analyzer: show close event for use_after_close diagnostic

2022-07-05 Thread Mir Immad via Gcc-patches
>From be60d5194068355ccdbf832d0de9dbfed1e0b074 Mon Sep 17 00:00:00 2001 From: Immad Mir Date: Tue, 5 Jul 2022 21:14:06 +0530 Subject: [PATCH 1/2] analyzer: show close event for use_after_close diagnostic This patch saves the "close" event in use_after_close diagnostic and shows it where

Re: [PATCH 1/2]AArch64 Add fallback case using sdot for usdot

2022-07-05 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Wed, Jun 29, 2022 at 4:35 PM Richard Sandiford > wrote: >> >> Richard Biener writes: >> > On Tue, Jun 28, 2022 at 5:54 PM Tamar Christina >> > wrote: >> >> >> >> > -Original Message- >> >> > From: Richard Biener >> >> > Sent: Monday, June 27, 2022 7:10 AM

Re: [PATCH] Mips: Enable asynchronous unwind tables with both ASAN and TSAN

2022-07-05 Thread Dimitrije Milosevic
Hi Xi. Correct, I am using a simulator. Here are my changes: diff --git a/libsanitizer/configure.tgt b/libsanitizer/configure.tgt index fb89df4935c..6855a6ca9e7 100644 --- a/libsanitizer/configure.tgt +++ b/libsanitizer/configure.tgt @@ -55,6 +55,10 @@ case "${target}" in arm*-*-linux*)

Re: [PATCH] aarch64: Move vreinterpret definitions into the compiler

2022-07-05 Thread Richard Sandiford via Gcc-patches
Sorry for the slow review. Andrew Carlotti via Gcc-patches writes: > Hi, > > This removes a significant number of intrinsic definitions from the arm_neon.h > header file, and reduces the amount of code duplication. The new macros and > data structures are intended to also facilitate moving other

[pushed] c++: dependent conversion operator lookup [PR106179]

2022-07-05 Thread Jason Merrill via Gcc-patches
This testcase demonstrates that my assumption that we would only be interested in a class template lookup if the template-id is followed by :: was wrong. PR c++/106179 PR c++/106024 gcc/cp/ChangeLog: * parser.cc (cp_parser_lookup_name): Remove :: requirement for

Re: [PATCH] lto-plugin: Add path to libatomic for riscv64

2022-07-05 Thread Richard Biener via Gcc-patches
On Mon, Jul 4, 2022 at 3:09 PM Martin Liška wrote: > > On 7/4/22 14:28, Richard Biener wrote: > > ... but ... is libatomic properly built for the host? libgo is a > > target library. > > You're correct. > > Well, so the host library should be taken, which works for stage1 lto-plugin: > > [

Re: [PATCH] tree-sra: Fix union handling in build_reconstructed_reference (PR 105860)

2022-07-05 Thread Richard Biener via Gcc-patches
On Mon, 4 Jul 2022, Martin Jambor wrote: > Hi, > > On Mon, Jul 04 2022, Richard Biener wrote: > > On Fri, 1 Jul 2022, Martin Jambor wrote: > > > >> Hi, > >> > >> As the testcase in PR 105860 shows, the code that tries to re-use the > >> handled_component chains in SRA can be horribly confused

Re: [PATCH 1/2]AArch64 Add fallback case using sdot for usdot

2022-07-05 Thread Richard Biener via Gcc-patches
On Tue, Jul 5, 2022 at 8:08 AM Richard Sandiford wrote: > > Richard Biener writes: > > On Wed, Jun 29, 2022 at 4:35 PM Richard Sandiford > > wrote: > >> > >> Richard Biener writes: > >> > On Tue, Jun 28, 2022 at 5:54 PM Tamar Christina > >> > wrote: > >> >> > >> >> > -Original

Re: [x86 PATCH take #2] Doubleword version of and; cmp to not; test optimization.

2022-07-05 Thread Uros Bizjak via Gcc-patches
On Mon, Jul 4, 2022 at 9:11 PM Roger Sayle wrote: > > > This patch is the latest revision of the patch originally posted at: > https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596201.html > > This patch extends the earlier and;cmp to not;test optimization to also > perform this transformation

Re: [pushed] c++: Include -Woverloaded-virtual in -Wall [PR87729]

2022-07-05 Thread Stephan Bergmann via Gcc-patches
On 01/07/2022 22:30, Stephan Bergmann wrote: On 6/25/22 00:26, Jason Merrill via Gcc-patches wrote: This seems like a good warning to have in -Wall, as requested.  But as pointed out in PR20423, some users want a warning only when a derived function doesn't override any base function.  So let's

Re: [x86 PATCH take #2] Doubleword version of and; cmp to not; test optimization.

2022-07-05 Thread Uros Bizjak via Gcc-patches
On Tue, Jul 5, 2022 at 9:56 AM Uros Bizjak wrote: > > On Mon, Jul 4, 2022 at 9:11 PM Roger Sayle wrote: > > > > > > This patch is the latest revision of the patch originally posted at: > > https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596201.html > > > > This patch extends the earlier

[Ada] Fix clearly unintentional dead analysis of attribute Code_Address

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
A new warning about unreachable code that follows calls to procedures with No_Return would flag a clearly unintentional dead call to Set_Address_Taken in analysis of Code_Address attribute. This patch resurrects the dead code, which is worth fixing regardless of the new warning. Tested on

[Ada] Remove old vxworks6 from Makefile.rtl

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Pre vxworks7 code excepting legacy vxworks6 code is removed from Makefile.rtl and unused files are deleted. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * Makefile.rtl (*vxworks*): Remove most pre-vxworks7 code. * vxworks-arm-link.spec: Remove. *

[Ada] Remove unimplemented convert_addresses declaration

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
convert_addresses is declared in adaint.h but is never referenced, so remove it. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * adaint.h (convert_addresses): Remove function declaration.diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h --- a/gcc/ada/adaint.h +++

[Ada] Remove redundant guards in detection of unreachable code

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Routine Check_Unreachable_Code is only called on nodes belonging to a list of statements (and it wouldn't make sense to call it on anything else). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch5.adb (Check_Unreachable_Code): Remove redundant guard; the call

[Ada] Remove comment about a long gone formal verification mode

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Remove outdated a comment about the very first SPARK experiments in GNAT. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch6.adb (Check_Missing_Return): Remove outdated comment.diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb --- a/gcc/ada/sem_ch6.adb +++

[Ada] Perform object rewriting as renaming only in the expander

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
The rewriting as renaming optimization for object declarations is done partly during analysis, guarded with Expander_Active, and partly during expansion, so it makes sense to do it entirely during expansion. This merges the two cases and removes obsolete or unnecessary conditions guarding the

[Ada] Combine system.ads files - vxworks6 constants.

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Systemitize Word_Size and Memory_Size declarations rather than hard code with numerical values or OS specific Long_Integer size. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/system-vxworks-ppc-kernel.ads (Word_Size): Compute based on Standard'Word_Size.

[Ada] Add RM reference to check for functions without a return statement

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Add comment to explain why we have an error and not just a warning. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch6.adb (Check_Missing_Return): Add reference to an RM rule.diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb --- a/gcc/ada/sem_ch6.adb +++

[Ada] Spurious error on qualified prefix in Pack.Func'Result

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
When using a qualified name such as Pack.Func as the prefix of a 'Result attribute reference, the prefix is not fully resolved and may contain a chain of homonyms. Look for the expected function in the homonym chain instead of issuing an error if the first one is not the expected one. Tested on

[Ada] Cleanup repeated code for aggregate constraints checks

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup related to examining uses of Check_Unset_Reference for improved detection of uninitialised scalar objects. Semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (Aggregate_Constraint_Checks): Fix whitespace; refactor

[Ada] Remove redundant guard for call to List_Length with a No_List

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup related to a new detection of uninitialised local scalar objects; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch5.adb (Analyze_Block_Statement): Call to List_Length with No_List is safe and will return zero.diff --git

[Ada] Cleanup in error about unreachable code

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup only; behaviour is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch5.adb (Check_Unreachable_Code): Avoid explicit use of Sloc; this should also help when we finally use Source_Span for prettier error messages.diff --git

[Ada] Remove exception propagation during bootstrap

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
To help the bootstrap path, we want to keep the compiler free from any exception propagation during bootstrap. This has been broken recently in various places. Also introduce a way to more easily detect such breakage via the -DNO_EXCEPTION_PROPAGATION which can now be used as part of BOOT_CFLAGS.

[Ada] Remove unnecessary dead code after calls to nonreturning procedures

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
A new warning about unreachable code that follows calls to procedures with No_Return would flag some dead defensive code. Comments next to this code suggest that it was added to please some ancient version of the compiler, but recent releases of GNAT do not require such a code. Tested on

[Ada] Remove repeated analysis for pragma Thread_Local_Storage

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
When analysing pragma Thread_Local_Storage its argument is analysed by the call to Check_Arg_Is_Library_Level_Local_Name. There is no need to reanalyse it. Code cleanup; behaviour is not affected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_prag.adb

[Ada] Annotate GNAT.Sockets with No_Return aspects

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Opportunity for extra annotations spotted while fixing detection of unreachable code that follows calls to procedures annotated with No_Return. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/g-socket.adb (Raise_Host_Error): Add No_Return aspect.

[Ada] Misc cleanup related to finalization

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
This patch cleans up some code issues found while working on finalization, and adds some debugging aids. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch7.adb: Change two constants Is_Protected_Body and Is_Prot_Body to be Is_Protected_Subp_Body; these are not

[Ada] Remove return statements after procedure calls that don't return

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
A new warning about unreachable code that follows calls to procedures with No_Return would flag many unnecessary return statements. Those returns statements were applied inconsistently, so this patch is actually more a style cleanup. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Remove redundant protection against empty lists

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Calls to First on No_List intentionally return Empty node, so explicit guards against No_List are unnecessary. Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_code.adb (Setup_Asm_IO_Args): Remove guard against No_List. *