[PATCH] middle-end/102518 - avoid invalid GIMPLE during inlining

2021-09-30 Thread Richard Biener via Gcc-patches
When inlining we have to avoid mapping a non-lvalue parameter value into a context that prevents the parameter to be a register. Formerly the register were TREE_ADDRESSABLE but now it can be just DECL_NOT_GIMPLE_REG_P. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-09-30 Richa

[Ada] Subprogram_Variant in ignored ghost code

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
If a Subprogram_Variant aspect is given in ghost code, and the assertion policy is set to Ghost => Ignore, and the -gnata switch is used, the compiler gives spurious error messages. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch6.adb (Expand_Call_Helper): Do not call

[Ada] Empty CUDA_Global procedures when compiling for host

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
This commit makes GNAT empty CUDA_Global procedures when compiling for the host. This is required because CUDA_Global procedures could be referencing entities that only exist on the GPU, which would result in errors from the linker at link time. We empty the procedures rather than completely delet

[Ada] Improved checking for invalid index values when accessing array elements

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
Ensure that the consequences of indexing into an array with the value of an uninitialized variable are consistent with Ada RM 13.9.1(11) by generating additional validity checks in some array indexing cases. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * checks.ads: Define

[Ada] More work on efficiency improvements

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
Gather more statistics, and make some minor efficiency improvements. Adjust the heuristic for the order in which we choose field offsets. This reduces the maximum size of a node from 10 slots to 9 slots, and makes the compiler a little bit faster. Add more special cases for fields whose offsets s

[Ada] Document rounding mode assumed for dynamic floating-point computations

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
It is only documented for static computations currently. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_rm/implementation_defined_characteristics.rst: Document the rounding mode assumed for dynamic computations as per 3.5.7(16). * gnat_rm.texi: Rege

[Ada] Crash on improper use of GNAT attribute Type_Key

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
This patch fixes a crash on a case statement whose expression is an attribute reference Type_Key, which yields a String. The attribute reference may have been fully analyzed, and the resolution against Any_Discrete fails to detect the error. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/a

[Ada] Add missing guard before call to Interface_Present_In_Ancestor

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
Calling the function on an unspecified type may trigger the failure of the precondition of the Interfaces accessor. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_type.adb (Specific_Type): Check that the type is tagged before calling Interface_Present_In_Ancesto

[Ada] Add new debug switch -gnatd.8

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
It will be used to tame the inlining of expression functions. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * debug.adb (d.8): Document usage. * fe.h (Debug_Flag_Dot_8): Declare.diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb --- a/gcc/ada/debug.adb +++ b/gcc/ada/

[Ada] Spurious warning about hiding in generic instantiation

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
Warnings about declarations being hidden can be issued in some cases when compiling a generic instantiation, but such warnings aren't correct (hiding can be flagged in a generic, but shouldn't be in an instance). The warning is now suppressed within instances. Tested on x86_64-pc-linux-gnu, commit

[Ada] Stub CUDA_Device aspect

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
The CUDA_Device aspect allows specifying an entity as being device (GPU)-only. This commit implements the basic machinery to detect the aspect/pragma, but does not implement any functionality (a warning is issued instead). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * aspe

