[pushed] c++: default mem-init of array [PR103946]

2022-01-07 Thread Jason Merrill via Gcc-patches
In the patch for PR92385 I added asserts to see if we tried to make a vec_init of a vec_init, but didn't see any in regression testing. This testcase is one case, which seems reasonable: we create a VEC_INIT_EXPR for the aggregate initializer, and then again to express the actual initialization

Re: [PATCH] c++, match.pd: Evaluate in constant evaluation comparisons like + 12 == + 24 [PR89074]

2022-01-07 Thread Jason Merrill via Gcc-patches
On 1/7/22 07:06, Jakub Jelinek wrote: Hi! The match.pd address_comparison simplification can only handle ADDR_EXPR comparisons possibly converted to some other type (I wonder if we shouldn't restrict it in address_compare to casts to pointer types or pointer-sized integer types, I think we

[pushed] c++: destroying delete, throw in new-expr [PR100588]

2022-01-07 Thread Jason Merrill via Gcc-patches
The standard says that a destroying operator delete is preferred, but that only applies to the delete-expression, not the cleanup if a new-expression initialization throws. As a result of this patch, several of the destroying delete tests don't get EH cleanups, but I'm turning off the warning in

[PATCH 2/2]: C N2653 char8_t: New tests​

2022-01-07 Thread Tom Honermann via Gcc-patches
This patch provides new tests for the core language and compiler dependent library changes proposed in WG14 N2653 [1] for C2x. Tested on Linux x86_64. gcc/testsuite/ChangeLog: 2021-05-31 Tom Honermann * gcc.dg/atomic/c2x-stdatomic-lockfree-char8_t.c: New test. *

[PATCH 1/2]: C N2653 char8_t: Language support

2022-01-07 Thread Tom Honermann via Gcc-patches
This patch implements the core language and compiler dependent library changes proposed in WG14 N2653 [1] for C2x. The changes include: - Change of type for UTF-8 string literals from array of char to array of char8_t (unsigned char) when targeting C2x. - A new atomic_char8_t typedef. - A new

[PATCH 0/2]: C N2653 char8_t implementation

2022-01-07 Thread Tom Honermann via Gcc-patches
This series of patches implements the core language features for the WG14 N2653 [1] proposal to provide char8_t support in C. These changes are intended to align char8_t support in C with the support provided in C++20 via WG21 P0482R6 [2]. These patches addresses feedback provided in response

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

2022-01-07 Thread Tom Honermann via Gcc-patches
This patch completes implementation of the C++20 proposal P0482R6 [1] by adding declarations of std::c8rtomb() and std::mbrtoc8() in if provided by the C library in . This patch addresses feedback provided in response to a previous patch submission [2]. Autoconf changes determine if the C

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

2022-01-07 Thread Michael Meissner via Gcc-patches
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. gcc/testsuite/ 2022-01-07 Michael Meissner PR testsuite/102935 *

[committed] analyzer: add logging of aliasing

2022-01-07 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as 11a2ff8d981110e1562caf7d98e41c1ff2e76056. gcc/analyzer/ChangeLog: * engine.cc (impl_run_checkers): Pass logger to engine ctor. * region-model-manager.cc

[committed] analyzer: implement __analyzer_dump_escaped

2022-01-07 Thread David Malcolm via Gcc-patches
PR analyzer/103546 seems to involve an issue in how the analyzer tracks which decls have escaped, so this patch adds a way to directly test this from DejaGnu. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r12-6377-g4409152a4acaec5b58a93996088d0df9aaa779b8.

[committed] analyzer: add region::is_named_decl_p

2022-01-07 Thread David Malcolm via Gcc-patches
This patch adds a debug function that I've found handy when debugging a problem with handling the decl yy_buffer_stack" in PR analyzer/103546. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r12-6376-gc1b7d28a5987e74232b7f054849f8bd8ccc7e7de.

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

2022-01-07 Thread Qing Zhao via Gcc-patches
> On Jan 5, 2022, at 10:59 AM, Qing Zhao via Gcc-patches > 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: >>> >>>

[pushed] c++: check delete access with trivial init [PR20040]

2022-01-07 Thread Jason Merrill via Gcc-patches
Apparently we need to check the accessibility of the deallocation function even if there is no initialization. Tested x86_64-pc-linux-gnu, applying to trunk. PR c++/20040 gcc/cp/ChangeLog: * init.c (build_new_1): Also build pointer cleanup if TYPE_GETS_DELETE. *

Re: [power-ieee128] OPEN CONV

2022-01-07 Thread Jakub Jelinek via Gcc-patches
On Fri, Jan 07, 2022 at 10:40:50PM +0100, Thomas Koenig wrote: > One thing that one has to watch out for is a big-endian IBM long double > file, so the byte swapping will have to be done before assigning > the value. I've tried to handle that right, i.e. on unformatted read with byte-swapping and

Re: [power-ieee128] OPEN CONV

2022-01-07 Thread Thomas Koenig via Gcc-patches
On 07.01.22 20:52, Jakub Jelinek wrote: Here is completely untested patch that implements something, but doesn't implement the gcc option stuff, nor the CONVERT= syntax to supply multiple conversion options nor done anything about env var nor any testcases. But it tries to have the

Re: [power-ieee128] RFH: LTO broken

2022-01-07 Thread Thomas Koenig via Gcc-patches
Hi Jakub, So, the following patch adds -fbuilding-libgfortran option and uses it together with TARGET_GLIBC_M* checks to decide whether to use libquadmath APIs (for the IEEE quad kind=16 if -fbuilding-libgfortran and not glibc or glibc is older than 2.32) or glibc 2.32 APIs (otherwise). This

[PATCH] PR 103763, Fix fold-vec-splat-floatdouble on power10.

2022-01-07 Thread Michael Meissner via Gcc-patches
Fix fold-vec-splat-floatdouble testsuite failure on power10 When I added support for generating XXSPLTIDP on December 15th, 2021, I missed updating the fold-vec-splat-floatdouble.c test to add to the regex for the instructions generated. This patch fixes that. gcc/testsuite/ 2022-01-07 Michael

Re: [Patch, fortran] PR103366 - [9/10/11/12 Regression] ICE in gfc_conv_gfc_desc_to_cfi_desc, at fortran/trans-expr.c:5647

2022-01-07 Thread Harald Anlauf via Gcc-patches
Hi Paul, Am 07.01.22 um 14:42 schrieb Paul Richard Thomas via Fortran: I doubt that this is a regression on 9-11 branches since the testcase compiles correctly on each of my copies of these branches. IMHO it is rather more likely to have been caused by 64f9623765da3306b0ab6a47997dc5d62c2ea261,

Re: [PATCH] rs6000: Add optimizations for _mm_sad_epu8

2022-01-07 Thread David Edelsohn via Gcc-patches
On Fri, Jan 7, 2022 at 3:57 PM Paul A. Clarke wrote: > > On Fri, Jan 07, 2022 at 02:40:51PM -0500, David Edelsohn via Gcc-patches > wrote: > > +#ifdef __LITTLE_ENDIAN__ > > + /* Sum across four integers with two integer results. */ > > + asm ("vsum2sws %0,%1,%2" : "=v" (result) : "v" (vsum),

Re: [PATCH] rs6000: Add optimizations for _mm_sad_epu8

2022-01-07 Thread Paul A. Clarke via Gcc-patches
On Fri, Jan 07, 2022 at 02:40:51PM -0500, David Edelsohn via Gcc-patches wrote: > +#ifdef __LITTLE_ENDIAN__ > + /* Sum across four integers with two integer results. */ > + asm ("vsum2sws %0,%1,%2" : "=v" (result) : "v" (vsum), "v" (zero)); > + /* Note: vec_sum2s could be used here, but on

Re: [PATCH] rs6000: Add Power10 optimization for most _mm_movemask*

2022-01-07 Thread David Edelsohn via Gcc-patches
On Fri, Jan 7, 2022 at 3:35 PM Paul A. Clarke wrote: > > On Fri, Jan 07, 2022 at 02:23:14PM -0500, David Edelsohn wrote: > > > Power10 ISA added `vextract*` instructions which are realized in the > > > `vec_extractm` instrinsic. > > > > > > Use `vec_extractm` for `_mm_movemask_ps`,

Re: [PATCH] rs6000: Add Power10 optimization for _mm_blendv*

2022-01-07 Thread David Edelsohn via Gcc-patches
On Fri, Jan 7, 2022 at 3:32 PM Paul A. Clarke wrote: > > On Fri, Jan 07, 2022 at 02:15:22PM -0500, David Edelsohn wrote: > > > Power10 ISA added `xxblendv*` instructions which are realized in the > > > `vec_blendv` instrinsic. > > > > > > Use `vec_blendv` for `_mm_blendv_epi8`, `_mm_blendv_ps`,

Re: [PATCH] rs6000: Add Power10 optimization for most _mm_movemask*

2022-01-07 Thread Paul A. Clarke via Gcc-patches
On Fri, Jan 07, 2022 at 02:23:14PM -0500, David Edelsohn wrote: > > Power10 ISA added `vextract*` instructions which are realized in the > > `vec_extractm` instrinsic. > > > > Use `vec_extractm` for `_mm_movemask_ps`, `_mm_movemask_pd`, and > > `_mm_movemask_epi8` compatibility intrinsics, when

Re: [PATCH] rs6000: Add Power10 optimization for _mm_blendv*

2022-01-07 Thread Paul A. Clarke via Gcc-patches
On Fri, Jan 07, 2022 at 02:15:22PM -0500, David Edelsohn wrote: > > Power10 ISA added `xxblendv*` instructions which are realized in the > > `vec_blendv` instrinsic. > > > > Use `vec_blendv` for `_mm_blendv_epi8`, `_mm_blendv_ps`, and > > `_mm_blendv_pd` compatibility intrinsics, when

Re: [PATCH v4] c-format: Add -Wformat-int-precision option [PR80060]

2022-01-07 Thread Joseph Myers
On Fri, 7 Jan 2022, Daniil Stas via Gcc-patches wrote: > > > @@ -4248,7 +4248,7 @@ check_format_types (const substring_loc > > > _loc, && (!pedantic || i < 2) > > > && char_type_flag) > > > continue; > > > - if (types->scalar_identity_flag > > > + if ((types->scalar_identity_flag

Re: [power-ieee128] OPEN CONV

2022-01-07 Thread Jakub Jelinek via Gcc-patches
On Fri, Jan 07, 2022 at 11:26:15AM +0100, Thomas Koenig wrote: > In > > https://gcc.gnu.org/pipermail/fortran/2021-October/056895.html > > I made a suggestion how how the format could look like. I used > a plus sign instead of a comma because I thought the environment > variable should follow

[PATCH] i386: Robustify V2QI and V4QI move patterns

2022-01-07 Thread Uros Bizjak via Gcc-patches
Add sse2 isa attribute where needed and remove where not needed. 2022-01-07 Uroš Bizjak gcc/ChangeLog: * config/i386/mmx.md (*move_internal): Add isa attribute. (*movv2qi_internal): Remve sse2 requirement for alternatives 4,5. Bootstrapped and regression tested on x86_64-linux-gnu

Re: [PATCH] rs6000: Add optimizations for _mm_sad_epu8

2022-01-07 Thread David Edelsohn via Gcc-patches
+#ifdef __LITTLE_ENDIAN__ + /* Sum across four integers with two integer results. */ + asm ("vsum2sws %0,%1,%2" : "=v" (result) : "v" (vsum), "v" (zero)); + /* Note: vec_sum2s could be used here, but on little-endian, vector + shifts are added that are not needed for this use-case. + A

Re: [PATCH] rs6000: Add Power10 optimization for most _mm_movemask*

2022-01-07 Thread David Edelsohn via Gcc-patches
> Power10 ISA added `vextract*` instructions which are realized in the > `vec_extractm` instrinsic. > > Use `vec_extractm` for `_mm_movemask_ps`, `_mm_movemask_pd`, and > `_mm_movemask_epi8` compatibility intrinsics, when `_ARCH_PWR10`. > > 2021-10-21 Paul A. Clarke > > gcc > *

Re: [PATCH] rs6000: Add Power10 optimization for _mm_blendv*

2022-01-07 Thread David Edelsohn via Gcc-patches
> Power10 ISA added `xxblendv*` instructions which are realized in the > `vec_blendv` instrinsic. > > Use `vec_blendv` for `_mm_blendv_epi8`, `_mm_blendv_ps`, and > `_mm_blendv_pd` compatibility intrinsics, when `_ARCH_PWR10`. > > Also, copy a test from i386 for testing `_mm_blendv_ps`. > This

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

2022-01-07 Thread Tomas Kalibera via Gcc-patches
Mingw32 targets use ms_printf format for printf, but mingw-w64 when configured for UCRT uses gnu_format (via stdio.h).  GCC then checks both formats, which means that one cannot print a 64-bit integer without a warning. All these lines issue a warning:   printf("Hello %"PRIu64"\n", x); // 1  

Re: [PATCH][GCC11] PR tree-optimization/103603 - Directly resolve range_of_stmt dependencies. (Port of PR 103231/103464)

2022-01-07 Thread Andrew MacLeod via Gcc-patches
On 12/7/21 15:19, Andrew MacLeod wrote: The following patch is a slight rework of the 2 patches which flatten rangers call stack.  It needed some tweaking since some of the routines have changed name or been adjusted. This has been bootstrapped on x86_64-pc-linux-gnu with no regressions.  OK

Re: [PING^3 PATCH] rs6000: Add Power10 optimization for _mm_blendv*

2022-01-07 Thread Paul A. Clarke via Gcc-patches
On Thu, Nov 18, 2021 at 08:25:35PM -0600, Paul A. Clarke via Gcc-patches wrote: > On Mon, Nov 08, 2021 at 11:42:27AM -0600, Paul A. Clarke via Gcc-patches > wrote: > > Gentle ping... > > Gentle re-ping. Gentle re-re-ping. > > On Wed, Oct 20, 2021 at 08:42:07PM -0500, Paul A. Clarke via

Re: [power-ieee128] RFH: LTO broken

2022-01-07 Thread Jakub Jelinek via Gcc-patches
On Fri, Jan 07, 2022 at 03:25:57PM +0100, Thomas Koenig wrote: > > > 00251038 06ad0015 R_PPC64_JMP_SLOT > > > __cabsieee128 + 0 > > > All these should for POWER_IEEE128 use atan2q@QUADMATH_1.0 etc. > > > > So, seems all these come from f951 compiled

[Ada] Read directory in Ada.Directories.Start_Search rather than Get_Next_Entry

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
The Ada.Directories directory search function is changed so the contents of the directory is now read in Start_Search instead of in Get_Next_Entry. Start_Search now stores the result of the directory search in the search object, with Get_Next_Entry returning results from the search object. This

[Ada] Fix the check of the 'Old prefix

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
The check did miss the part of Ada 2022 RM 6.1.1 (27/5) that the use of an entity declared within the postcondition expression is allowed if it's declared within the prefix itself. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_attr.adb (Check_Reference): Fix

[Ada] Fix uses of pragma Unreferenced in MinGW runtime unit

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
GNAT now emits more warnings about pragma Unreferenced. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnarl/s-taprop__mingw.adb (Timed_Sleep): Remove "pragma Unreferenced" for Result. (Timed_Delay): Likewise.diff --git

[Ada] Fix layout of pragma Inline in generated AST unit

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
Make the generated nmake.ads unit look more like it was written with GNAT style rules in mind; semantics is unaffected. Cleanup related to fix of default initialization in multi-dimensional arrays, which used to explicitly call the Nmake.Make_Null routine. Tested on x86_64-pc-linux-gnu,

[Ada] Fix style in expansion of multi-dimensional array aggregates

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_aggr.adb (Build_Array_Aggr_Code): Fix inconsistent style in comments and code.diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb --- a/gcc/ada/exp_aggr.adb +++

[Ada] Crash in class-wide pre/postconditions

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
The compiler may crash processing a class-wide pre/postcondition that has dispatching calls using the Object.Operation notation. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * atree.ads (Traverse_Func_With_Parent): New generic subprogram.

[Ada] More default initialization for multi-dim array aggregates

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
Expansion of multi-dimensional array aggregates with boxes (e.g. "(others => (others => <>))" only applied default initialization to components of a scalar type with Default_Value aspect and of an access type (which are initialized by default to null). Now default initialization is applied to

[Ada] Cleanup and modification of unreferenced warnings

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
This patch modifies the behavior of pragma Unreferenced to be consistent in its behavior, by counting all variables specified as "Out" actual parameters as being referenced instead of only the first "Out" parameter. Additionally, much related duplicated has been removed. Tested on

[Ada] Spurious error caused by order of interfaces in full view

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
The frontend reports a spurious error when the order of interfaces differ between the full view and the partial view of a private type defined in a generic unit. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch3.adb (Reorder_Interfaces): When the conflicting

[Ada] Fix __gnat_kill on Windows

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
Terminate process only on terminating signals. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * adaint.c (__gnat_kill): Terminate process only in case of SIGKILL, SIGINT, SIGBREAK, SIGTERM, SIGABRT. Do not call OpenProcess if not going to terminate

[Ada] Fix a couple of issues with pragma Inspection_Point

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
The first issue is that the pragma may require the address of the objects subject to it to have their address taken, like Asm_Input and Asm_Output, so these objects need to be specifically marked. The second issue is that the detection of unfrozen objects was not robust enough and would miss

[Ada] Remove repeated routines for printing AST in Mixed_Case

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup; behaviour is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * osint.adb (To_Lower): Clarify that only To_Lower function causes bootstrap issues; fix style. * treepr.adb (Print_Str_Mixed_Case): Reuse existing case conversion

[Ada] Simplify traversal in hooking of transient scopes

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
Subprogram calls can be detected with just Traverse_Func, we don't need a separate global variable or a Traverse_Proc (which is a wrapper for Traverse_Func with a yet another variable). Cleanup related to handling of transient scopes in various routines for (pre)analysis and resolution. Semantics

[Ada] Remove extra space before THEN keywords

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
Style cleanup; semantics is unaffected. Offending occurrences found with: $ grep "[A-Za-z0-9\)]+ +then$" -C 3 and reviewed manually, because some of them were due to explicit layout. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch5.adb, exp_disp.adb,

[Ada] Fix exit status of GNAT.Expect.Close call on running process

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
Fix exit status processing logic in __gnat_waitpid. Fix GNAT.Expect.Interrupt on Windows. It was terminating the calling process. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * expect.c (__gnat_waitpid): Use macros WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG,

[Ada] Remove explicit expansion of block with general case statement

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
When a general case statements is rewritten into a block, it is enough to call Analyze on this block node, because analysis of non-expressions automatically triggers expansion. Cleanup originating from investigating many variants of routines for (pre)analysis and resolution. Tested on

[Ada] Update -gnatwr doc for import of parent package

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
This construct is now flagged with -gnatwr. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update -gnatwr documentation. * gnat_ugn.texi: Regenerate.diff --git

[Ada] Fix comment about subprogram unnesting and unconstrained arrays

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
The original code for subprogram unnesting used 'Access for unconstrained arrays. This was recently changed to 'Unchecked_Access for GNAT-to-LLVM, but a reference to 'Access still appears in the comment. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_unst.adb

[Ada] Fix inconsistent quoting in messages about compile-time errors

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
In some messages of the form "XXX_Error will be raised at run time" the XXX_Error was enclosed in quotes, in other it was not. Now all messages of this form are emitted without quotes. Note: in messages emitted from routine Possible_Local_Raise we still quote names of exceptions, but there indeed

[Ada] Consistent suppression for warnings inside null loops

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
Warnings for nodes inside null loops were suppressed if posted with Error_Msg_NLE and emitted if posted with other error-reporting routines. This was inconsistent and error-prone. Part of removing quotes around exception names in messages, because messages without quotes will be now emitted by

[Ada] Remove unnecessary guard for inserting non-empty list

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
Calls to Insert_List_After and Insert_List_Before applied to empty lists do nothing, so there is no need to explicitly guard against such calls. Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch3.adb

[Ada] Remove unnecessary guards for appending non-empty lists

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
Calls to Append_List and Append_List_To applied with empty lists do nothing, so there is no need to explicitly guard against such calls. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch3.adb (Build_Init_Procedure): Remove unnecessary guard. * exp_disp.adb

[Ada] Check scalar range in arrays constructed by concatenation

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
When concatenating scalars, we should check their range as in the following example: type uint8 is range 0 .. 255; type Array_Type is array (Positive range <>) of uint8; Array_1 : Array_Type := 42 & 256; This commit leads to emitting: - a warning if a constraint error is expected

[Ada] treepr: print value only for discrete types

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
Follow-on to previous change "Print value of static expression". Print only if the type is discrete. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * treepr.adb (Print_Node_Ref): Change "not Is_Array_Type" to "Is_Discrete_Type".diff --git a/gcc/ada/treepr.adb

[Ada] Use non-internal representation for access subprograms if UC to Address

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
If we have an Unchecked_Conversion between an access to subprogram and System.Address, we want to try to use a thin subprogram pointer. Try to do this automatically as much as possible and add one to the RTS. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ *

[Ada] treepr: Print value of static expression

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
When printing a node, if it happens to be an integer-like expression whose value is known, print that value. This makes debugging a little easier. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * treepr.adb (Print_Node_Ref): Print the value if available.diff --git

[Ada] Add an option to Get_Fullest_View to not recurse

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
This option is used by GNAT LLVM. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.ads, sem_util.adb (Get_Fullest_View): Add option to not recurse and return the next-most-fullest view.diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb ---

[Ada] Warn on import of parent package

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
There is no need to say "with P;" in package P.Q. This patch adds a warning for that case. We also remove with clauses in our own code that trigger the warning. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch10.adb (Check_Redundant_Withs): Add a warning if a

[Ada] Small cleanup of osint-m.adb

2022-01-07 Thread Pierre-Marie de Rodat via Gcc-patches
We remove the "pragma Elaborate_All (Osint)", because it is no longer needed. That allows us to remove the "with Osint" (i.e. with of our own parent). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * osint-m.adb: Remove with_clause and pragma.diff --git a/gcc/ada/osint-m.adb

Re: [PATCH v4] c-format: Add -Wformat-int-precision option [PR80060]

2022-01-07 Thread Daniil Stas via Gcc-patches
On Tue, 21 Dec 2021 00:43:24 +0200 Daniil Stas wrote: > On Sat, 27 Nov 2021 22:18:23 + > Daniil Stas wrote: > > > This option is enabled by default when -Wformat option is enabled. A > > user can specify -Wno-format-int-precision to disable emitting > > warnings when passing an argument of

Re: [PATCH] Fix alignment of stack slots for overaligned types [PR103500]

2022-01-07 Thread H.J. Lu via Gcc-patches
On Fri, Jan 7, 2022 at 7:20 AM Alex Coplan via Gcc-patches wrote: > > Hi Richard, > > Thanks for the review. > > On 20/12/2021 13:19, Richard Sandiford wrote: > > Alex Coplan via Gcc-patches writes: > > > Hi, > > > > > > This fixes PR103500 i.e. ensuring that stack slots for > > >

Re: [PATCH] Fix alignment of stack slots for overaligned types [PR103500]

2022-01-07 Thread Alex Coplan via Gcc-patches
Hi Richard, Thanks for the review. On 20/12/2021 13:19, Richard Sandiford wrote: > Alex Coplan via Gcc-patches writes: > > Hi, > > > > This fixes PR103500 i.e. ensuring that stack slots for > > passed-by-reference overaligned types are appropriately aligned. For the > > testcase: > > > >

Re: [committed] c++: Add testcase for recently fixed PR [PR69681]

2022-01-07 Thread Patrick Palka via Gcc-patches
On Fri, 7 Jan 2022, Jakub Jelinek wrote: > On Thu, Jan 06, 2022 at 10:44:09AM -0500, Patrick Palka via Gcc-patches wrote: > > Fixed ever since r12-6188. > > > > PR c++/69681 > > > > gcc/testsuite/ChangeLog: > > > > * g++.dg/cpp0x/constexpr-compare2.C: New test. > > Note, I've tested

Re: [PATCH 3/6] ira: Add ira_subloop_allocnos_can_differ_p

2022-01-07 Thread Vladimir Makarov via Gcc-patches
On 2022-01-06 09:47, Richard Sandiford wrote: color_pass has two instances of the same code for propagating non-cap assignments from parent loops to subloops. This patch adds a helper function for testing when such propagations are required for correctness and uses it to remove the duplicated

Re: [PATCH 2/6] ira: Add comments and fix move_spill_restore calculation

2022-01-07 Thread Vladimir Makarov via Gcc-patches
On 2022-01-06 09:46, Richard Sandiford wrote: This patch adds comments to describe each use of ira_loop_border_costs. I think this highlights that move_spill_restore was using the wrong cost in one case, which came from tranposing [0] and [1] in the original (pre-ira_loop_border_costs)

Re: [PATCH 1/6] ira: Add a ira_loop_border_costs class

2022-01-07 Thread Vladimir Makarov via Gcc-patches
On 2022-01-06 09:46, Richard Sandiford wrote: The final index into (ira_)memory_move_cost is 1 for loads and 0 for stores. Thus the combination: entry_freq * memory_cost[1] + exit_freq * memory_cost[0] is the cost of loading a register on entry to a loop and storing it back on exit from

Re: [PATCH 0/6] ira: Fix performance regression in exchange2 [PR98782]

2022-01-07 Thread Vladimir Makarov via Gcc-patches
On 2022-01-06 09:45, Richard Sandiford wrote: This series of patches recovers the exchange2 performance lost in the GCC 11 timeframe (at least on aarch64 and Power9 -- thanks Pat for testing the latter). There are 6 patches, split into two groups of 3. The first 3 are just preparatory

Re: [power-ieee128] RFH: LTO broken

2022-01-07 Thread Thomas Koenig via Gcc-patches
Hi Jakub, 00251038 06ad0015 R_PPC64_JMP_SLOT __cabsieee128 + 0 All these should for POWER_IEEE128 use atan2q@QUADMATH_1.0 etc. So, seems all these come from f951 compiled sources. For user code, I think the agreement was if you want to use

Re: [PATCH] libgomp, OpenMP, nvptx: Low-latency memory allocator

2022-01-07 Thread Andrew Stubbs
On 06/01/2022 17:53, Tom de Vries wrote: My current understanding is that this is a backend problem, and needs to be fixed by defining atomic_store patterns which take care of this peculiarity. You mentioned on IRC that I ought to initialize the free chain using atomics also, and that you

[PATCH] libstdc++: Fix and simplify freestanding configuration [PR103866]

2022-01-07 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux and by building a mips-none-elf cross with --disable-hosted-libstdcxx --without-headers (which fails currently). Any objections? This fixes the --disable-hosted-libstdcxx build so that it works with --without-headers. Currently you need to also use --with-newlib, which

[Patch, fortran] PR103366 - [9/10/11/12 Regression] ICE in gfc_conv_gfc_desc_to_cfi_desc, at fortran/trans-expr.c:5647

2022-01-07 Thread Paul Richard Thomas via Gcc-patches
I doubt that this is a regression on 9-11 branches since the testcase compiles correctly on each of my copies of these branches. IMHO it is rather more likely to have been caused by 64f9623765da3306b0ab6a47997dc5d62c2ea261, which introduced this new form of gfc_conv_gfc_desc_to_cfi_desc. The

Re: [power-ieee128] RFH: LTO broken

2022-01-07 Thread Jakub Jelinek via Gcc-patches
On Fri, Jan 07, 2022 at 12:29:25PM +0100, Jakub Jelinek wrote: > we don't do it consistently: > readelf -Wr > /home/jakub/gcc/obj38/powerpc64le-unknown-linux-gnu/libgfortran/.libs/libgfortran.so.5.0.0 > | grep ieee128 > 00250310 01280015 R_PPC64_JMP_SLOT

Re: [PATCH] target: [PR102941] Fix inline-asm flags with non-REG_P output

2022-01-07 Thread Richard Sandiford via Gcc-patches
apinski--- via Gcc-patches writes: > From: Andrew Pinski > > So the problem here is that arm_md_asm_adjust would > just create a set directly to the output memory which is wrong. > It needs to output to a temp register first and then do a > move. > > OK? Bootstrapped and tested on

Re: [vect] Re-analyze all modes for epilogues

2022-01-07 Thread Richard Sandiford via Gcc-patches
"Andre Vieira (lists)" writes: > Made the suggested changes. > > Regarding the name change to partial vectors, I agree in the name change > since that is the terminology we are using in the loop_vinfo members > too, but is there an actual difference between predication/masking and > partial

[PATCH] c++, match.pd: Evaluate in constant evaluation comparisons like + 12 == + 24 [PR89074]

2022-01-07 Thread Jakub Jelinek via Gcc-patches
Hi! The match.pd address_comparison simplification can only handle ADDR_EXPR comparisons possibly converted to some other type (I wonder if we shouldn't restrict it in address_compare to casts to pointer types or pointer-sized integer types, I think we shouldn't optimize (short) () == (short) ()

Re: [PATCH] [RTL/fwprop] Allow propagations from inner loop to outer loop.

2022-01-07 Thread Richard Sandiford via Gcc-patches
liuhongt via Gcc-patches writes: >>Huh, loop_father should never be NULL. Maybe when fwprop is run after RTL >>loop opts you instead want to add a check for current_loops or >>alternelatively initialize loops in fwprop. > > Oh, I didn't know that, i once saw there's ICE and thought it's related

Re: [PATCH v4 04/12] LoongArch Port: Machine Decsription files.

2022-01-07 Thread 程璐璐
在 2022/1/7 上午1:54, Xi Ruoyao 写道: On Fri, 2021-12-24 at 17:28 +0800, chenglulu wrote: +(define_insn "*zero_extendsidi2_internal" +  [(set (match_operand:DI 0 "register_operand" "=r,r,r") +   (subreg:DI (match_operand:SI 1 "nonimmediate_operand" "r,ZC,W") 0))] +  "TARGET_64BIT" +  "@ +  

Re: [power-ieee128] RFH: LTO broken

2022-01-07 Thread Jakub Jelinek via Gcc-patches
On Thu, Jan 06, 2022 at 09:01:54PM +0100, Thomas Koenig wrote: > > On 06.01.22 06:00, Michael Meissner via Fortran wrote: > > I pushed the patch to the branch. > > Test results are looking quite good right now. I've just tried to build libgfortran on an old glibc system (gcc112.fsffrance.org)

Re: [PATCH 1/6] ira: Add a ira_loop_border_costs class

2022-01-07 Thread Richard Sandiford via Gcc-patches
Jan Hubicka writes: >> The final index into (ira_)memory_move_cost is 1 for loads and >> 0 for stores. Thus the combination: >> >> entry_freq * memory_cost[1] + exit_freq * memory_cost[0] >> >> is the cost of loading a register on entry to a loop and >> storing it back on exit from the loop.

Re: [power-ieee128] OPEN CONV

2022-01-07 Thread Thomas Koenig via Gcc-patches
On 07.01.22 10:22, Jakub Jelinek wrote: On Thu, Jan 06, 2022 at 09:01:54PM +0100, Thomas Koenig wrote: On 06.01.22 06:00, Michael Meissner via Fortran wrote: What is still missing is the conversion for unformatted I/O, both ways. I'll start doing some stuff on it. Just one question: What

Re: [committed] c++: Add testcase for recently fixed PR [PR69681]

2022-01-07 Thread Jakub Jelinek via Gcc-patches
On Thu, Jan 06, 2022 at 10:44:09AM -0500, Patrick Palka via Gcc-patches wrote: > Fixed ever since r12-6188. > > PR c++/69681 > > gcc/testsuite/ChangeLog: > > * g++.dg/cpp0x/constexpr-compare2.C: New test. Note, I've tested my

[power-ieee128] OPEN CONV

2022-01-07 Thread Jakub Jelinek via Gcc-patches
On Thu, Jan 06, 2022 at 09:01:54PM +0100, Thomas Koenig wrote: > > On 06.01.22 06:00, Michael Meissner via Fortran wrote: > What is still missing is the conversion for unformatted I/O, both > ways. I'll start doing some stuff on it. Just one question: > What are functions that I can use to

Re: [PATCH] nvptx: Add support for PTX's cnot instruction.

2022-01-07 Thread Tom de Vries via Gcc-patches
On 1/6/22 17:42, Roger Sayle wrote: Happy New Year for 2022. This is a simple patch, now that the nvptx backend has transitioned to STORE_FLAG_VALUE=1, that adds support for NVidia's cnot instruction, that implements C/C++ style logical negation. Happy newyear to you too :) LGTM, please