Re: [PATCH] Docs: Document that taint analyzer checker stops other checkers

2022-03-23 Thread Avinash Sonawane via Gcc-patches
On Wed, 23 Mar 2022 18:33:38 -0400 David Malcolm wrote: > This is almost ready to push to trunk, but there are a couple of extra > tasks needed to be done: Done. Please find the attached v3 patch and let me know if something needs to be changed/added. Thanks! Regards, Avinash Sonawane (root

hardened conditionals: drop copied identifiers

2022-03-23 Thread Alexandre Oliva via Gcc-patches
The copies of identifiers, indended to associate hardening SSA temporaries to the original variables they refer to, end up causing -fcompare-debug to fail, because DECL_UIDs are not identical, and the nouid flag used in compare-debug dumps doesn't affect the uids in naked identifiers, so the dive

[PATCH] tree-optimization/104970: Limit size computation for access attribute

2022-03-23 Thread Siddhesh Poyarekar
Limit object size computation only to the simple case where access attribute has been explicitly specified. The object passed to __builtin_dynamic_object_size could either be a pointer or a VLA whose size has been described only using access attribute. Further, return a valid size only if the obj

[PATCH] rs6000: Support UN[GL][ET] in rs6000_maybe_emit_maxc_minc [PR105002]

2022-03-23 Thread Kewen.Lin via Gcc-patches
Hi, Commit r12-7687 exposed one miss optimization chance in function rs6000_maybe_emit_maxc_minc, for now it only considers comparison codes GE/GT/LE/LT, but it can support more variants with codes UNLT/UNLE/UNGT/UNGE by reversing them into the equivalent ones with GE/GT/LE/LT. Bootstrapped and r

Re: [PATCH] rs6000: Skip overload instances with NULL fntype [PR104967]

2022-03-23 Thread Kewen.Lin via Gcc-patches
on 2022/3/23 8:29 PM, David Edelsohn wrote: > On Wed, Mar 23, 2022 at 5:33 AM Kewen.Lin wrote: >> >> Hi, >> >> As shown in PR104967, for some overload built-in function instance, >> if it requires a date type which isn't defined on the target, its >> fntype would be initialized as NULL. This patc

hardcmp: split before dispatch edge

2022-03-23 Thread Alexandre Oliva via Gcc-patches
If we harden a compare at the end of a block with an edge to the abnormal dispatch block, it won't have a single successor. Arrange to split the block at its final stmt so as to have a single succ. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog PR middle-end/1049

[PATCH] c++: call complete_type after performing auto deduction [PR80351]

2022-03-23 Thread Pokechu22 via Gcc-patches
When cp_finish_decl calls cp_apply_type_quals_to_decl on a const auto or constexpr auto variable, the type might not be complete the first time (this happened when auto deduces to an initializer_list). cp_apply_type_quals_to_decl removes the const qualifier if the type is not complete, which is app

Re: [PATCH] c++: FIX_TRUNC_EXPR in tsubst [PR102990]

2022-03-23 Thread Marek Polacek via Gcc-patches
On Wed, Mar 23, 2022 at 04:35:32PM -0400, Jason Merrill wrote: > On 3/22/22 19:55, Marek Polacek wrote: > > This is a crash where a FIX_TRUNC_EXPR gets into tsubst_copy_and_build > > where it hits gcc_unreachable (). > > > > The history of tsubst_copy_and_build/FIX_TRUNC_EXPR is such that it > > w

Re: [PATCH] Docs: Document that taint analyzer checker stops other checkers

2022-03-23 Thread David Malcolm via Gcc-patches
On Wed, 2022-03-23 at 11:47 +0530, Avinash Sonawane wrote: > Apologies! Forgot to attach the patch v2. > > Done now. Thanks for the patch! (forgetting to attach it is something of a rite of passage) The content of the v2 patch looks good to me; I tried regenerating the manpage and I think it's a

[committed] analyzer: fix accessing wrong stack frame on interprocedural return [PR104979]

2022-03-23 Thread David Malcolm via Gcc-patches
PR analyzer/104979 reports a leak false positive when handling an interprocedural return to a caller: LHS = CALL(ARGS); where the LHS is a certain non-trivial compound expression. The root cause is that parts of the LHS were being erroneously evaluated with respect to the stack frame of the ca

Re: [PATCH] c++: extern thread_local declarations in constexpr [PR104994]

2022-03-23 Thread Jason Merrill via Gcc-patches
On 3/22/22 03:35, Jakub Jelinek wrote: Hi! C++14 to C++20 apparently should allow extern thread_local declarations in constexpr functions, however useless they are there (because accessing such vars is not valid in a constant expression, perhaps sizeof/decltype). P2242 changed that for C++23 to

Re: [PATCH] c++: FIX_TRUNC_EXPR in tsubst [PR102990]

2022-03-23 Thread Jason Merrill via Gcc-patches
On 3/22/22 19:55, Marek Polacek wrote: This is a crash where a FIX_TRUNC_EXPR gets into tsubst_copy_and_build where it hits gcc_unreachable (). The history of tsubst_copy_and_build/FIX_TRUNC_EXPR is such that it was introduced in r181478, but it did the wrong thing, whereupon it was turned into

Re: [PATCH] c++: alias template arguments are evaluated [PR101906]

2022-03-23 Thread Jason Merrill via Gcc-patches
On 3/22/22 14:31, Patrick Palka wrote: On Tue, 22 Mar 2022, Patrick Palka wrote: Here we're neglecting to clear cp_unevaluated_operand when substituting into the arguments of the alias template-id skip<(T(), 0), T> with T=A, which means cp_unevaluated_operand remains set during mark_used for A:

Re: [pushed] c++: designated init and aggregate members [PR102337]

2022-03-23 Thread Jason Merrill via Gcc-patches
On 3/22/22 10:19, Patrick Palka wrote: On Mon, 21 Mar 2022, Jason Merrill via Gcc-patches wrote: Our C++20 designated initializer handling was broken with members of class type; we would find the relevant member and then try to find a member of the member with the same name. Or we would someti

Re: [PATCH] rtl-optimization/105028 - fix compile-time hog in form_threads_from_copies

2022-03-23 Thread Vladimir Makarov via Gcc-patches
On 2022-03-23 07:49, Richard Biener wrote: form_threads_from_copies processes a sorted array of copies, skipping those with the same thread and conflicting threads and merging the first non-conflicting ones. After that it terminates the loop and gathers the remaining elements of the array, ski

Re: [pushed] c++: using from enclosing class template [PR105006]

2022-03-23 Thread Jason Merrill via Gcc-patches
On 3/23/22 10:29, Patrick Palka wrote: I wonder if it'd be worthwhile to also test dependent_type_p (scope) here here to avoid iterating over the lookup set when it can't possibly contain a dependent using-decl. Good thought: From b1005f60c17d693e9fbc38a9481b3cd896d26785 Mon Sep 17 00:00:00 20

Re: [PATCH v2] Document that the 'access' and 'nonnull' attributes are independent

2022-03-23 Thread Sebastian Huber
On 23/03/2022 17:31, Martin Sebor via Gcc-patches wrote: The concern is that the constraints implied by atttributes access and nonnull are independent of each other.  I would suggest to document that without talking about dereferencing because that's not implied by either of them.  E.g., somethi

Re: [PATCH] ipa: Create LOAD references when necessary during inlining (PR 103171)

2022-03-23 Thread Martin Jambor
Hello, I would like to ping this patch, please. Thanks, Martin On Fri, Jan 28 2022, Martin Jambor wrote: > Hi, > > in r12-2523-g13586172d0b70c ipa-prop tracking of jump functions during > inlining got the ability to remove ADDR references when inlining > discovered that they were not necessary

Re: [PATCH v2] Document that the 'access' and 'nonnull' attributes are independent

2022-03-23 Thread Martin Sebor via Gcc-patches
On 3/23/22 07:01, David Malcolm wrote: On Mon, 2022-03-14 at 16:18 -0600, Martin Sebor wrote: On 3/9/22 14:57, David Malcolm via Gcc wrote: On Wed, 2022-03-09 at 13:30 -0800, Andrew Pinski wrote: On Wed, Mar 9, 2022 at 1:25 PM David Malcolm via Gcc wrote: We gained __attribute__ ((access, .

Re: [PATCH PING] ipa: Careful processing ANCESTOR jump functions and NULL pointers (PR 103083)

2022-03-23 Thread Martin Jambor
Hello, I would like to ping this patch, please. Thanks, Martin On Mon, Feb 14 2022, Martin Jambor wrote: > Hello Honza, > > On Mon, Dec 13 2021, Jan Hubicka wrote: >>> >>> + || (only_for_nonzero && >>> >>> !src_lats->bits_lattice.known_nonzero_p ())) >>> >>> + { >>> >>> +

Re: [PATCH PING] ipa-cp: Do not create clones for values outside known value range (PR 102513)

2022-03-23 Thread Martin Jambor
Hello, I would like to ping this patch, please. Thanks, Martin On Mon, Feb 14 2022, Martin Jambor wrote: > Hi, > > PR 102513 shows we emit bogus array access warnings when IPA-CP > creates clones specialized for values which it deduces from arithmetic > jump functions describing self-recursive

[PATCH] target/102125 - alternative memcpy folding improvement

2022-03-23 Thread Richard Biener via Gcc-patches
The following extends the heuristical memcpy folding path with the ability to use misaligned accesses on strict-alignment targets just like the size-based path does. That avoids regressing the following testcase on arm uint64_t bar64(const uint8_t *rData1) { uint64_t buffer;

Re: [PATCH] gcov-tool: Allow merging of empty profile lists

2022-03-23 Thread Sebastian Huber
Hello Martin, On 23/03/2022 13:19, Martin Liška wrote: On 3/23/22 10:34, Sebastian Huber wrote: Hello. Thanks for the patch. Note we're in stage4, so the patch can eventually go in in the next stage1. ok, good. The gcov_profile_merge() already had code to deal with profile information wh

Re: [PATCH] rs6000: Skip overload instances with NULL fntype [PR104967]

2022-03-23 Thread Paul A. Clarke via Gcc-patches
On Wed, Mar 23, 2022 at 05:33:21PM +0800, Kewen.Lin via Gcc-patches wrote: > As shown in PR104967, for some overload built-in function instance, > if it requires a date type which isn't defined on the target, its nit: s/date/data/ > fntype would be initialized as NULL. This patch is to consider

Re: [pushed] c++: using from enclosing class template [PR105006]

2022-03-23 Thread Patrick Palka via Gcc-patches
On Wed, 23 Mar 2022, Jason Merrill via Gcc-patches wrote: > Here, DECL_DEPENDENT_P was false for the second using because Row is > "the current instantiation", so lookup succeeds. But since Row itself has a > dependent using-decl for operator(), the set of functions imported by the > second using

Re: [PATCH v2] Add TARGET_MOVE_WITH_MODE_P

2022-03-23 Thread Richard Biener via Gcc-patches
On Tue, Mar 22, 2022 at 9:20 AM Richard Biener wrote: > > On Tue, Mar 22, 2022 at 3:51 AM H.J. Lu wrote: > > > > On Mon, Mar 14, 2022 at 8:44 AM Richard Sandiford > > wrote: > > > > > > Richard Biener writes: > > > > On Wed, Mar 9, 2022 at 7:04 PM Richard Sandiford > > > > wrote: > > > >> > >

[PATCH] Fortran: Fix directory stat check for '.' [PR103560]

2022-03-23 Thread Tobias Burnus
As reported in the PR103560. The patch is a slightly modified version of the patch proposed by the bug reporter (with pseudonym?) Carlos Une. The problem seems to be that 'stat ("./", ...)' fails with MinGW while 'stat (".", ...)' works. Besides, I think it makes sense to defer the usage of '/' u

[PATCH v2] Document that the 'access' and 'nonnull' attributes are independent

2022-03-23 Thread David Malcolm via Gcc-patches
On Mon, 2022-03-14 at 16:18 -0600, Martin Sebor wrote: > On 3/9/22 14:57, David Malcolm via Gcc wrote: > > On Wed, 2022-03-09 at 13:30 -0800, Andrew Pinski wrote: > > > On Wed, Mar 9, 2022 at 1:25 PM David Malcolm via Gcc > > > wrote: > > > > > > > > We gained __attribute__ ((access, ...)) in GCC

[pushed] c++: using from enclosing class template [PR105006]

2022-03-23 Thread Jason Merrill via Gcc-patches
Here, DECL_DEPENDENT_P was false for the second using because Row is "the current instantiation", so lookup succeeds. But since Row itself has a dependent using-decl for operator(), the set of functions imported by the second using is dependent, so we should set the flag. Tested x86_64-pc-linux-g

[committed] analyzer: use tainted_allocation_size::m_mem_space [PR105017]

2022-03-23 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r12-7783-ge6a3991ea15c0b. gcc/analyzer/ChangeLog: PR analyzer/105017 * sm-taint.cc (taint_diagnostic::subclass_equal_p): Check m_has_bounds as well as m_arg. (tainted_allocation_size::

[committed] analyzer: fix ICE adding note to disabled diagnostic [PR104997]

2022-03-23 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r12-7782-g160b095fc9ded4. gcc/analyzer/ChangeLog: PR analyzer/104997 * diagnostic-manager.cc (diagnostic_manager::add_diagnostic): Convert return type from "void" to "bool", reporting success

Re: [PATCH] rs6000: Skip overload instances with NULL fntype [PR104967]

2022-03-23 Thread David Edelsohn via Gcc-patches
On Wed, Mar 23, 2022 at 5:33 AM Kewen.Lin wrote: > > Hi, > > As shown in PR104967, for some overload built-in function instance, > if it requires a date type which isn't defined on the target, its > fntype would be initialized as NULL. This patch is to consider > this possibility in function find

[committed] libstdc++: Add missing constraints to std::bit_cast [PR105027]

2022-03-23 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. Backport to gcc-11 to follow. -- >8 -- Our std::bit_cast was relying on the compiler to check for errors inside __builtin_bit_cast, instead of checking them as constraints. That means std::bit_cast was not SFINAE-friendly. This fix uses a requires-clau

Re: [PATCH] gcov-tool: Allow merging of empty profile lists

2022-03-23 Thread Martin Liška
On 3/23/22 10:34, Sebastian Huber wrote: Hello. Thanks for the patch. Note we're in stage4, so the patch can eventually go in in the next stage1. The gcov_profile_merge() already had code to deal with profile information which had no counterpart to merge with. For profile information from fil

[PATCH] rtl-optimization/105028 - fix compile-time hog in form_threads_from_copies

2022-03-23 Thread Richard Biener via Gcc-patches
form_threads_from_copies processes a sorted array of copies, skipping those with the same thread and conflicting threads and merging the first non-conflicting ones. After that it terminates the loop and gathers the remaining elements of the array, skipping same thread copies, re-starting the proce

Re: [PATCH] rs6000: Adjust error messages.

2022-03-23 Thread Segher Boessenkool
On Wed, Mar 23, 2022 at 11:31:12AM +0100, Martin Liska wrote: > --- a/gcc/config/rs6000/rs6000.cc > +++ b/gcc/config/rs6000/rs6000.cc > @@ -4345,8 +4345,8 @@ rs6000_option_override_internal (bool global_init_p) > rs6000_veclib_handler = rs6000_builtin_vectorized_libmass; > else >

[PATCH] rs6000: Adjust error messages.

2022-03-23 Thread Martin Liska
gcc/ChangeLog: * config/rs6000/rs6000-c.cc (altivec_resolve_overloaded_builtin): Use %qs in format. * config/rs6000/rs6000.cc (rs6000_option_override_internal): Reword the error message. --- gcc/config/rs6000/rs6000-c.cc | 5 +++-- gcc/config/rs6000/rs6000.cc | 4

[committed] libstdc++: Fix feature test macros in for freestanding

2022-03-23 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. Backport to gcc-11 needed too. -- >8 -- Some C++17 and C++20 feature test macros are only defined in for hosted builds, even though the features are supported for freestanding. All C++23 feature test macros are defined in for freestanding, but most o

[committed] libstdc++: Disable atomic wait for freestanding [PR105021]

2022-03-23 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. Backport to gcc-11 needed too. -- >8 -- We use either condition variables or futexes to implement atomic waits, so we can't do it in freestanding. This is non-conforming, so should be revisited later, probably by making freestanding atomic waiting opera

[PATCH] gcov-tool: Allow merging of empty profile lists

2022-03-23 Thread Sebastian Huber
The gcov_profile_merge() already had code to deal with profile information which had no counterpart to merge with. For profile information from files with no associated counterpart, the profile information is simply used as is with the weighting transformation applied. Make sure that gcov_profile

[PATCH] rs6000: Skip overload instances with NULL fntype [PR104967]

2022-03-23 Thread Kewen.Lin via Gcc-patches
Hi, As shown in PR104967, for some overload built-in function instance, if it requires a date type which isn't defined on the target, its fntype would be initialized as NULL. This patch is to consider this possibility in function find_instance to avoid ICE. Bootstrapped and regtested on powerpc6

Re: [PATCH] testsuite: Fix up sse2-v1ti-shift-3.c test [PR102986]

2022-03-23 Thread Richard Biener via Gcc-patches
On Wed, 23 Mar 2022, Jakub Jelinek wrote: > Hi! > > This test is dg-do run and invokes UB when these rotate functions > are called with 0 as second argument. There are some other tests > that do this but they are dg-do compile only and not even call those > functions at all, so it IMHO doesn't m

[PATCH] testsuite: Fix up sse2-v1ti-shift-3.c test [PR102986]

2022-03-23 Thread Jakub Jelinek via Gcc-patches
Hi! This test is dg-do run and invokes UB when these rotate functions are called with 0 as second argument. There are some other tests that do this but they are dg-do compile only and not even call those functions at all, so it IMHO doesn't matter that they are only well defined for [1,127] and n

Re: [Patch] LTO: Fixes for renaming issues with offload/OpenMP [PR104285]

2022-03-23 Thread Richard Biener via Gcc-patches
On Tue, 22 Mar 2022, Tobias Burnus wrote: > Hi Jakub, hi Richi, > > On 22.03.22 15:27, Jakub Jelinek wrote: > > On Tue, Mar 22, 2022 at 01:56:27PM +0100, Tobias Burnus wrote: > >> name = lto_get_decl_name_mapping (file_data, name); > >> [...] > >> + name = lto_get_decl_name_mapping (file_dat

Re: [PATCH] Fix ICE caused by NULL_RTX returned by lowpart_subreg.

2022-03-23 Thread Uros Bizjak via Gcc-patches
On Wed, Mar 23, 2022 at 7:04 AM liuhongt wrote: > > In validate_subreg, both (subreg:V2HF (reg:SI) 0) > and (subreg:V8HF (reg:V2HF) 0) are valid, but not > for (subreg:V8HF (reg:SI) 0) which causes ICE. > > Ideally it should be handled in validate_subreg to support > subreg for all modes available