[PATCH] Place jump tables in RELRO only when targets require local relocation to be placed in a read-write section

2022-01-11 Thread HAO CHEN GUI via Gcc-patches
Hi, This patch sets "relocatable" of jump table to true when targets require local relocation to be placed in a read-write section - bit 0 is set in reloc_rw_mask. Jump tables are in local relocation, so they should be placed in RELRO only when both global and local relocation need to be plac

[PATCH] tree-optimization/76174 - testcase for fixed PR

2022-01-11 Thread Richard Biener via Gcc-patches
This adds a testcase for the fixed PR, VN now gets us the transform via IV equality plus predication. Pushed. 2022-01-12 Richard Biener PR tree-optimization/76174 * gcc.dg/tree-ssa/pr76174.c: New testcase. --- gcc/testsuite/gcc.dg/tree-ssa/pr76174.c | 22 +

Re: libgfortran bootstrap failure

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 10:30:26PM -0500, David Edelsohn wrote: > The recent patch to support Power IEEE128 causes a bootstrap failure > on AIX and possibly all non-GLIBC systems. > > +#if defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ \ > +&& defined __GLIBC_PREREQ && __G

Re: PING^2 (C/C++): Re: [PATCH 6/6] Add __attribute__ ((tainted))

2022-01-11 Thread Jason Merrill via Gcc-patches
On 1/10/22 16:36, David Malcolm via Gcc-patches wrote: On Thu, 2022-01-06 at 09:08 -0500, David Malcolm wrote: On Sat, 2021-11-13 at 15:37 -0500, David Malcolm wrote: This patch adds a new __attribute__ ((tainted)) to the C/C++ frontends. Ping for GCC C/C++ mantainers for review of the C/C++

libgfortran bootstrap failure

2022-01-11 Thread David Edelsohn via Gcc-patches
The recent patch to support Power IEEE128 causes a bootstrap failure on AIX and possibly all non-GLIBC systems. +#if defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ \ +&& defined __GLIBC_PREREQ && __GLIBC_PREREQ (2, 32) +#define POWER_IEEE128 1 +#endif __GLIBC_PREREQ is te

[Committed] cris: Avoid format-string-related warnings in calls to error functions

2022-01-11 Thread Hans-Peter Nilsson via Gcc-patches
These tweaks are installed to avoid build-warnings for config/cris/cris.c, like: x/gcc/config/cris/cris.c: In function 'const char* cris_op_str(rtx)': x/gcc/config/cris/cris.c:728:23: warning: unquoted identifier or keyword \ 'cris_op_str' in format [-Wformat-diag] 728 | internal_error ("M

[Committed] cris: Parenthesize parameter to as_a.

2022-01-11 Thread Hans-Peter Nilsson via Gcc-patches
Noted by Richard Sandiford in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103974#c7 (thanks!) Mea culpa: I wrongly thought the default development-level value ("yes,extra") would include everything interesting to normal target hacking (i.e. as opposed to hacking stuff like GC). I see rtl-checkin

Re: [GCC-11] [PATCH] libsanitizer: Cherry-pick LLVM release/13.x commit d96358a28193

2022-01-11 Thread H.J. Lu via Gcc-patches
On Mon, Jan 3, 2022 at 6:06 AM Richard Biener wrote: > > On Fri, Dec 17, 2021 at 11:45 PM H.J. Lu via Gcc-patches > wrote: > > > > OK for release branches? > > OK - I assume the size is not leaked as ABI detail? No, it is not. I am checking it into GCC 11 and will backport it to GCC 10/9 branch

Re: [Patch][V3][Patch 1/2]Change the 3rd parameter of function .DEFERRED_INIT from IS_VLA to decl name

2022-01-11 Thread Qing Zhao via Gcc-patches
FYI. Just committed this patch to gcc12 as: https://gcc.gnu.org/pipermail/gcc-cvs/2022-January/359118.html Qing > On Jan 11, 2022, at 9:38 AM, Qing Zhao via Gcc-patches > wrote: > > > >> On Jan 11, 2022, at 7:53 AM, Richard Biener >> wrote: >> >> On Tue, Jan 11, 2022 at 12:58 AM Qing Zha

Re: [power-ieee128, committed] Enable conversion selection via environment variable

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 10:44:56PM +0100, Thomas Koenig wrote: > > > So... time to merge the branch into trunk before stage 4 > > > kicks in? > > > > IMHO yes. We need to git merge master; git rebase of course > > before trying to cherry-pick those commits into trunk and pushing there. > > I wou

Re: [PATCH v2 1/2] add -Wuse-after-free

2022-01-11 Thread Jason Merrill via Gcc-patches
On 11/30/21 17:32, Martin Sebor via Gcc-patches wrote: Attached is a revised patch with the following changes based on your comments: 1) Set and use statement uids to determine which statement    precedes which in the same basic block. 2) Avoid testing flag_isolate_erroneous_paths_dereference.

