Re: [aarch64] Code-gen for vector initialization involving constants

2023-05-01 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 25 Apr 2023 at 16:29, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > Hi Richard, > > While digging thru aarch64_expand_vector_init, I noticed it gives > > priority to loading a constant first: > > /* Initialise a vector which is part-variable. We want to first try > >

Re: [committed] Enable LRA on several ports

2023-05-01 Thread Hans-Peter Nilsson via Gcc-patches
> Date: Mon, 1 May 2023 07:21:59 -0600 > From: Jeff Law > Spurred by Segher's RFC, I went ahead and tested several ports with LRA > enabled. Not surprisingly, many failed, but a few built their full set > of libraries successful and of those a few even ran their testsuites > with no

[PATCH] c++: Move -Wdangling-reference to -Wextra [PR109642]

2023-05-01 Thread Marek Polacek via Gcc-patches
Sadly, -Wdangling-reference generates false positives for std::span-like user classes, and it seems imprudent to attempt to improve the heuristic in GCC 13. Let's move the warning to -Wextra, that will hopefully reduce the number of false positives the users have been seeing with 13. I'm leaving

Re: [committed] Convert xstormy16 to LRA

2023-05-01 Thread Roger Sayle
Jeff Law wrote: > This patch converts the xstormy16 patch to LRA. It introduces a code > quality regression in the shiftsi testcase, but it also fixes numerous > aborts/errors. IMHO it's a good tradeoff. I've investigated the shiftsi regression on xstormy16 and the underlying cause appears

[pushed] ubsan: ubsan_maybe_instrument_array_ref tweak

2023-05-01 Thread Marek Polacek via Gcc-patches
In we discussed that the copy_node in ubsan_maybe_instrument_array_ref is redundant, but also that it'd be best to postpone the optimization to GCC 14. So I'm making that change now. Tested x86_64-pc-linux-gnu, applying to trunk.

[pushed] c++: array DMI and member fn [PR109666]

2023-05-01 Thread Jason Merrill via Gcc-patches
Tested x86_64-pc-linux-gnu, applying to trunk. Patrick, can you verify that this resolves 109506 and add whatever testcase(s) seem appropriate from that PR? -- 8< -- Here it turns out I also needed to adjust cfun when stepping out of the member function to instantiate the DMI. But instead of

[PATCH 1/2] c++: potentiality of templated memfn call [PR109480]

2023-05-01 Thread Patrick Palka via Gcc-patches
Here we're incorrectly deeming the templated call a.g() inside b's initializer as potentially constant, despite g being non-constexpr, which leads to us wastefully instantiating the initializer ahead of time and triggering a bug in access checking deferral (which will get fixed in the subsequent

[PATCH 2/2] c++: non-dep init folding and access checking [PR109480]

2023-05-01 Thread Patrick Palka via Gcc-patches
enforce_access currently inspects processing_template_decl to determine whether to defer the given access check until instantiation time. But using this flag is unreliable because it gets cleared during e.g. non-dependent initializer folding, and can lead to premature access check failures as in

[r14-332 Regression] FAIL: gcc.target/i386/pr89618-2.c scan-tree-dump vect "loop vectorized using 16 byte vectors" on Linux/x86_64

2023-05-01 Thread haochen.jiang via Gcc-patches
On Linux/x86_64, 24905a4bd1375ccd99c02510b9f9529015a48315 is the first bad commit commit 24905a4bd1375ccd99c02510b9f9529015a48315 Author: Richard Biener Date: Wed Jan 18 11:04:49 2023 +0100 Adjust costing of emulated vectorized gather/scatter caused FAIL: gcc.target/i386/pr88531-2a.c

Re: [PATCH] c++: RESULT_DECL replacement in constexpr call result [PR105440]

2023-05-01 Thread Jason Merrill via Gcc-patches
On 4/28/23 15:40, Patrick Palka wrote: On Fri, 28 Apr 2023, Patrick Palka wrote: On Fri, 28 Apr 2023, Patrick Palka wrote: After mechanically replacing RESULT_DECL within a constexpr call result (for sake of RVO), we can in some cases simplify the call result further. In the below testcase

Re: [PATCH] PHIOPT: Update comment about what the pass now does

2023-05-01 Thread Jeff Law via Gcc-patches
On 5/1/23 10:37, Andrew Pinski via Gcc-patches wrote: I noticed I didn't update the comment about how the pass works after I initially added match_simplify_replacement. Anyways this updates the comment to be the current state of the pass. OK? gcc/ChangeLog: * tree-ssa-phiopt.cc:

[PATCH] PHIOPT: Update comment about what the pass now does

2023-05-01 Thread Andrew Pinski via Gcc-patches
I noticed I didn't update the comment about how the pass works after I initially added match_simplify_replacement. Anyways this updates the comment to be the current state of the pass. OK? gcc/ChangeLog: * tree-ssa-phiopt.cc: Update comment about how the transformation are

[PATCH] Fortran: overloading of intrinsic binary operators [PR109641]

2023-05-01 Thread Harald Anlauf via Gcc-patches
Dear all, the attached patch is mostly self-explaining: we mishandled the overloading of intrinsic binary operators in the case the actual operands were of intrinsic numeric type and the ranks of the operands were not conformable, i.e. both were of non-zero and different ranks. In that case the

Re: [PATCH v4 4/4] ree: Improve ree pass for rs6000 target using defined ABI interfaces.

2023-05-01 Thread Segher Boessenkool
Hi! On Sat, Apr 22, 2023 at 02:36:20PM +0530, Ajit Agarwal wrote: > * ree.cc (combline_reaching_defs): Add zero_extend > using defined abi interfaces. Typo. Also, please don't wrap lines early. Also, you are missing some changes in this file in the changelog. >

[PATCH] RISC-V: Name newly added flags in changelog

2023-05-01 Thread Patrick O'Neill
This patch fixes the changelog to explicitly name the added command line flags introduced in this patch: https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616807.html 2023-05-01 Patrick O'Neill gcc/ChangeLog: * ChangeLog: Name the flags added by the patch in the changelog.

Re: [PATCH V5] Use reg mode to move sub blocks for parameters and returns

2023-05-01 Thread Segher Boessenkool
Hi! On Fri, Mar 17, 2023 at 11:39:52AM +0800, Jiufu Guo wrote: > gcc/testsuite/ChangeLog: > > * gcc.target/powerpc/pr65421-1.c: New test. > * gcc.target/powerpc/pr65421.c: New test. Please name the tests something else? -1.c and -2.c maybe. Or something more inspired. Just not

[committed] Convert xstormy16 to LRA

2023-05-01 Thread Jeff Law via Gcc-patches
This patch converts the xstormy16 patch to LRA. It introduces a code quality regression in the shiftsi testcase, but it also fixes numerous aborts/errors. IMHO it's a good tradeoff. Committed to the trunk, Jeff commit 977a3be3ccbc7f177316b2b349523023cac37bcd Author: Jeff Law Date: Mon May

[committed] Enable LRA on several ports

2023-05-01 Thread Jeff Law
Spurred by Segher's RFC, I went ahead and tested several ports with LRA enabled. Not surprisingly, many failed, but a few built their full set of libraries successful and of those a few even ran their testsuites with no regressions. In fact, enabling LRA fixes a small number of failures on

[committed] libgcc pru: Define TARGET_HAS_NO_HW_DIVIDE

2023-05-01 Thread Dimitar Dimitrov
This patch aligns the configuration to the actual PRU capabilities. It also reduces the size of the affected libgcc functions. For a real-world project using integer arithmetics the savings are significant: Before: textdata bss dec hex filename 3688 865 544

[COMMITTED] Remove unused friends in int_range<>.

2023-05-01 Thread Aldy Hernandez via Gcc-patches
gcc/ChangeLog: * value-range.h (class int_range): Remove gt_ggc_mx and gt_pch_nx friends. --- gcc/value-range.h | 5 - 1 file changed, 5 deletions(-) diff --git a/gcc/value-range.h b/gcc/value-range.h index 5cff50e6d03..ab8d7d3c5dc 100644 --- a/gcc/value-range.h +++

[COMMITTED] Conversion to irange wide_int API.

2023-05-01 Thread Aldy Hernandez via Gcc-patches
This converts the irange API to use wide_ints exclusively, along with its users. This patch will slow down VRP, as there will be more useless wide_int to tree conversions. However, this slowdown is only temporary, as a follow-up patch will convert the internal representation of iranges to

[COMMITTED] Inline irange::set_nonzero.

2023-05-01 Thread Aldy Hernandez via Gcc-patches
irange::set_nonzero is used everywhere and benefits immensely from inlining. gcc/ChangeLog: * value-range.h (irange::set_nonzero): Inline. --- gcc/value-range.h | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/gcc/value-range.h

[COMMITTED] Rewrite bounds_of_var_in_loop() to use ranges.

2023-05-01 Thread Aldy Hernandez via Gcc-patches
Little by little, bounds_of_var_in_loop() has grown into an unmaintainable mess. This patch rewrites the code to use the relevant APIs as well as refactor it to make it more readable. gcc/ChangeLog: * gimple-range-fold.cc (tree_lower_bound): Delete. (tree_upper_bound): Delete.

[COMMITTED] Convert get_legacy_range in bounds_of_var_in_loop to irange API.

2023-05-01 Thread Aldy Hernandez via Gcc-patches
gcc/ChangeLog: * vr-values.cc (bounds_of_var_in_loop): Convert to irange API. --- gcc/vr-values.cc | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/vr-values.cc b/gcc/vr-values.cc index 7f623102ac6..3d28198f9f5 100644 --- a/gcc/vr-values.cc +++

[COMMITTED] Convert internal representation of irange to wide_ints.

2023-05-01 Thread Aldy Hernandez via Gcc-patches
gcc/ChangeLog: * range-op.cc (update_known_bitmask): Adjust for irange containing wide_ints internally. * tree-ssanames.cc (set_nonzero_bits): Same. * tree-ssanames.h (set_nonzero_bits): Same. * value-range-storage.cc (irange_storage::set_irange): Same.

[COMMITTED] Merge irange::union/intersect into irange_union/intersect.

2023-05-01 Thread Aldy Hernandez via Gcc-patches
gcc/ChangeLog: * value-range.cc (irange::irange_union): Rename to... (irange::union_): ...this. (irange::irange_intersect): Rename to... (irange::intersect): ...this. * value-range.h (irange::union_): Delete. (irange::intersect): Delete. ---

[COMMITTED] Replace vrp_val* with wide_ints.

2023-05-01 Thread Aldy Hernandez via Gcc-patches
This patch removes all uses of vrp_val_{min,max} in favor for a irange_val_* which are wide_int based. This will leave only one use of vrp_val_* which returns trees in range_of_ssa_name_with_loop_info() because it needs to work with non-integers (floats, etc). In a follow-up patch, this function

[COMMITTED] Cleanup irange::set.

2023-05-01 Thread Aldy Hernandez via Gcc-patches
Now that anti-ranges are no more and iranges contain wide_ints instead of trees, various cleanups are possible. This is one of a handful of patches improving the performance of irange::set() which is not on a hot path, but quite sensitive because it is so pervasive. gcc/ChangeLog: *

[COMMITTED] vrange_storage overhaul

2023-05-01 Thread Aldy Hernandez via Gcc-patches
[tl;dr: This is a rewrite of value-range-storage.* such that global ranges and the internal ranger cache can use the same efficient storage mechanism. It is optimized such that when wide_ints are dropped into irange, the copying back and forth from storage will be very fast, while being able to

[COMMITTED] Various cleanups in vr-values.cc towards ranger API.

2023-05-01 Thread Aldy Hernandez via Gcc-patches
gcc/ChangeLog: * vr-values.cc (check_for_binary_op_overflow): Tidy up by using ranger API. (compare_ranges): Delete. (compare_range_with_value): Delete. (bounds_of_var_in_loop): Tidy up by using ranger API.

[COMMITTED] Remove irange::{min,max,kind}.

2023-05-01 Thread Aldy Hernandez via Gcc-patches
gcc/ChangeLog: * tree-ssa-loop-niter.cc (refine_value_range_using_guard): Remove kind() call. (determine_value_range): Same. (record_nonwrapping_iv): Same. (infer_loop_bounds_from_signedness): Same. (scev_var_range_cant_overflow): Same. *

[COMMITTED] Remove irange::tree_{lower,upper}_bound.

2023-05-01 Thread Aldy Hernandez via Gcc-patches
gcc/ChangeLog: * value-range.cc (irange::irange_set_anti_range): Remove uses of tree_lower_bound and tree_upper_bound. (irange::verify_range): Same. (irange::operator==): Same. (irange::singleton_p): Same. * value-range.h (irange::tree_lower_bound):