[Ada] Add more node unions

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
Also fix [se]info.h output to include both declarations and definitions of the functions for unions so that unions can refer to other unions without being order-dependent. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gen_il-gen-gen_nodes.adb (N_Alternative, N_Is_Case_Choi

[Ada] Crash on renaming within declare expression

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
This patch corrects an issue in the compiler whereby a renaming within a declare expression may result in a crash in some systems. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_dbug.adb (Debug_Renaming_Declaration): Add check for Entity present for Ren to preve

[Ada] Assert_Failure on derived type with inherited Default_Initial_Condition

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
A type derived from a private type that specifies Default_Initial_Condition can lead to an assertion failure when the compiler builds the body of the derived type's DIC procedure. Some code inherited from type invariants doesn't apply in the DIC case, and performed an incorrect assertion testing fo

[Ada] Ada2022: AI12-0195 overriding class-wide pre/postconditions

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
New implementation of class-wide pre/postconditions that relies on helpers to move the corresponding runtime checks to the caller side. This implementation also adds indirect call wrappers and dispatch table wrappers that facilitate combining class-wide conditions with access-to-subprogram types wi

[Ada] Implementation of AI12-0212: iterator specs in array aggregates (II)

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
This patch adds a guard to the code generated in the second pass of the two-pass expansion for array aggregates described in AI12-0212. The guard is needed to prevent a spurious constraint error when incrementing the index used for aggregate insertion, before exiting the loop. Tested on x86_64-pc

[Ada] Fix deleting CodePeer files for non-ordinary units

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
A routine for deleting SCIL files generated by previous CodePeer runs didn't expect compilation units that are subprogram renamings, generic renamings and generic subprogram declarations. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * comperr.adb (Delete_SCIL_Files): Handle

[Ada] Improve error message for .ali file version mismatch

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
When the binder detects a mismatch between the versions of two .ali files, include the version information in the resulting message. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * bcheck.adb (Check_Versions): Add support for the case where the .ali file contains bot

[Ada] Fix bug in inherited user-defined-literal aspects for tagged types

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
In some cases, an integer literal of a tagged type whose Integer_Literal aspect is inherited from an ancestor type was not handled correctly by the compiler. In particular, Ada RM 13.1(15.5) was not correctly implemented, resulting in the incorrect rejection of legal uses of integer literals with (

[Ada] Info. gathering in preparation for more efficiency improvements

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
Information gathering in preparation for more efficiency improvements. We gather statistics from the running compiler, and we also have gen_il generate information in the form of comments. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * atree.adb: Gather and print statistics

[Ada] Support gmem.out longer than 2G on 32 bit platforms

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
C stream fopen function opens file for size no more than 2G by default on 32 bit platforms. Use fopen and other stream functions from System.CRTL to overcome this limit. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/memtrack.adb (Putc): New routine wrapped around f

[Ada] Spurious range checks on aggregate with non-static bounds

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
Refine predicate Must_Slide to ensure that no spurious range checks are generated when context subtype and aggregate subtype are non-static. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_aggr.adb (Must_Slide): If the aggregate only contains an others_clause no

[Ada] Improve error message for .ali file version mismatch

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
When the binder detects a mismatch between the versions of two .ali files, include the version information in the resulting message. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * bcheck.adb (Check_Versions): In the case of an ali file version mismatch, if distinct

[Ada] No ABE check needed for an expression function call.

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
If -gnatE is specified, then in some cases a call to a subprogram includes a check that the body of the subprogram has been elaborated. No such check is needed in the case of an expression function that is not a completion; the function has no prior declaration. However, in some cases the compiler

[Ada] Fix CodePeer warnings

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
This commit fixes warnings emitted by the CodePeer static analyzer. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_aggr.adb (Resolve_Iterated_Component_Association): Initialize Id_Typ to Any_Type by default.diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.ad

[Ada] Switch to SR0660

2021-09-30 Thread Pierre-Marie de Rodat via Gcc-patches
Change to 64bit time to avoid Unix Epochalypse. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-parame__vxworks.ads (time_t_bits): Change to Long_Long_Integer'Size.diff --git a/gcc/ada/libgnat/s-parame__vxworks.ads b/gcc/ada/libgnat/s-parame__vxworks.ads --

[Patch] Fortran: Various CLASS + assumed-rank fixed [PR102541]

2021-09-30 Thread Tobias Burnus
Hi all, this patch fixes a bunch of issues with CLASS. * * * Side remark: I disliked the way CLASS is represented when it was introduced; when writing the testcase for this PR and kept fixing the testcase fallout, I started to hate it! I am sure that there are more issues – but I tried hard no

RE: [PATCH][GCC] arm: Enable Cortex-R52+ CPU

2021-09-30 Thread Przemyslaw Wirkus via Gcc-patches
> Subject: Re: [PATCH][GCC] arm: Enable Cortex-R52+ CPU > > This is OK Applying as r52+ is now in Binutils. commit cd08eae26ed23497ace5f4ee6f3a41eb5bd36c38 > Ramana > > On 22/09/2021, 09:45, "Przemyslaw Wirkus" > wrote: > > Patch is adding Cortex-R52+ as 'cortex-r52plus' command line >

Re: [PATCH] rs6000: Remove builtin mask check from builtin_decl [PR102347]

2021-09-30 Thread Segher Boessenkool
Hi! On Thu, Sep 30, 2021 at 11:06:50AM +0800, Kewen.Lin wrote: [ huge snip ] > Based on the understanding and testing, I think it's safe to adopt this patch. > Do both Peter and you agree the rs6000_expand_builtin will catch the invalid > built-in? > Is there some special case which probably es

Re: [PATCH] c++: Implement C++20 -Wdeprecated-array-compare [PR97573]

2021-09-30 Thread Marek Polacek via Gcc-patches
On Thu, Sep 30, 2021 at 03:34:24PM -0400, Jason Merrill wrote: > On 9/30/21 10:50, Marek Polacek wrote: > > This patch addresses one of my leftovers from GCC 11. C++20 introduced > > [depr.array.comp]: > > "Equality and relational comparisons between two operands of array type are > > deprecated."

Re: [PATCH][GCC] arm: Add Cortex-R52+ multilib

2021-09-30 Thread Joel Sherrill
On Thu, Sep 30, 2021, 3:37 PM Przemyslaw Wirkus wrote: > > Subject: Re: [PATCH][GCC] arm: Add Cortex-R52+ multilib > > > > I think the RTEMS multilibs are based on the products that RTEMS > supports, > > so this is really the RTEMS maintainers' call. > > > > Joel? > > Ping :) > I'm ok deferring

RE: [PATCH][GCC] arm: Add Cortex-R52+ multilib

2021-09-30 Thread Przemyslaw Wirkus via Gcc-patches
> Subject: Re: [PATCH][GCC] arm: Add Cortex-R52+ multilib > > I think the RTEMS multilibs are based on the products that RTEMS supports, > so this is really the RTEMS maintainers' call. > > Joel? Ping :) > On 22/09/2021 09:46, Przemyslaw Wirkus via Gcc-patches wrote: > > Patch is adding multili

Re: [committed] libstdc++: Specialize std::pointer_traits<__normal_iterator>

2021-09-30 Thread François Dumont via Gcc-patches
Here is the _Safe_iterator one. Doing so I noticed that pointer_traits rebind for __normal_iterator was wrong and added tests on it. For _Safe_iterator maybe I should specialize only when instantiated with __normal_iterator ? Or maybe limit to random_access_iterator_tag ? Whatever the point

Re: [PATCH 2/2] c++: __is_trivially_xible and multi-arg aggr paren init [PR102535]

2021-09-30 Thread Jason Merrill via Gcc-patches
On 9/30/21 12:52, Patrick Palka wrote: is_xible_helper assumes only 0- and 1-argument ctors can be trivial, but C++20 aggregate paren init means multi-arg ctors can now be trivial too. Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/11? OK. PR c++/10253

Re: [PATCH 1/2] c++: order of trailing arguments in a trait expr

2021-09-30 Thread Jason Merrill via Gcc-patches
On 9/30/21 12:52, Patrick Palka wrote: When parsing a variadic trait expression, we build up the list of trailing arguments in reverse, but we're neglecting to reverse the list to its true order afterwards. This causes us to confuse the meaning of e.g. __is_xible(x, y, z) and __is_xible(x, z, y)

Re: PING #2 [PATCH] warn for more impossible null pointer tests [PR102103]

2021-09-30 Thread Joseph Myers
On Thu, 30 Sep 2021, Martin Sebor via Gcc-patches wrote: > Jason, since you approved the C++ changes, would you mind looking > over the C bits and if they look good to you giving me the green > light to commit the patch? > > https://gcc.gnu.org/pipermail/gcc-patches/2021-September/579693.html Th

[LM32] Fix '"LINK_GCC_C_SEQUENCE_SPEC" redefined' warning

2021-09-30 Thread Jan-Benedict Glaw
Hi! When configuring GCC for --target=lm32-uclinux --enable-werror-always, it breaks here: [all 2021-09-30 08:55:55] /usr/lib/gcc-snapshot/bin/g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings

Re: [PATCH] c++: Implement C++20 -Wdeprecated-array-compare [PR97573]

2021-09-30 Thread Jason Merrill via Gcc-patches
On 9/30/21 10:50, Marek Polacek wrote: This patch addresses one of my leftovers from GCC 11. C++20 introduced [depr.array.comp]: "Equality and relational comparisons between two operands of array type are deprecated." so this patch adds -Wdeprecated-array-compare (enabled by default in C++20).

Re: [RFC][Patch][middle-end/PR102359]Not add initialization for READONLY variables with -ftrivial-auto-var-init

2021-09-30 Thread Jason Merrill via Gcc-patches
On 9/30/21 11:42, Qing Zhao wrote: On Sep 30, 2021, at 1:54 AM, Richard Biener wrote: On Thu, 30 Sep 2021, Jason Merrill wrote: On 9/29/21 17:30, Qing Zhao wrote: Hi, PR102359 (ICE gimplification failed since r12-3433-ga25e0b5e6ac8a77a) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10235

[AVR] Fix unused argument warning

2021-09-30 Thread Jan-Benedict Glaw
Hi! Configuring GCC with --target=avr-elf --enable-werror-always, I see this warning that's easy to fix. The options are parsed with a lot of #ifdefs and it may actually just be unused. Let's just mark it as such. [all 2021-09-30 00:43:46] /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -O2 -DIN

Re: [PATCH, v3] c++: Fix up synthetization of defaulted comparison operators on classes with bitfields [PR102490]

2021-09-30 Thread Jason Merrill via Gcc-patches
On 9/30/21 13:24, Jakub Jelinek wrote: On Wed, Sep 29, 2021 at 03:38:45PM -0400, Jason Merrill wrote: It ought to be possible to defer check_final_overrider, but it sounds awkward. Or maybe_instantiate_noexcept could use the non-defining path in build_comparison_op. Maybe we want a maybe_synth

Go patch committed: Avoid calling Expression::type before lowering

2021-09-30 Thread Ian Lance Taylor via Gcc-patches
For some future work on the Go frontend it will be annoying to have to make Expression::type work before the lowering pass, so this patch changes the frontend so that that doesn't happen. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian patch.txt 19b5a1147764

Re: [PATCH] Improve jump threading dump output.

2021-09-30 Thread Jeff Law via Gcc-patches
On 9/28/2021 7:53 AM, Aldy Hernandez wrote: On 9/28/21 3:47 PM, Jeff Law wrote: On 9/28/2021 3:45 AM, Aldy Hernandez wrote: In analyzing PR102511, it has become abundantly clear that we need better debugging aids for the jump threader solver.  Currently debugging these issues is a nightm

Re: [PATCH] c++: Suppress error when cv-qualified reference is introduced by typedef [PR101783]

2021-09-30 Thread nick huang via Gcc-patches
>>You may need to run contrib/gcc-git-customization.sh to get the git >>gcc-verify command. I re-setup and can use git gcc-verify. Now I can see it rejects because I forgot to add a description of modified file. Now that it passes gcc-verify and I attach the changelog as attachment. Thank you

[PATCH] i386: Eliminate sign extension after logic operation [PR89954]

2021-09-30 Thread Uros Bizjak via Gcc-patches
Convert (sign_extend:WIDE (any_logic:NARROW (memory, immediate))) to (any_logic:WIDE (sign_extend (memory)), (sign_extend (immediate))). This eliminates sign extension after logic operation. 2021-09-30 Uroš Bizjak gcc/ PR target/89954 * config/i386/i386.md (sign_extend:WIDE (any_lo

[PATCH, v3] c++: Fix up synthetization of defaulted comparison operators on classes with bitfields [PR102490]

2021-09-30 Thread Jakub Jelinek via Gcc-patches
On Wed, Sep 29, 2021 at 03:38:45PM -0400, Jason Merrill wrote: > It ought to be possible to defer check_final_overrider, but it sounds > awkward. > > Or maybe_instantiate_noexcept could use the non-defining path in > build_comparison_op. > > Maybe we want a maybe_synthesize_method that actually b

Re: [PATCH, part 2] PR 102458 - issues with simplification of SIZE intrinsic applied to automatic arrays

2021-09-30 Thread Tobias Burnus
Dear Harald, dear all, On 29.09.21 21:20, Harald Anlauf via Fortran wrote: I think I have solved the remaining issue in PR 102458 that prevented the simplification of an expression involving a static initialization and the evaluation of the SIZE of an automatic array which has provable constant

[PATCH 2/2] c++: __is_trivially_xible and multi-arg aggr paren init [PR102535]

2021-09-30 Thread Patrick Palka via Gcc-patches
is_xible_helper assumes only 0- and 1-argument ctors can be trivial, but C++20 aggregate paren init means multi-arg ctors can now be trivial too. Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/11? PR c++/102535 gcc/cp/ChangeLog: * method.c (is_xib

[PATCH 1/2] c++: order of trailing arguments in a trait expr

2021-09-30 Thread Patrick Palka via Gcc-patches
When parsing a variadic trait expression, we build up the list of trailing arguments in reverse, but we're neglecting to reverse the list to its true order afterwards. This causes us to confuse the meaning of e.g. __is_xible(x, y, z) and __is_xible(x, z, y). Note that bug isn't exposed in the sta

Re: [RFC][Patch][middle-end/PR102359]Not add initialization for READONLY variables with -ftrivial-auto-var-init

2021-09-30 Thread Qing Zhao via Gcc-patches
On Sep 30, 2021, at 1:54 AM, Richard Biener wrote: On Thu, 30 Sep 2021, Jason Merrill wrote: On 9/29/21 17:30, Qing Zhao wrote: Hi, PR102359 (ICE gimplification failed since r12-3433-ga25e0b5e6ac8a77a) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102359 Is due to -ftrivial-auto-var-init add

Re: [PATCH] c++: defaulted comparisons and vptr fields [PR95567]

2021-09-30 Thread Jason Merrill via Gcc-patches
On 9/30/21 10:03, Patrick Palka wrote: We need to skip over vptr fields when synthesizing a defaulted comparison operator. Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/11? OK. PR c++/95567 gcc/cp/ChangeLog: * method.c (build_comparison_op):

[committed] libphobos: Select the appropriate exception handler in getClassInfo

2021-09-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch makes getClassInfo to be analogous to __gdc_personality, which ignores in-flight exceptions that we haven't collided with yet. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, and committed to mainline. Regards Iain --- libphobos/ChangeLog: * libdruntim

[committed] libphobos: Print stacktrace before terminating program due to uncaught exception.

2021-09-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds adjusts the `throw' entrypoint to print the stacktrace of an uncaught exception before terminating. By default, D run-time has a top level exception handler to catch anything that was uncaught by user code. However when the `rt_trapExceptions' flag is cleared, this handler wo

[committed] libphobos: Remove unused variables in gcc.backtrace.

2021-09-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch simplifies how core runtime constructs the LibBacktrace object in the event of a segfault during unittests. The core.runtime module always overrides the default parameter value for constructor calls. MaxAlignment is not required because a class can be created on the stack with the

[committed] libphobos: Give _Unwind_Exception an alignment that best resembles __attribute__((aligned))

2021-09-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch gives the definition of _Unwind_Exception on the D side a suitable alignment. For interoperability with C++ EH, the alignment should match, otherwise D may not be able to intercept exceptions thrown from C++. Ideally the correct alignment should be exposed by the compiler, but for

[committed] libphobos: Define main function as extern(C) when compiling without D runtime (PR102476)

2021-09-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch defines the default supplied main function as read when compiling with `-fmain' as extern(C) when compiling without D runtime. The default linkage is extern(D), however this does not work when mixing `-fmain' together with `-fno-druntime'. Bootstrapped and regression tested on x86

PING #2 [PATCH] warn for more impossible null pointer tests [PR102103]

2021-09-30 Thread Martin Sebor via Gcc-patches
Jason, since you approved the C++ changes, would you mind looking over the C bits and if they look good to you giving me the green light to commit the patch? https://gcc.gnu.org/pipermail/gcc-patches/2021-September/579693.html Thanks in advance for your help! On 9/24/21 8:31 AM, Martin Sebor wr

Re: [PATCH] c++: Fix handling of __thread/thread_local extern vars declared at function scope [PR102496]

2021-09-30 Thread Jason Merrill via Gcc-patches
On 9/30/21 11:45, Jakub Jelinek wrote: On Thu, Sep 30, 2021 at 08:06:52AM -0400, Jason Merrill wrote: Hmm, what if decl has the tls_model attribute? We could decide not to push the alias for a thread-local variable when processing_template_decl, like we don't if the type is dependent; in either

Re: [PATCH] c++: Fix handling of __thread/thread_local extern vars declared at function scope [PR102496]

2021-09-30 Thread Jakub Jelinek via Gcc-patches
On Thu, Sep 30, 2021 at 08:06:52AM -0400, Jason Merrill wrote: > Hmm, what if decl has the tls_model attribute? > > We could decide not to push the alias for a thread-local variable when > processing_template_decl, like we don't if the type is dependent; in either > case we'll push it at instantia

Re: [RFC][Patch][middle-end/PR102359]Not add initialization for READONLY variables with -ftrivial-auto-var-init

2021-09-30 Thread Qing Zhao via Gcc-patches
> On Sep 30, 2021, at 1:54 AM, Richard Biener wrote: > > On Thu, 30 Sep 2021, Jason Merrill wrote: > >> On 9/29/21 17:30, Qing Zhao wrote: >>> Hi, >>> >>> PR102359 (ICE gimplification failed since r12-3433-ga25e0b5e6ac8a77a) >>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102359 >>> >>> Is

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

2021-09-30 Thread Martin Sebor via Gcc-patches
On 9/26/21 3:52 PM, Daniil Stas via Gcc-patches wrote: This option is enabled by default when -Wformat option is enabled. A user can specify -Wno-format-same-precision to disable emitting warnings about an argument passed to printf-like function having a different type from the one specified in t

[PATCH] c++: Implement C++20 -Wdeprecated-array-compare [PR97573]

2021-09-30 Thread Marek Polacek via Gcc-patches
This patch addresses one of my leftovers from GCC 11. C++20 introduced [depr.array.comp]: "Equality and relational comparisons between two operands of array type are deprecated." so this patch adds -Wdeprecated-array-compare (enabled by default in C++20). Bootstrapped/regtested on x86_64-pc-linux

Re: [PATCH gcc-11 0/2] Backport kpatch changes

2021-09-30 Thread Andreas Krebbel via Gcc-patches
On 9/30/21 10:50, Ilya Leoshkevich wrote: > Hi, > > This series contains a backport of kpatch changes needed to support > https://github.com/dynup/kpatch/pull/1203 so that it could be used in > RHEL 9. The patches have been in master for 4 months now without > issues. > > Bootstrapped and regtes

Re: [RFC][Patch][middle-end/PR102359]Not add initialization for READONLY variables with -ftrivial-auto-var-init

2021-09-30 Thread Qing Zhao via Gcc-patches
> On Sep 30, 2021, at 1:54 AM, Richard Biener wrote: > > On Thu, 30 Sep 2021, Jason Merrill wrote: > >> On 9/29/21 17:30, Qing Zhao wrote: >>> Hi, >>> >>> PR102359 (ICE gimplification failed since r12-3433-ga25e0b5e6ac8a77a) >>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102359 >>> >>> Is

[PATCH] c++: defaulted comparisons and vptr fields [PR95567]

2021-09-30 Thread Patrick Palka via Gcc-patches
We need to skip over vptr fields when synthesizing a defaulted comparison operator. Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/11? PR c++/95567 gcc/cp/ChangeLog: * method.c (build_comparison_op): Skip DECL_VIRTUAL_P fields. gcc/testsuite/Chan

Re: [PATCH] aarch64: Improve size heuristic for cpymem expansion

2021-09-30 Thread Christophe LYON via Gcc-patches
On 29/09/2021 12:20, Kyrylo Tkachov via Gcc-patches wrote: Hi all, Similar to my previous patch for setmem this one does the same for the cpymem expansion. We count the number of ops emitted and compare it against the alternative of just calling the library function when optimising for size.

Re: [Patch] openmp: Add omp_aligned_{, c}alloc and omp_{c, re}alloc for Fortran (was: [committed] openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc)

2021-09-30 Thread Tobias Burnus
Forgot to do a "git add" after modifying three testcases ... This silences the warning for a flag only valid for f951 but not for cc1. Committed the follow-up as r12-3984. Tobias - Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellsch

Re: [PATCH][PUSHED] testsuite: Skip a test-case when LTO is used [PR102509]

2021-09-30 Thread Jakub Jelinek via Gcc-patches
On Thu, Sep 30, 2021 at 02:17:08PM +0200, Martin Liška wrote: > Remove 2 unresolved tests. > > Pushed to master, > Martin > > PR testsuite/102509 > > gcc/testsuite/ChangeLog: > > * gcc.c-torture/compile/attr-complex-method.c: Skip if LTO is > used. > * gcc.c-torture/co

[PATCH][PUSHED] testsuite: Skip a test-case when LTO is used [PR102509]

2021-09-30 Thread Martin Liška
Remove 2 unresolved tests. Pushed to master, Martin PR testsuite/102509 gcc/testsuite/ChangeLog: * gcc.c-torture/compile/attr-complex-method.c: Skip if LTO is used. * gcc.c-torture/compile/attr-complex-method-2.c: Likewise. --- gcc/testsuite/gcc.c-torture/com

Re: [PATCH] c++: Fix handling of __thread/thread_local extern vars declared at function scope [PR102496]

2021-09-30 Thread Jason Merrill via Gcc-patches
On 9/29/21 04:36, Jakub Jelinek wrote: Hi! The introduction of push_local_extern_decl_alias in r11-3699-g4e62aca0e0520e4ed2532f2d8153581190621c1a broke tls vars, while the decl they are created for has the tls model set properly, nothing sets it for the alias that is actually used, so accesses t

Re: [Ada] Add support for PE-COFF PIE to System.Dwarf_Line

2021-09-30 Thread Eric Botcazou via Gcc-patches
> This makes it possible for System.Dwarf_Line to handle Position-Independent > Executables on Windows systems by translating the run-time addresses it is > provided with into addresses in the executable. > > Tested on x86_64-pc-linux-gnu, committed on trunk I have backported it, as well as the s

Re: [Ada] Add DWARF 5 support to System.Dwarf_Line

2021-09-30 Thread Eric Botcazou via Gcc-patches
> The encoding of the debugging line information has substantially changed > in DWARF 5, so this adds the support for it alongside the existing code. > > Tested on x86_64-pc-linux-gnu, committed on trunk I have backported it, as well as the subsequent adjustments, onto the 11 branch since DWARF-

Re: [PATCH 2/N] Do not hide asm_out_file in ASM_OUTPUT_ASCII.

2021-09-30 Thread Martin Liška
On 9/22/21 11:44, Richard Biener wrote: On Thu, Sep 16, 2021 at 12:01 PM Martin Liška wrote: Again a preparation patch that was tested on all cross compilers. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? I think you want to retain -FILE

Re: [Patch] openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc for Fortran (was: [committed] openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc)

2021-09-30 Thread Jakub Jelinek via Gcc-patches
On Thu, Sep 30, 2021 at 01:14:49PM +0200, Tobias Burnus wrote: > On 30.09.21 09:45, Jakub Jelinek wrote: > > > This patch adds new OpenMP 5.1 allocator entrypoints ... > > ... and this patch adds the Fortran support for it, using the C→Fortran > converted testcases. Additionally, it fixes and upd

[Patch] openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc for Fortran (was: [committed] openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc)

2021-09-30 Thread Tobias Burnus
On 30.09.21 09:45, Jakub Jelinek wrote: This patch adds new OpenMP 5.1 allocator entrypoints ... ... and this patch adds the Fortran support for it, using the C→Fortran converted testcases. Additionally, it fixes and updated the list of API routine names. We now can also tick off one item in t

[PATCH] Refine alingment peeling fix

2021-09-30 Thread Richard Biener via Gcc-patches
This refines the previous fix further by reverting to the original code since the API is a bit of a mess. It also fixes the vector type used to query the misalignment - that was what triggered the original bogus change. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-09-30 Ric

RE: [PATCH 5/7]middle-end Convert bitclear + cmp #0 into cm

2021-09-30 Thread Richard Biener via Gcc-patches
On Thu, 30 Sep 2021, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Thursday, September 30, 2021 7:18 AM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; nd > > Subject: Re: [PATCH 5/7]middle-end Convert bitclear + cmp #0 > > into cm > > > >

RE: [PATCH 5/7]middle-end Convert bitclear + cmp #0 into cm

2021-09-30 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Biener > Sent: Thursday, September 30, 2021 7:18 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd > Subject: Re: [PATCH 5/7]middle-end Convert bitclear + cmp #0 > into cm > > On Wed, 29 Sep 2021, Tamar Christina wrote: > > > Hi All, > >

PING: [PATCH v2] tree-optimization/101186 - extend FRE with "equivalence map" for condition prediction

2021-09-30 Thread Di Zhao OS via Gcc-patches
Thanks, Di -Original Message- From: Gcc-patches On Behalf Of Di Zhao OS via Gcc-patches Sent: Friday, September 17, 2021 2:13 AM To: gcc-patches@gcc.gnu.org Subject: [PATCH v2] tree-optimization/101186 - extend FRE with "equivalence map" for condition prediction Sorry about updating

RE: [PATCH 7/7]AArch64 Combine cmeq 0 + not into cmtst

2021-09-30 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Tamar Christina > Sent: Wednesday, September 29, 2021 5:22 PM > To: gcc-patches@gcc.gnu.org > Cc: nd ; Richard Earnshaw ; > Marcus Shawcroft ; Kyrylo Tkachov > ; Richard Sandiford > > Subject: [PATCH 7/7]AArch64 Combine cmeq 0 + not into cmtst > > Hi All, >

RE: [PATCH 6/7]AArch64 Add neg + cmle into cmgt

2021-09-30 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Tamar Christina > Sent: Wednesday, September 29, 2021 5:22 PM > To: gcc-patches@gcc.gnu.org > Cc: nd ; Richard Earnshaw ; > Marcus Shawcroft ; Kyrylo Tkachov > ; Richard Sandiford > > Subject: [PATCH 6/7]AArch64 Add neg + cmle into cmgt > > Hi All, > > Thi

RE: [PATCH 4/7]AArch64 Add pattern xtn+xtn2 to uzp2

2021-09-30 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Tamar Christina > Sent: Wednesday, September 29, 2021 5:20 PM > To: gcc-patches@gcc.gnu.org > Cc: nd ; Richard Earnshaw ; > Marcus Shawcroft ; Kyrylo Tkachov > ; Richard Sandiford > > Subject: [PATCH 4/7]AArch64 Add pattern xtn+xtn2 to uzp2 > > Hi All, > >

RE: [PATCH 3/7]AArch64 Add pattern for sshr to cmlt

2021-09-30 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Tamar Christina > Sent: Wednesday, September 29, 2021 5:20 PM > To: gcc-patches@gcc.gnu.org > Cc: nd ; Richard Earnshaw ; > Marcus Shawcroft ; Kyrylo Tkachov > ; Richard Sandiford > > Subject: [PATCH 3/7]AArch64 Add pattern for sshr to cmlt > > Hi All, > >

[PATCH] Fix thinko in previous alignment peeling change

2021-09-30 Thread Richard Biener via Gcc-patches
I was mistaken in that npeel is -1 for variable peeling - it is 0. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-09-30 Richard Biener * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Fix npeel check for variable amount of peeling. --- gcc/tree-

RE: [PATCH 2/7]AArch64 Add combine patterns for narrowing shift of half top bits (shuffle)

2021-09-30 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Tamar Christina > Sent: Wednesday, September 29, 2021 5:20 PM > To: gcc-patches@gcc.gnu.org > Cc: nd ; Richard Earnshaw ; > Marcus Shawcroft ; Kyrylo Tkachov > ; Richard Sandiford > > Subject: [PATCH 2/7]AArch64 Add combine patterns for narrowing shift of >

Re: [PATCH 1v2/3][vect] Add main vectorized loop unrolling

2021-09-30 Thread Andre Vieira (lists) via Gcc-patches
Hi, That just forces trying the vector modes we've tried before. Though I might need to revisit this now I think about it. I'm afraid it might be possible for this to generate an epilogue with a vf that is not lower than that of the main loop, but I'd need to think about this again. Either way

[PATCH gcc-11 2/2] IBM Z: Use @PLT symbols for local functions in 64-bit mode

2021-09-30 Thread Ilya Leoshkevich via Gcc-patches
This helps with generating code for kernel hotpatches, which contain individual functions and are loaded more than 2G away from vmlinux. This should not create performance regressions for the normal use cases, because for local functions ld replaces @PLT calls with direct calls. gcc/ChangeLog:

[PATCH gcc-11 1/2] IBM Z: Define NO_PROFILE_COUNTERS

2021-09-30 Thread Ilya Leoshkevich via Gcc-patches
s390 glibc does not need counters in the .data section, since it stores edge hits in its own data structure. Therefore counters only waste space and confuse diffing tools (e.g. kpatch), so don't generate them. gcc/ChangeLog: * config/s390/s390.c (s390_function_profiler): Ignore labelno

[PATCH gcc-11 0/2] Backport kpatch changes

2021-09-30 Thread Ilya Leoshkevich via Gcc-patches
Hi, This series contains a backport of kpatch changes needed to support https://github.com/dynup/kpatch/pull/1203 so that it could be used in RHEL 9. The patches have been in master for 4 months now without issues. Bootstrapped and regtested on s390x-redhat-linux. Ok for gcc-11? Best regards,

RE: [PATCH 1/7]AArch64 Add combine patterns for right shift and narrow

2021-09-30 Thread Kyrylo Tkachov via Gcc-patches
Hi Tamar, > -Original Message- > From: Tamar Christina > Sent: Wednesday, September 29, 2021 5:19 PM > To: gcc-patches@gcc.gnu.org > Cc: nd ; Richard Earnshaw ; > Marcus Shawcroft ; Kyrylo Tkachov > ; Richard Sandiford > > Subject: [PATCH 1/7]AArch64 Add combine patterns for right shift

[committed] openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc

2021-09-30 Thread Jakub Jelinek via Gcc-patches
Hi! This patch adds new OpenMP 5.1 allocator entrypoints and in addition to that fixes an omp_alloc bug which is hard to test for - if the first allocator fails but has a larger alignment trait and has a fallback allocator, either the default behavior or a user fallback, then the extra alignment w

Re: [PATCH] Plug possible snprintf overflow in lto-wrapper.

2021-09-30 Thread Richard Biener via Gcc-patches
On Thu, Sep 30, 2021 at 8:17 AM Aldy Hernandez via Gcc-patches wrote: > > My upcoming improvements to the DOM threader triggered a warning in > this code. It looks like the format string is ".ltrans%u.ltrans", but > we're only writing a max of ".ltrans" + whatever the MAX_INT is here. > > Tested

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-09-30 Thread Richard Biener via Gcc-patches
On Wed, Sep 29, 2021 at 5:28 PM Jeff Law wrote: > > > > On 9/29/2021 9:20 AM, Andrew MacLeod via Gcc-patches wrote: > > On 9/29/21 4:43 AM, Richard Biener wrote: > >> On Tue, Sep 28, 2021 at 10:39 PM Andrew MacLeod > >> wrote: > >>> On 9/28/21 7:50 AM, Richard Biener wrote: > On Wed, Sep 15,

Re: [PATCH] ctf: Do not warn for CTF not supported for GNU GIMPLE

2021-09-30 Thread Richard Biener via Gcc-patches
On Wed, Sep 29, 2021 at 5:55 PM Indu Bhagat wrote: > > On 9/29/21 12:14 AM, Richard Biener wrote: > > On Tue, Sep 28, 2021 at 8:52 PM Indu Bhagat via Gcc-patches > > wrote: > >> > >> CTF is supported for C only. Currently, a warning is emitted if the -gctf > >> command line option is specified f