Re: [PATCH] Fortran: make IEEE_CLASS recognize signaling NaNs

2022-01-11 Thread FX via Gcc-patches
Hi HJ, > I looked at gcc-testresults and find e.g. > > https://gcc.gnu.org/pipermail/gcc-testresults/2022-January/747938.html > https://gcc.gnu.org/pipermail/gcc-testresults/2022-January/747935.html > > which is x86 (64 and 32 bit) by H.J.; plus some more. > Maybe H.J. can explain what is differ

Re: [PATCH] [gfortran] Add support for allocate clause (OpenMP 5.0).

2022-01-11 Thread Hafiz Abid Qadeer
Hi Jakub Thanks for the review. Please see comments inline. Also note that common block is now allowed in allocate clause as per your comment so there is slight adjustment in the parsing code for that. On 20/12/2021 20:06, Jakub Jelinek wrote: > On Thu, Nov 18, 2021 at 07:30:36PM +, Hafiz A

Re: [PATCH] Fortran: make IEEE_CLASS recognize signaling NaNs

2022-01-11 Thread Harald Anlauf via Gcc-patches
Hi FX, Am 11.01.22 um 23:04 schrieb FX via Fortran: Hi Harald, I think this patch breaks the testsuite On what platform? It regtested fine on x86_64-pc-linux-gnu I looked at gcc-testresults and find e.g. https://gcc.gnu.org/pipermail/gcc-testresults/2022-January/747938.html https://gcc.gn

Re: [PATCH] Fortran: make IEEE_CLASS recognize signaling NaNs

2022-01-11 Thread FX via Gcc-patches
Hi Harald, > I think this patch breaks the testsuite On what platform? It regtested fine on x86_64-pc-linux-gnu > since the directive > ! { dg-additional-sources signaling_1_c.c } > should rather read > ! { dg-additional-sources "signaling_1_c.c" } I find plenty of evidence saying it’s allowed

Re: [PATCH] Fortran: make IEEE_CLASS recognize signaling NaNs

2022-01-11 Thread Harald Anlauf via Gcc-patches
Hi FX, Am 02.01.22 um 11:50 schrieb FX via Fortran: Hi, This is the first part of a three-patch series to fix PR 82207 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82207), making gfortran handle signaling NaNs. This part fixes the library code implementing IEEE_CLASS, by using the issignali

Re: [power-ieee128, committed] Enable conversion selection via environment variable

2022-01-11 Thread Thomas Koenig via Gcc-patches
On 11.01.22 14:19, Jakub Jelinek via Fortran wrote: On Mon, Jan 10, 2022 at 11:44:13PM +0100, Thomas Koenig wrote: Hello world, I have just pushed the attched patch to the branch. Thanks. Here is a patch to fix up the ppc64be vs. ppc64le byteswapping of IBM extended real(kind=16) and compl

Re: [PATCH] Use enclosing object size if it's smaller than member [PR 101475]

2022-01-11 Thread Jason Merrill via Gcc-patches
On 12/16/21 14:56, Martin Sebor via Gcc-patches wrote: Enabling vectorization at -O2 caused quite a few tests for warnings to start failing in GCC 12.  These tests were xfailed and bugs were opened to track the problems until they can be fully analyzed and ultimately fixed before GCC 12 is releas

[PATCH] PR fortran/83079 - ICE and wrong code with TRANSFER and character(kind=4)

2022-01-11 Thread Harald Anlauf via Gcc-patches
Dear Fortranners, when digging into the issue pointed out in the PR by Gerhard it turned out that there were several issues with the TRANSFER intrinsics in the case MOLD was CHARACTER(kind=4). Default CHARACTER was fine, though. - the size of the result was wrongly calculated - the string length

Re: [PATCH] libstdc++: Avoid overflow in bounds checks [PR103955]

2022-01-11 Thread Jonathan Wakely via Gcc-patches
On Tue, 11 Jan 2022 at 20:03, Patrick Palka via Libstdc++ < libstd...@gcc.gnu.org> wrote: > We currently crash when the floating-point to_chars overloads are passed > a precision value near INT_MAX, ultimately due to overflow in the bounds > checks that verify the output range is large enough. > >

Re: [PATCH] C++ P0482R6 char8_t: declare std::c8rtomb and std::mbrtoc8 if provided by the C library

2022-01-11 Thread Tom Honermann via Gcc-patches
On 1/10/22 4:38 PM, Jonathan Wakely wrote: On Mon, 10 Jan 2022 at 21:24, Tom Honermann via Libstdc++ wrote: On 1/10/22 8:23 AM, Jonathan Wakely wrote: On Sat, 8 Jan 2022 at 00:42, Tom Honermann via Libstdc++ mailto:libstdc%2b...@gcc.gnu.org>> wrote: This patch completes implementation o

[PATCH] libstdc++: Avoid overflow in bounds checks [PR103955]

2022-01-11 Thread Patrick Palka via Gcc-patches
We currently crash when the floating-point to_chars overloads are passed a precision value near INT_MAX, ultimately due to overflow in the bounds checks that verify the output range is large enough. The most portable fix seems to be to replace bounds checks of the form A >= B + C (where B + C may

[PATCH] tree-optimization/103551 - Always set EDGE_EXECUTABLE in ranger vrp.

2022-01-11 Thread Andrew MacLeod via Gcc-patches
The simplify_and_fold engine uses the EDGE_EXECUTABLE flag to eliminate branches: substitute_and_fold_dom_walker::before_dom_children: if (gimple_code (stmt) == GIMPLE_COND)     {   if ((EDGE_SUCC (bb, 0)->flags & EDGE_EXECUTABLE)   ^ (EDGE_SUCC (bb, 1)->flags & EDG

Re: [PATCH v4 2/3] rs6000: Support SSE4.1 "round" intrinsics

2022-01-11 Thread David Edelsohn via Gcc-patches
Suppress exceptions (when specified), by saving, manipulating, and restoring the FPSCR. Similarly, save, set, and restore the floating-point rounding mode when required. No attempt is made to optimize writing the FPSCR (by checking if the new value would be the same), other than using lighter wei

Re: [PATCH 0/2]: C N2653 char8_t implementation

2022-01-11 Thread Tom Honermann via Gcc-patches
On 1/10/22 9:23 PM, Joseph Myers wrote: Please repost these patches after GCC 12 branches (updated as appropriate depending on whether the feature is accepted at the two-week Jan/Feb WG14 meeting, which doesn't yet have an agenda), since we're currently stabilizing for the release and so not cons

Re: [PATCH] ira: Fix old-reload targets [PR103974]

2022-01-11 Thread Vladimir Makarov via Gcc-patches
On 2022-01-11 12:42, Richard Sandiford wrote: The new IRA heuristics would need more work on old-reload targets, since flattening needs to be able to undo the cost propagation. It's doable, but hardly seems worth it. Agree. It is not worth to spend your time for work for reload. This patch th

[committed] libstdc++: Install header for freestanding [PR103726]

2022-01-11 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and freestanding mips-elf. This C++20 header is also supposed to be present for freestanding. libstdc++-v3/ChangeLog: PR libstdc++/103726 * include/Makefile.am: Install for freestanding. * include/Makefile.in: Regenerate. * include/st

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 06:23:51PM +, Jonathan Wakely via Gcc-patches wrote: > > Regarding fortran: can we have a vote on this one? > > > > Some developers (including myself) are not really familiar with C++, > > and in the past preference has been expressed on the fortran ML in > > favor of no

[PATCH] i386: Introduce V2QImode vector cmove for -msse4.1 [PR103861]

2022-01-11 Thread Uros Bizjak via Gcc-patches
This patch also moves V2HI and V4QImode vector conditional moves to SSE4.1 targets. Vector cmoves are implemented with SSE logic functions without -msse4.1, and they are hardly worthwile for narrow vector modes. More important, we would like to keep vector logic functions for GPR registers, and th

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Jonathan Wakely via Gcc-patches
On Tue, 11 Jan 2022 at 18:02, Harald Anlauf via Gcc wrote: > > Am 11.01.22 um 16:50 schrieb Martin Liška: > > On 1/11/22 16:48, Toon Moene wrote: > >> On 1/11/22 13:56, Martin Liška wrote: > >> > >>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > >>> Plus it survives buil

Re: [PATCH] PR 102935, Fix pr101384-1.c code generation test.

2022-01-11 Thread David Edelsohn via Gcc-patches
On Tue, Jan 11, 2022 at 12:06 PM Bill Schmidt wrote: > > Hi Mike, > > This looks fine to me. Maintainers? Okay. Thanks, David > > Thanks, > Bill > > On 1/7/22 6:33 PM, Michael Meissner wrote: > > Fix pr101384-1.c code generation test. > > > > Add support for the compiler using XXSPLTIB reg,255

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Harald Anlauf via Gcc-patches
Am 11.01.22 um 16:50 schrieb Martin Liška: On 1/11/22 16:48, Toon Moene wrote: On 1/11/22 13:56, Martin Liška wrote: Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Plus it survives build of all FEs (--enable-languages=all) on x86_64-linux-gnu and I've built all cross co

[PATCH] ira: Fix old-reload targets [PR103974]

2022-01-11 Thread Richard Sandiford via Gcc-patches
The new IRA heuristics would need more work on old-reload targets, since flattening needs to be able to undo the cost propagation. It's doable, but hardly seems worth it. This patch therefore makes all the new calls to ira_subloop_allocnos_can_differ_p return false if !ira_use_lra_p. The color_pas

Re: [PATCH] c++: dependent bases and 'this' availability [PR103831]

2022-01-11 Thread Jason Merrill via Gcc-patches
On 12/28/21 10:08, Patrick Palka wrote: Here during satisfaction of B's associated constraints we're failing to reject the object-less call to the non-static member function A::size ultimately because satisfaction is performed in the (access) context of the class template B, which has a dependent

Re: [PATCH] PR 102935, Fix pr101384-1.c code generation test.

2022-01-11 Thread Bill Schmidt via Gcc-patches
Hi Mike, This looks fine to me.  Maintainers? Thanks, Bill On 1/7/22 6:33 PM, Michael Meissner wrote: > Fix pr101384-1.c code generation test. > > Add support for the compiler using XXSPLTIB reg,255 to load all 1's into a > register on power9 and above instead of using VSPLTI{B,H,W} reg,-1. > >

Re: [PATCH] c++: Fix ICEs with OBJ_TYPE_REF pretty printing [PR101597]

2022-01-11 Thread Jason Merrill via Gcc-patches
On 12/31/21 04:13, Jakub Jelinek wrote: Hi! The following testcase ICEs, because middle-end uses the C++ FE pretty printing code through langhooks in the diagnostics. The FE expects OBJ_TYPE_REF_OBJECT's type to be useful (pointer to the class type it is called on), but in the middle-end convers

Re: [PATCH] c++: Silence -Wuseless-cast warnings during move [PR103480]

2022-01-11 Thread Jason Merrill via Gcc-patches
On 12/31/21 04:30, Jakub Jelinek wrote: Hi! This is maybe just a shot in the dark, but IMHO we shouldn't be diagnosing -Wuseless-cast on casts the compiler adds on its own when calling its move function. We don't seem to warn when user calls std::move either. We call move on elinit (*NON_LVALUE

Re: [PATCH] c-family: Fix up -W*conversion on bitwise &/|/^ [PR101537]

2022-01-11 Thread Jason Merrill via Gcc-patches
On 1/4/22 04:32, Jakub Jelinek wrote: Hi! The following testcases emit a bogus -Wconversion warning. This is because conversion_warning function doesn't handle BIT_*_EXPR (only unsafe_conversion_p that is called during the default: case, and that one doesn't handle SAVE_EXPRs added because the

Re: [Patch][V2]Enable -Wuninitialized + -ftrivial-auto-var-init for address taken variables

2022-01-11 Thread Qing Zhao via Gcc-patches
Hi, Richard, > On Jan 11, 2022, at 7:43 AM, Richard Biener > wrote: > 1. Add some meaningful temporaries to break the long expression to make it Readable. And also add comments to explain the purpose of the statement; 2. Resolve the memory leakage of the dy

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 05:03:34PM +0100, Martin Liška wrote: > On 1/11/22 16:56, Jakub Jelinek wrote: > > While e.g. libcpp or gcc are in C++. > > Which means I should rename .c files under libcpp, right? > Is there any other folder from gcc/ and libcpp/ that would need that as well? >From the d

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Martin Liška
On 1/11/22 16:56, Jakub Jelinek wrote: While e.g. libcpp or gcc are in C++. Which means I should rename .c files under libcpp, right? Is there any other folder from gcc/ and libcpp/ that would need that as well? Martin

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 04:50:02PM +0100, Martin Liška wrote: > On 1/11/22 16:48, Toon Moene wrote: > > On 1/11/22 13:56, Martin Liška wrote: > > > > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > > Plus it survives build of all FEs (--enable-languages=all) on > > >

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Martin Liška
On 1/11/22 16:48, Toon Moene wrote: On 1/11/22 13:56, Martin Liška wrote: Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Plus it survives build of all FEs (--enable-languages=all) on x86_64-linux-gnu and I've built all cross compilers. Does this also rename .c files in

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Toon Moene
On 1/11/22 13:56, Martin Liška wrote: Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Plus it survives build of all FEs (--enable-languages=all) on x86_64-linux-gnu and I've built all cross compilers. Does this also rename .c files in the fortran and libgfortran direct

Re: [Patch][V3][Patch 1/2]Change the 3rd parameter of function .DEFERRED_INIT from IS_VLA to decl name

2022-01-11 Thread Qing Zhao via Gcc-patches
> On Jan 11, 2022, at 7:53 AM, Richard Biener > wrote: > > On Tue, Jan 11, 2022 at 12:58 AM Qing Zhao wrote: >> >> Hi, Richard, >> >> I splited the previous patch for “Enable -Wuninitialized + >> -ftrivial-auto-var-init for address taken variables” into two separate >> patches. >> This is

[committed] libstdc++: Add missing noexcept to lazy_split_view iterator (LWG 3593)

2022-01-11 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. This was approved at the October 2021 plenary. We already have noexcept in the other places the issue adds it in the spec. libstdc++-v3/ChangeLog: * include/std/ranges (ranges::lazy_split_view::_InnerIter::end()): Add neoxcept (LWG 3593

[committed] libstdc++: Make copyable-box completely constexpr (LWG 3572)

2022-01-11 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. This LWG issue was approved at the October 2021 plenary and can be implemented now that std::optional is fully constexpr. libstdc++-v3/ChangeLog: * include/std/ranges (ranges::__detail::__box): Add constexpr to assignment operators (LWG

Re: [patch] Fix reverse SSO issues in IPA-SRA

2022-01-11 Thread Martin Jambor
Hi Eric, On Tue, Jan 11 2022, Eric Botcazou via Gcc-patches wrote: > Hi, > > we recently received the report that the IPA-SRA pass introduced in GCC 10 > does not always play nice with the reverse scalar storage order that can be > used in structures/records/unions. Reading the code, the pass a

Re: Ping: [PATCH] rs6000: Add split pattern to replace

2022-01-11 Thread David Edelsohn via Gcc-patches
On Tue, Jan 11, 2022 at 2:27 AM Xionghu Luo wrote: > > On 2022/1/11 06:55, David Edelsohn wrote: > >>> +(define_insn_and_split "sldoi_to_mov_" > > It would be more consistent with the naming convention to use > > "sldoi_to_mov" without the final "_". > > OK, thanks. > > > > >>> + [(set (match_ope

[committed] analyzer: fix false +ve on bitwise binops (PR analyzer/102692)

2022-01-11 Thread David Malcolm via Gcc-patches
PR analyzer/102692 reports a false positive at -O2 from -Wanalyzer-null-dereference on: if (!p || q || !p->next) At the gimple level, -O2 has converted the first || into bitwise or controlling a jump: _4 = _2 | _3; if (_4 != 0) and a recursive call has been converted to iteration. The analy

Re: [PATCH] PR tree-optimization/103821 - Prevent exponential range calculations.

2022-01-11 Thread Andrew MacLeod via Gcc-patches
On 1/11/22 02:01, Richard Biener wrote: On Tue, Jan 11, 2022 at 12:28 AM Andrew MacLeod via Gcc-patches wrote: This test case demonstrates an unnoticed exponential situation in range-ops. We end up unrolling the loop, and the pattern of code creates a set of cascading multiplies for which we

Re: [PATCH] tree-optimization/pr103961: Never compute offset for -1 size

2022-01-11 Thread Siddhesh Poyarekar
On 11/01/2022 19:04, Jakub Jelinek wrote: On Tue, Jan 11, 2022 at 06:40:44PM +0530, Siddhesh Poyarekar wrote: Never try to compute size for offset when the object size is -1, which is either unknown maximum or uninitialized minimum irrespective of the osi->pass number. gcc/ChangeLog: P

Re: [PATCH] C, C++, Fortran, OpenMP: Add 'has_device_addr' clause to 'target' construct

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 02:27:57PM +0100, Tobias Burnus wrote: > Hi Jakub, hi all, > > let me quickly comment on 'has_device_addr' with Fortran arrays > and with an array section (i.e. regarding your comment quoted > at the very bottom of this email). > > Unfortunately, the OpenMP specification i

Re: [Patch][V3][Patch 1/2]Change the 3rd parameter of function .DEFERRED_INIT from IS_VLA to decl name

2022-01-11 Thread Richard Biener via Gcc-patches
On Tue, Jan 11, 2022 at 12:58 AM Qing Zhao wrote: > > Hi, Richard, > > I splited the previous patch for “Enable -Wuninitialized + > -ftrivial-auto-var-init for address taken variables” into two separate > patches. > This is the first one > > This first patch is to fix (or work around ) PR10372

Re: [Patch][V2]Enable -Wuninitialized + -ftrivial-auto-var-init for address taken variables

2022-01-11 Thread Richard Biener via Gcc-patches
On Wed, Jan 5, 2022 at 5:59 PM Qing Zhao wrote: > > Hi, Richard, > > Thanks a lot for the review and questions. > See my reply embedded below: > > > > On Jan 5, 2022, at 4:33 AM, Richard Biener > > wrote: > > > > On Thu, Dec 16, 2021 at 5:00 PM Qing Zhao wrote: > >> > >> Hi, > >> > >> This is t

Re: [PATCH] [12/11/10] Fix invalid format warnings on Windows

2022-01-11 Thread Martin Liška
Hello. I do support the patch, but I would ... On 1/7/22 19:33, Tomas Kalibera wrote: +  if (is_attribute_p ("format", get_attribute_name (aa)) && +  fndecl && fndecl_built_in_p (fndecl, BUILT_IN_NORMAL)) +{ +  switch (DECL_FUNCTION_CODE (fndecl)) +  

Re: [PATCH] tree-optimization/pr103961: Never compute offset for -1 size

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 06:40:44PM +0530, Siddhesh Poyarekar wrote: > Never try to compute size for offset when the object size is -1, which > is either unknown maximum or uninitialized minimum irrespective of the > osi->pass number. > > gcc/ChangeLog: > > PR tree-optimization/pr103961 >

[Ada] Relax assertion on designated types for equality operators

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
This will avoid doing artificial conversions during semantic analysis. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/utils2.c (build_binary_op) : Relax a little the assertion on designated types of pointer types.diff --git a/gcc/ada/gcc-interface/util

[Ada] Include generic instance names in non-visible entity errors

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
This patch adds the printing of generic instance names when encountering non-visible entities instead of just the line number of the package instantiation. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch8.adb (Nvis_Messages): Add generic instance name to error

[Ada] Accept square brackets for expression functions

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Ada RM 6.8 allows an expression function to return an aggregate directly at the top level (enclosed with either parentheses or square brackets). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * par-ch6.adb (Scan_Body_Or_Expression_Function): Accept left bracket as tok

[Ada] Task arrays trigger spurious unreferenced warnings

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Incremental patch to handle multi-dimensional arrays of tasks and records with task components. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_warn.adb (Check_References): Add call to Has_Task instead of checking component type.diff --git a/gcc/ada/sem_warn.adb

[Ada] Remove unreferenced CCG-specific routine Insert_Declaration

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Routine Insert_Declaration was originally added for the Ada-to-C translator, because in C we can't have declarations within an expressions. However, it is no longer used, because now we insert declarations into N_Expression_With_Actions. Code cleanup related to inserting itypes in spec expressions

[Ada] Avoid redundant checks for empty lists

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Simplify "No (L) or else Is_Empty_List (L)" into "Is_Empty_List (L)", since Is_Empty_List can be called on No_List and returns True. Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Expand_N_Expression_With_Actions): Avoid

[Ada] Remove name constant used by GNATprove but not by GNAT

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Revert recent removal of Name_Rpc, which is needed by GNATprove to detect calls to potentially blocking subprograms. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * snames.ads-tmpl: Restore Name_Rpc.diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl --- a/gcc/ada

[Ada] Reduce scope of declare block in analysis of allocators

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup related to handling of allocators in GNATprove; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch4.adb (Analyze_Allocator): Move DECLARE block inside IF statement; refill code and comments.diff --git a/gcc/ada/sem_ch4.adb b/gcc/a

[Ada] Balance parentheses in comments about allocators

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup related to handling of allocators and compile-time-known null expressions in GNATprove. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch4.adb (Analyze_Allocator): Fix comment. * sem_eval.ads (Compile-Time Known Values): Likewise.diff --git a/gcc/ada/sem

[Ada] Remove unreferenced name constants

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
In the Snames unit we had many unreferenced constants. Most of them are leftovers from features that have been deconstructed years ago, e.g. VAX support. Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * snames.ads-tmpl: Remove unreferen

[Ada] Adapt proof of System.Arith_Double

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Following changes in GNATprove, ghost code needs some adjustments for proof to go through. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-aridou.adb (Double_Divide): Adjust proof of lemma Prove_Signs, call lemma for commutation of Big and multiplic

[Ada] Deconstruct a VMS utility routine which is only used by GNATprove

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Routine Compile_Time_Known_Value_Or_Aggr was needed for VMS compatibility, which was deconstructed in 2014. This routine was dead since then, until it got accidentally reused by GNATprove to pretty print counterexamples. Cleanup related to handling of compile-time-known null values in GNATprove.

[Ada] Recover proof of Ada.Strings.Fixed with assertions

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Changes in GNATprove make it necessary to add assertions here. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-strfix.adb (Insert, Overwrite): Add assertions.diff --git a/gcc/ada/libgnat/a-strfix.adb b/gcc/ada/libgnat/a-strfix.adb --- a/gcc/ada/libgnat/a-strfix.adb

[Ada] PR ada/79724

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Fix handling of e.g. gcc-11 in Osint.Program_Name. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ PR ada/79724 * osint.adb (Program_Name): Fix handling of suffixes.diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb --- a/gcc/ada/osint.adb +++ b/gcc/ada/osint.adb @@ -2

[Ada] Remove unnecessary block in code for expansion of allocators

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup related to handling of allocators in GNATprove; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Size_In_Storage_Elements): Remove unnecessary DECLARE block; refill code and comments.diff --git a/gcc/ada/exp_ch4.adb b/gcc/

[Ada] Fix incomplete debug info for derived packed array type

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
The front-end was copying the Packed_Array_Impl_Type of the parent onto the derived type, which fools the logic of the debug back-end. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch3.adb (Analyze_Subtype_Declaration): In the case of an array copy Packed_Array

[Ada] Reuse Make_Temporary where possible

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Simplify: Make_Defining_Identifier (Loc, Chars => New_Internal_Name (C)); into: Make_Temporary (Loc, C); Code cleanup related to creation of itypes for allocators in GNATprove mode; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch7.adb

[Ada] Fix check for implicit allocation of dynamic objects

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
We check for dynamic objects by recursively examining record components. We should thus first check if the component is a record type before checking if it is a `Discriminated_Size` which will be false for all non array-type components. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Proof of unit System.Case_Util

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
This unit is needed to prove System.Val_Bool, as it is used in System.Val_Util called from System.Val_Bool. Add contracts that reflect the implementation, as we don't want these units to depend on units under Ada.Characters. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * li

[Ada] Adapt ghost code to maintain proof

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Add two assertions that are now required for the proof of System.Exp_Mod to go through. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-expmod.adb (Exp_Modular): Add assertions.diff --git a/gcc/ada/libgnat/s-expmod.adb b/gcc/ada/libgnat/s-expmod.adb --- a/gcc/ada/l

[Ada] Remove redundant initialization of Test_And_Set_Flag object

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
When expanding exception declarations we explicitly initialized the System.Atomic_Operations.Test_And_Set.Test_And_Set_Flag object with 0. This was redundant, because the Test_And_Set_Flag type has aspect Default_Value => 0. It is better to not duplicate this constant in the GNAT code, in case that

[Ada] Tune inconsistent message about fixed-lower-bound and -gnatX

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Use a dedicated routine to complain about the missing -gnatX switch. Previously the message was: error: fixed-lower-bound array is an extension feature; use -gnatX and after this change it is: error: fixed-lower-bound array is a GNAT specific extension error: unit must be compiled with -g

[Ada] Conformance error on protected subp with anonymous-access-to-tagged formal

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
The compiler incorrectly rejected a protected subprogram with a formal of an anonymous access type that designates a tagged type when the protected type extends an interface and the formal's designated type (a different type) is declared immediately within the same scope as the protected type; an e

[Ada] Proof of System.Vectors.Boolean_Operations

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
This proves in SPARK the unit System.Vectors.Boolean_Operations. The specification models explicitly the array of Boolean represented by Vectors.Vector, so that the result of functions can be specified by expressing the relationship between input and output models. Tested on x86_64-pc-linux-gnu,

[Ada] Remove extra space in single object declarations

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Fix whitespace in single object declarations; violations detected with a simple LKQL checker. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_aggr.adb, exp_attr.adb, exp_ch3.adb, exp_ch7.adb, exp_dist.adb, exp_util.adb, freeze.adb, frontend.adb, inline.ad

[Ada] Remove warnings-as-errors about constraints error in dead code

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
GNAT removes error messages attached to nodes within dead code; in particular, within instances of generic units with alternative branches for different generic formal types and parameters. Now this removal also works for error messages that come from warnings about constraint errors that have been

[Ada] Code cleanups

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Use membership tests when possible Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch9.adb, gen_il-types.ads, make.adb, par-ch12.adb, sem_ch13.adb: Use membership tests.diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada

[Ada] Escalate pre-continuation messages from warnings to errors

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
When a compile-time constraint error is inserted into the AST, we emit a main message (e.g. "value not in range of ...") and its continuation (e.g. "Constraint_Error will be raised at run time"). When the main message is emitted as a warning and the continuation is escalated into an error, the main

[Ada] Document LLVM-specific flags

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Add documentation for new -gnatd_u and old -gnatd_R flags used for GNAT LLVM and its CCG. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * debug.adb: Add documentation for new -gnatd_u and old -gnatd_R flags used for GNAT LLVM and its CCG.diff --git a/gcc/ada/debug.ad

[Ada] Use atomic builtins for atomic counters on x86 (32bit)

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Remove the x86-specific (32bit) variant of System.Atomic_Counters, because the __atomic builtins work fine on all x86 CPUs except for i386, where they can be provided by libatomic (when compiling with -march=i386). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * Makefile.rtl

[committed] libstdc++: Install header for freestanding [PR103726]

2022-01-11 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and by minimally tested on mips-none-elf. Pushed to trunk. The standard says that should be present for freestanding. That was intentionally left out of the initial implementation, but can be done without much trouble. The header should be moved to libsupc++ at some point in

[committed] libstdc++: Optimize std::ostream inserters for single characters

2022-01-11 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. On the libsdc++ mailing list Lewis Hyatt pointed out the performance overhead of using sputn in stream inserters, rather than writing directly to the streambuf's put area: https://gcc.gnu.org/pipermail/libstdc++/2021-July/052877.html As Lewis noted, the stan

Re: [PATCH] C, C++, Fortran, OpenMP: Add 'has_device_addr' clause to 'target' construct

2022-01-11 Thread Tobias Burnus
Hi Jakub, hi all, let me quickly comment on 'has_device_addr' with Fortran arrays and with an array section (i.e. regarding your comment quoted at the very bottom of this email). Unfortunately, the OpenMP specification is rather unclear what has_device_addr means for C/C++ array sections and in

Re: [RFC][PATCH 3/N] lto-plugin: Port to C++

2022-01-11 Thread Martin Liška
On 1/10/22 08:50, Richard Biener wrote: On Wed, Jan 5, 2022 at 2:28 PM Martin Liška wrote: Hello. I'm working on some changes that will be needed for support of ld.mold. And I would like to have the plugin in C++. Having that, we can utilize basic contains like std::vector (instead of xreallo

[PATCH] x86_64: Improvements to arithmetic right shifts of V1TImode values.

2022-01-11 Thread Roger Sayle
This patch to the i386 backend's ix86_expand_v1ti_ashiftrt provides improved (shorter) implementations of V1TI mode arithmetic right shifts for constant amounts between 111 and 126 bits. The significance of this range is that this functionality is useful for (eventually) providing sign extension

[committed] libstdc++: Make std::variant work with Clang in C++20 mode [PR103891]

2022-01-11 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Clang has some bugs with destructors that use constraints to be conditionally trivial, so disable the P2231R1 constexpr changes to std::variant unless the compiler is GCC 12 or later. If/when P2493R0 gets accepted and implemented by G++ we can remove the __G

[committed] libstdc++: Make std::common_iterator completely constexpr-able (LWG 3574)

2022-01-11 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. This library issue was approved in the October 2021 plenary. libstdc++-v3/ChangeLog: * include/bits/stl_iterator.h (common_iterator): Add constexpr to all member functions (LWG 3574). * testsuite/24_iterators/common_iterator/1.cc: Ev

Re: [patch] Fix reverse SSO issues in IPA-SRA

2022-01-11 Thread Richard Biener via Gcc-patches
On Tue, Jan 11, 2022 at 11:45 AM Eric Botcazou via Gcc-patches wrote: > > Hi, > > we recently received the report that the IPA-SRA pass introduced in GCC 10 > does not always play nice with the reverse scalar storage order that can be > used in structures/records/unions. Reading the code, the pas

Re: [power-ieee128, committed] Enable conversion selection via environment variable

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Mon, Jan 10, 2022 at 11:44:13PM +0100, Thomas Koenig wrote: > Hello world, > > I have just pushed the attched patch to the branch. Thanks. Here is a patch to fix up the ppc64be vs. ppc64le byteswapping of IBM extended real(kind=16) and complex(kind=16). Similarly to the BT_COMPLEX case it hal

Re: [PATCH] Check sorting of MAINTAINERS

2022-01-11 Thread Martin Liška
On 1/11/22 11:05, Martin Liška wrote: On 1/11/22 10:38, Jakub Jelinek wrote: On Tue, Jan 11, 2022 at 10:27:19AM +0100, Martin Liška wrote: On 1/10/22 17:14, Martin Liška wrote: Are you fine with the suggested changes? Hello. Jakub had comments so I'm sending v2 where I added few parsing exc

[PATCH] tree-optimization/pr103961: Never compute offset for -1 size

2022-01-11 Thread Siddhesh Poyarekar
Never try to compute size for offset when the object size is -1, which is either unknown maximum or uninitialized minimum irrespective of the osi->pass number. gcc/ChangeLog: PR tree-optimization/pr103961 * tree-object-size.c (plus_stmt_object_size): Always avoid computing

[PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Martin Liška
Hello. I've got a patch series that does the renaming. It contains of 2 automatic scripts ([1] and [2]) that were run as: $ gcc-renaming-candidates.py gcc --rename && git commit -a -m 'Rename files.' && rename-gcc.py . -vv && git commit -a -m 'Automatic renaming' The first scripts does the ren

Re: [PATCH 5/6] ira: Consider modelling caller-save allocations as loop spills

2022-01-11 Thread Richard Sandiford via Gcc-patches
Robin Dapp writes: >> Could you try the attached? > > The series with the patch is OK from a testsuite point of view. The > other problem appears later. OK, thanks for checking. I've pushed the patch as obvious. Richard

  1   2   >