[PR100518] store by mult pieces: keep addr in Pmode

2021-12-09 Thread Alexandre Oliva via Gcc-patches
The conversion of a MEM address to ptr_mode in try_store_by_multiple_pieces was misguided: copy_addr_to_reg expects Pmode for addresses. Regstrapped on x86_64-linux-gnu, testcase verified with a cross to aarch64. Ok to install? for gcc/ChangeLog PR target/100518 * builtins.c

Re: [PR100843] store by mult pieces: punt on max_len < min_len

2021-12-10 Thread Alexandre Oliva via Gcc-patches
On Dec 10, 2021, Jeff Law wrote: > The patch is clearly safe.  My question is should we have caught this > earlier in the call chain? Callers will call try_store_by_multiple_pieces if set_storage_via_setmem fails. setmem doesn't necessarily need min and max len to do its job, so if we were to m

Re: [PATCH] libstdc++: async: tolerate slightly shorter sleep

2022-10-12 Thread Alexandre Oliva via Gcc-patches
On Oct 12, 2022, Jonathan Wakely wrote: > On Wed, 12 Oct 2022 at 12:41, Jonathan Wakely wrote: >> >> On Thu, 23 Jun 2022 at 12:38, Alexandre Oliva via Libstdc++ >> wrote: >> > >> > On Jun 22, 2022, Alexandre Oliva wrote: >> > >> > > Regstrapped on x86_64-linux-gnu, also tested with a cross to

Re: [PATCH v2 00/10] Introduce strub: machine-independent stack scrubbing

2022-10-13 Thread Alexandre Oliva via Gcc-patches
On Oct 13, 2022, Richard Biener wrote: > On Tue, Oct 11, 2022 at 3:33 PM Alexandre Oliva wrote: >> >> On Oct 11, 2022, Richard Biener wrote: >> >> > On Tue, Oct 11, 2022 at 1:57 PM Alexandre Oliva wrote: >> >> >> >> On Oct 10, 2022, Richard Biener wrote: >> >> >> >> > As noted in the Cauldr

[PATCH zero-call-used-regs] Add leafy mode for zero-call-used-regs

2022-10-21 Thread Alexandre Oliva via Gcc-patches
Introduce 'leafy' to auto-select between 'used' and 'all' for leaf and nonleaf functions, respectively. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * doc/extend.texi (zero-call-used-regs): Document leafy and variants thereof. * flag-types.h (zero_

Re: [PATCH zero-call-used-regs] Add leafy mode for zero-call-used-regs

2022-10-24 Thread Alexandre Oliva via Gcc-patches
Hello, Qing, It was a pleasure to meet you at the Cauldron. On Oct 21, 2022, Qing Zhao wrote: > Hi, Alexandre, > Could you please explain a little bit on the motivation of this patch first? It was a suggestion I got after the Cauldron presentation. It made sense to me, and was easy enough to

Re: [PATCH zero-call-used-regs] Add leafy mode for zero-call-used-regs

2022-10-26 Thread Alexandre Oliva via Gcc-patches
On Oct 25, 2022, Qing Zhao wrote: >> 'all' for leaf functions is likely wasteful. If no other functions are >> called, one can determine exactly which registers might carry >> information out and thus need zeroing, and 'used' is thus likely enough, >> depending on the purpose of register scrubbi

Re: [PATCH] libstdc++: Optimize operator+(string/char*, string/char*) equally

2022-08-24 Thread Alexandre Oliva via Gcc-patches
On Aug 24, 2022, Jonathan Wakely via Gcc-patches wrote: >* include/bits/basic_string.h (operator+(const string&, > const char*)): >Remove naive implementation. >* include/bits/basic_string.tcc (operator+(const string&, > const char*)): >Add single-

Re: [PATCH v2] Support --disable-fixincludes.

2022-08-31 Thread Alexandre Oliva via Gcc-patches
On Aug 31, 2022, Xi Ruoyao wrote: > On Sat, 2022-07-09 at 10:11 -0600, Jeff Law via Gcc-patches wrote: >> Once Alex is OK with this patch, then it'll be good to go. >> >> jeff > Gentle ping as a distro maintainer :). Oops, thanks, sorry, I seem to have missed it the first time around. The pat

[PATCH] ppc: testsuite: float128-hw{,4}.c need -mlong-double-128 (was: [PATCH] ppc: testsuite: pr79004 needs -mlong-double-128)

2022-04-23 Thread Alexandre Oliva via Gcc-patches
On Apr 14, 2022, Alexandre Oliva wrote: > * gcc.target/powerpr/pr79004.c: Add -mlong-double-128. Just like pr79004, float128-hw.c requires -mlong-double-128 for some the expected asm opcodes to be output on target variants that have 64-bit long doubles. That's because their expanders, e.g

Re: [PATCH] ppc: testsuite: float128-hw{,4}.c need -mlong-double-128

2022-04-26 Thread Alexandre Oliva via Gcc-patches
On Apr 26, 2022, Segher Boessenkool wrote: > The testcase uses _Float128, what code that > generates should not depend on your long double setting. Good, that means my hunch that it shouldn't is on the right track. > Please file a PR instead? I filed https://gcc.gnu.org/bugzilla/show_bug.cgi?i

[PATCH] testsuite: vect: update unaligned message

2022-04-27 Thread Alexandre Oliva via Gcc-patches
gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c covers ppc variants that accept and reject misaligned accesses. The message that it expects for rejection was removed in the gcc-11 development cycle by commit r11-1969. The patch adjusted multiple tests to use the message introduced in r11-1945, b

[PATCH] libstdc++: ppc: conditionalize vsx-only simd intrinsics

2022-04-27 Thread Alexandre Oliva via Gcc-patches
libstdc++'s bits/simd.h section for PPC (Altivec) defines various intrinsic vector types that are only available along with VSX: 64-bit long double, double, (un)signed long long, and 64-bit (un)signed long. experimental/simd/standard_abi_usable{,_2}.cc tests error out reporting the unmet require

Re: [PATCH] libstdc++: ppc: conditionalize vsx-only simd intrinsics

2022-04-28 Thread Alexandre Oliva via Gcc-patches
On Apr 28, 2022, Segher Boessenkool wrote: > On Thu, Apr 28, 2022 at 03:09:54AM -0300, Alexandre Oliva wrote: >> +# ifdef __VSX__ > No space after # (here and everywhere else). 'k, thanks >> + "no __intrinsic_type support for [long] double on PPC w/o >> VSX"); > This change isn

[PATCH v2] libstdc++: ppc: conditionalize vsx-only simd intrinsics

2022-05-02 Thread Alexandre Oliva via Gcc-patches
On May 2, 2022, Segher Boessenkool wrote: > Send full patches always please. I'll try to remember that. In case I fail, I hope you won't mind too much reminding me. (You'd also asked me not to send patches as followups, but... revised versions of a patch still belong in the same thread, righ

Re: [PATCH] testsuite: vect: update unaligned message

2022-05-02 Thread Alexandre Oliva via Gcc-patches
On Apr 28, 2022, Richard Biener wrote: > On Thu, 28 Apr 2022, Alexandre Oliva wrote: >> >> gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c covers ppc variants >> that accept and reject misaligned accesses. The message that it >> expects for rejection was removed in the gcc-11 development cycle b

[PATCH] [PR105324] libstdc++: testsuite: pr105324 requires FP from_char

2022-05-02 Thread Alexandre Oliva via Gcc-patches
The floating-point overloads of from_char are only declared if _GLIBCXX_HAVE_USELOCALE is #defined as nonzero. That's exposed from charconv as _cpp_lib_to_chars >= 201611L, so guard the test body with that. Regstrapped on ppc64le-linux-gnu, and tested on x86_64-linux-gnu-x-ppc{,64}-vx7r2 (witho

[PATCH] ppc: testsuite: vec-mul requires vsx runtime

2022-05-02 Thread Alexandre Oliva via Gcc-patches
vec-mul is an execution test, but it only requires a powerpc_vsx_ok effective target, which is enough only for compile tests. In order to To check for runtime and execution environment support, we need to require vsx_hw. Make that a condition for execution, but still perform a compile test if t

Re: [PATCH v2] [PR105324] libstdc++: testsuite: pr105324 requires FP from_char

2022-05-03 Thread Alexandre Oliva via Gcc-patches
On May 3, 2022, Jonathan Wakely wrote: > That macro should start with two underscores. Doh! Wow, eagle eyes! :-) Good catch, thanks! Here's the corrected patch I'm installing, trunk for now, 12 and 11 once it's allowed in 12. > OK for trunk and gcc-11 with that change. > gcc-12 branch nee

[PATCH] [PR100106] Reject unaligned subregs when strict alignment is required

2022-05-04 Thread Alexandre Oliva via Gcc-patches
The testcase for pr100106, compiled with optimization for 32-bit powerpc -mcpu=604 with -mstrict-align expands the initialization of a union from a float _Complex value into a load from an SCmode constant pool entry, aligned to 4 bytes, into a DImode pseudo, requiring 8-byte alignment. The patch

[PATCH] libstdc++: testsuite: async.cc early timeout

2022-05-04 Thread Alexandre Oliva via Gcc-patches
The async call and future variable initialization may take a while to complete on uniprocessors, especially if the async call and other unrelated processes run before context switches back to the main thread. Taking steady_begin only then sometimes causes the 11*100ms in the slow clock, counted

Re: [PATCH v2] [PR100106] Reject unaligned subregs when strict alignment is required

2022-05-05 Thread Alexandre Oliva via Gcc-patches
On May 5, 2022, Segher Boessenkool wrote: > On Thu, May 05, 2022 at 03:52:01AM -0300, Alexandre Oliva wrote: >> + else if (reg && MEM_P (reg) >> + && STRICT_ALIGNMENT && MEM_ALIGN (reg) < GET_MODE_ALIGNMENT (omode)) >> +return false; > Please fix the line breaks? Either do a break b

Re: [PATCH v2 2/2] [PR100106] Reject unaligned subregs when strict alignment is required

2022-05-06 Thread Alexandre Oliva via Gcc-patches
On May 5, 2022, Segher Boessenkool wrote: > On Thu, May 05, 2022 at 08:59:21AM +0100, Richard Sandiford wrote: >> Alexandre Oliva via Gcc-patches writes: >> I know this is the best being the enemy of the good, but given >> that we're at the start of stage 1, would i

Re: [PATCH v3] libstdc++: ppc: conditionalize vsx-only simd intrinsics

2022-05-06 Thread Alexandre Oliva via Gcc-patches
On May 6, 2022, Jonathan Wakely wrote: > On Fri, 6 May 2022 at 17:17, Segher Boessenkool wrote: >> > +#if defined __VSX__ || __LONG_WIDTH__ == 32 >> > _GLIBCXX_SIMD_PPC_INTRIN(signed long); >> > _GLIBCXX_SIMD_PPC_INTRIN(unsigned long); >> > +#endif >> >> Is __LONG_WIDTH__ the right macro to u

[PATCH] Avoid visiting newly-created blocks in harden-conditionals

2022-05-11 Thread Alexandre Oliva via Gcc-patches
Reverse iteration over blocks, in gimple-harden-conditionals.cc, was supposed to avoid visiting blocks introduced by hardening and introducing further reversed conditionals and traps for them, but newly-created blocks may be inserted before the current block, as shown by the PR105455 testcase. N

[PATCH] [PR105455] Set edge probabilities when hardening conditionals

2022-05-11 Thread Alexandre Oliva via Gcc-patches
When turning unconditional edges into conditional, as in gimple-harden-conditionals.cc:insert_check_and_trap, the newly-created edge's probability comes out uninitialized, while the previously unconditional edge's probability is presumably profile_probability::always. Mixing initialized and unin

[PATCH] [PR105455] predict: Check for no REG_BR_PROB in uninitialized case

2022-05-11 Thread Alexandre Oliva via Gcc-patches
There is an assumption in force_edge_cold that, if any edge out of the same src block has uninitialized probability, then a conditional branch out of src won't have REG_BR_PROB set. This assumption is supposed to hold, but buggy gimple passes may turn unconditional edges into conditional ones, a

Re: [PATCH] [PR105455] Set edge probabilities when hardening conditionals

2022-05-12 Thread Alexandre Oliva via Gcc-patches
On May 12, 2022, Richard Biener wrote: >> Regstrapped on x86_64-linux-gnu. Ok to install? > OK. Thanks. I failed to ask, but I'm confident this is also ok for gcc-12, so I'm putting it in there as well. Please let me know otherwise. >> PR rtl-optimization/105455 >> * gimple-harden-condition

Re: [PATCH] Avoid visiting newly-created blocks in harden-conditionals

2022-05-13 Thread Alexandre Oliva via Gcc-patches
On May 12, 2022, Richard Biener wrote: > Note you are relying on an implementation detail here, it might be > better to mark blocks visited or iterate over the CFG in a more > defined manner *nod*, I was wondering whether that property could be relied on. I also see BB_NEW set in bb->flags in t

Re: [Ada] Introduce hardbool Machine_Attribute for Ada

2022-05-13 Thread Alexandre Oliva via Gcc-patches
On May 12, 2022, Pierre-Marie de Rodat wrote: > Implement and document hardened booleans, from nonstandard boolean types > with representation clauses to the extra validity checking performed on > boolean types annotated with the "hardbool" Machine_Attribute pragma. And here is a test for testsu

[PATCH] ada: gcc-if: build proper String_Pointer for Get_External_Name

2022-05-13 Thread Alexandre Oliva via Gcc-patches
The compiler is allowed to assume it can access String bounds, such as the prefix passed to Get_External_Name, even in circumstances in which the prefix is not going to be used and has_prefix is false, so, from the C side, we have to build a proper String_Template for the String_Pointer. Regstra

Re: [PATCH] Avoid visiting newly-created blocks in harden-conditionals

2022-05-13 Thread Alexandre Oliva via Gcc-patches
On May 13, 2022, Richard Biener wrote: > Yeah, I'm not sure who clears that bit - grepping shows no user > besides the setter... *nod*, that's what I'd found out myself. Oh well... >> Though I suppose it might be useful to document and enforce the property >> that a newly-created block takes u

Re: [PATCH] Add divide by zero side effect.

2022-05-20 Thread Alexandre Oliva via Gcc-patches
On May 18, 2022, Andrew MacLeod via Gcc-patches wrote: > I'm open to suggestions for a better term! How about inference? -- Alexandre Oliva, happy hackerhttps://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer Disinformation flourishes

Re: [PATCH] configure: add --disable-fix-includes

2022-05-20 Thread Alexandre Oliva via Gcc-patches
On May 11, 2022, Martin Liška wrote: > Ready to be installed? Hmm... I don't like that --disable-fixincludes would still configure, build and even install fixincludes. This would be surprising, given that the semantics of disabling a component is to not even configure it. How about leaving th

[PATCH] Support multilib-aware target lib flags self-specs overriding

2022-05-20 Thread Alexandre Oliva via Gcc-patches
This patch introduces -multiflags, short for multilib TFLAGS, as an option that does nothing by default, but that can be added to TFLAGS and mapped to useful options by driver self-specs. I realize -m is reserved for machine-specific flags, which this option sort-of isn't, but its intended use i

Re: [PATCH v2] Support --disable-fixincludes.

2022-05-24 Thread Alexandre Oliva via Gcc-patches
On May 24, 2022, Martin Liška wrote: > Allways install limits.h and syslimits.h header files > to include folder. typo: s/Allways/Always/ I'm a little worried about this bit, too. limitx.h includes "syslimits.h", mentioning it should be in the same directory. Perhaps it could be left in inclu

Re: [PATCH] hardened conditionals

2021-10-30 Thread Alexandre Oliva via Gcc-patches
FYI, I'm putting in this follow-up tweak to the GNAT manual. Implied compares in Ada Harded Conditionals documentation From: Alexandre Oliva Improve the wording on optimizations that prevent compare hardening, so as to also cover cases in which explicit compares get combined into operations wi

Re: [Ada] introduce stack scrub (strub) feature

2021-10-06 Thread Alexandre Oliva via Gcc-patches
On Oct 5, 2021, Pierre-Marie de Rodat wrote: > * gcc-interface/utils.c (handle_strub_attribute): New. > (gnat_internal_attribute_table): Add strub. FTR, this is just a dummy. The actual implementation was submitted along with the language- and machine-independent infrastructure at

Re: [PATCH] var-tracking: Fix a wrong-debug issue caused by my r10-7665 var-tracking change [PR102441]

2021-10-08 Thread Alexandre Oliva via Gcc-patches
Hello, Jakub, On Oct 4, 2021, Jakub Jelinek wrote: > Finally, patch2, the shortest patch, uses MO_VAL_SET whenever destination > is not sp and otherwise drops the micro-operation on the floor. That sounds quite reasonable to me, and it is indeed my favorite of the 3 proposed patches, because t

[PATCH] hardened conditionals

2021-10-08 Thread Alexandre Oliva via Gcc-patches
This patch introduces optional passes to harden conditionals used in branches, and in computing boolean expressions, by adding redundant tests of the reversed conditions, and trapping in case of unexpected results. Though in abstract machines the redundant tests should never fail, CPUs may be le

Re: [PATCH] hardened conditionals

2021-10-11 Thread Alexandre Oliva via Gcc-patches
On Oct 9, 2021, Richard Biener wrote: > Why two passes (and two IL traverses?) Different traversals, no reason to force them into a single pass. One only looks at the last stmt of each block, where cond stmts may be, while the other has to look at every stmt. > How do you prevent RTL optimiz

Re: [PATCH] hardened conditionals

2021-10-13 Thread Alexandre Oliva via Gcc-patches
On Oct 12, 2021, Richard Biener wrote: > Are there any issues with respect to debugging when using such > asm()s? Not in this case. When creating short-lived copies for immediate use, like I do in the proposed patch, either the original value remains live in its original location and we use an

[FYI] [Ada] reenable ada83 library unit renaming error

2021-10-13 Thread Alexandre Oliva via Gcc-patches
The condition of the 'if' encompassed that of the 'elsif', so the error message wouldn't get a chance to be printed. Regstrapped on x86_64-linux-gnu. I'm checking this in. for gcc/ada/ChangeLog * par-ch10.adb (P_Compilation_Unit): Reenable ada83 library unit renaming test and

Re: [PATCH] hardened conditionals

2021-10-15 Thread Alexandre Oliva via Gcc-patches
On Oct 14, 2021, Richard Biener wrote: > Yeah, I think that eventually marking the operation we want to preserve > (with volatile?) would be the best way. On GIMPLE that's difficult, > it's easier on GENERIC (we can set TREE_THIS_VOLATILE on the > expression at least), and possibly also on RTL (

Re: [PATCH] hardened conditionals

2021-10-20 Thread Alexandre Oliva via Gcc-patches
On Oct 18, 2021, Richard Biener wrote: > Yes, it is (just having had a quick look most of the functions in the > pass lack function-level comments). Oh my, I'm so sorry, please accept my apologies. I stepped away from this patch for a few weeks, and when I got back to it, I did not realize it w

Re: [PATCH] hardened conditionals

2021-10-21 Thread Alexandre Oliva via Gcc-patches
On Oct 20, 2021, Alexandre Oliva wrote: > I suppose it's a latent issue exposed by the patch, I was mistaken. Though I even had bisected the -fcompare-debug problem back to a patch from back in May, that added a new sink_code pass before store_merging, it was actually a bug in my patch, it was

Re: [PATCH] hardened conditionals

2021-10-27 Thread Alexandre Oliva via Gcc-patches
On Oct 26, 2021, Richard Biener wrote: > OK. Thanks. I've just fixed the ChangeLog entry and pushed it: >> * common.opt (fharden-compares): New. >> (fharden-conditional-branches): New. >> * doc/invoke.texi: Document new options. >> * gimple-harden-conditionals.cc: New. + * Makefile.in (OBJS)

Re: [r12-397 Regression] Failed to bootstrap on Linux/x86_64

2021-05-09 Thread Alexandre Oliva via Gcc-patches
On May 9, 2021, "sunil.k.pandey" wrote: > On Linux/x86_64, > da9e6e63d1ae22e530ec7baf59f6ed028bf05776 is the first bad commit Thanks, this fallout from a commit race was fixed in commit 5fbe6a8e73b52c6ebc28b9111456226c1cda6472 Author: Prathamesh Kulkarni Date: Tue May 4 11:11:18 2021 +0530

[RFC] Introduce -finline-memset-loops

2022-12-26 Thread Alexandre Oliva via Gcc-patches
try_store_by_multiple_pieces was added not long ago, enabling variable-sized memset to be expanded inline when the worst-case in-range constant length would, using conditional blocks with powers of two to cover all possibilities of length and alignment. This patch extends the memset expansion to

[00/13] check hash table counts

2022-12-26 Thread Alexandre Oliva via Gcc-patches
While looking into another issue that corrupted hash tables, I added code to check consistency of element counts, and hit numerous issues that were concerning, of three kinds: insertion of entries that seem empty, dangling insertions, and lookups during insertions. These problems may all have th

[01/13] scoped tables: insert before further lookups

2022-12-26 Thread Alexandre Oliva via Gcc-patches
Avoid hash table lookups between requesting an insert and storing the inserted value in avail_exprs_stack. Lookups before the insert is completed could fail to find double-hashed elements. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * tree-ssa-scopedtables.cc

[02/13] varpool: do not add NULL vnodes to referenced

2022-12-26 Thread Alexandre Oliva via Gcc-patches
Avoid adding NULL vnodes to referenced tables. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * varpool.c (symbol_table::remove_unreferenced_decls): Do not add NULL vnodes to referenced table. --- gcc/varpool.cc |4 +++- 1 file changed, 3 insertions(+

[03/13] tree-inline decl_map: skip mapping NULL to itself

2022-12-26 Thread Alexandre Oliva via Gcc-patches
Mapping a NULL key is no use, skip it. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * tree-inline.cc (insert_decl_map): Skip mapping a NULL decl as value to itself. --- gcc/tree-inline.cc |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

[04/13] [C++] constraint: insert norm entry once

2022-12-26 Thread Alexandre Oliva via Gcc-patches
Use NO_INSERT to test whether inserting should be attempted. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/cp/ChangeLog * constraint.cc (normalize_concept_check): Use NO_INSERT for pre-insertion check. --- gcc/cp/constraint.cc |8 +--- 1 file changed, 5 in

[05/13] ssa-loop-niter: skip caching of null operands

2022-12-26 Thread Alexandre Oliva via Gcc-patches
When a TREE_OPERAND is NULL, do not cache it. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * tree-ssa-loop-niter.cc (expand_simple_operands): Refrain from caching NULL TREE_OPERANDs. --- gcc/tree-ssa-loop-niter.cc |2 ++ 1 file changed, 2 insertions

[07/13] postreload-gcse: no insert on mere lookup

2022-12-26 Thread Alexandre Oliva via Gcc-patches
lookup_expr_in_table is not used for insertions, but it mistakenly used INSERT rather than NO_INSERT. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * postreload-gcse.cc (lookup_expr_in_table): Use NO_INSERT. --- gcc/postreload-gcse.cc |2 +- 1 file changed,

[06/13] tree-inline decl_map: skip mapping result's NULL default def

2022-12-26 Thread Alexandre Oliva via Gcc-patches
If a result doesn't have a default def, don't attempt to remap it. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * tree-inline.cc (declare_return_variable): Don't remap NULL default def of result. --- gcc/tree-inline.cc |9 + 1 file changed,

[08/13] tm: complete tm_restart insertion

2022-12-26 Thread Alexandre Oliva via Gcc-patches
Insertion of a tm_restart_node in tm_restart failed to record the newly-allocated node in the hash table. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * trans-mem.cc (split_bb_make_tm_edge): Record new node in tm_restart. --- gcc/trans-mem.cc |2 +-

[09/13] [C++] constexpr: request insert iff depth is ok

2022-12-26 Thread Alexandre Oliva via Gcc-patches
cxx_eval_call_expression requests an INSERT even in cases when it would later decide not to insert. This could break double-hashing chains. Arrange for it to use NO_INSERT when the insertion would not be completed. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/cp/ChangeLog

[10/13] lto: drop dummy partition mapping

2022-12-26 Thread Alexandre Oliva via Gcc-patches
When adding a catch-all partition, we map NULL to it. That mapping is ineffective and unnecessary. Drop it. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/lto/ChangeLog * lto-partition.cc (lto_1_to_1_map): Drop NULL partition mapping. --- gcc/lto/lto-partition.cc

[11/13] ada: don't map NULL decl to locus

2022-12-26 Thread Alexandre Oliva via Gcc-patches
When decl is NULL, don't record its mapping in the decl_to_instance_map. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ada/ChangeLog * gcc-interface/trans.cc (Sloc_to_locus): Don't map NULL decl. --- gcc/ada/gcc-interface/trans.cc |2 +- 1 file changed, 1 insertion(+)

[12/13] hash set: reject attempts to add empty values

2022-12-26 Thread Alexandre Oliva via Gcc-patches
Check, after adding a key to a hash set, that the entry does not look empty. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * hash-set.h (add): Check that the inserted entry does not look empty. --- gcc/hash-set.h |6 +- 1 file changed, 5 insertio

[13/13] hash-map: reject empty-looking insertions

2022-12-26 Thread Alexandre Oliva via Gcc-patches
Check, after inserting entries, that they don't look empty. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * hash-map.h (put, get_or_insert): Check that entry does not look empty after insertion. --- gcc/hash-map.h |4 +++- 1 file changed, 3 insertion

Re: [05/13] ssa-loop-niter: skip caching of null operands

2022-12-27 Thread Alexandre Oliva via Gcc-patches
Hello, Jeff, On Dec 27, 2022, Jeff Law wrote: >> * tree-ssa-loop-niter.cc (expand_simple_operands): Refrain >> from caching NULL TREE_OPERANDs. > I must admit some curiosity about the NULL operand though. Do you > recall what kind of node had a NULL operand and whether or not that > was a vali

[14/17] parloops: don't request insert that won't be completed

2022-12-28 Thread Alexandre Oliva via Gcc-patches
In take_address_of, we may refrain from completing a decl_address INSERT if gsi is NULL, so dnn't even ask for an INSERT in this case. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * tree-parloops.cc (take_address_of): Skip INSERT if !gsi. --- gcc/tree-parloops.

[15/17] prevent hash set/map insertion of deleted entries

2022-12-28 Thread Alexandre Oliva via Gcc-patches
On Dec 27, 2022, David Malcolm wrote: > Would it make sense to also add assertions that such entries aren't > Traits::is_deleted? (both for hash_map and hash_set) Yeah, I guess so. I've come up with something for hash-table proper too, coming up in 17/17. Just like the recently-added checks

[16/17] check hash table counts at expand

2022-12-28 Thread Alexandre Oliva via Gcc-patches
On Dec 28, 2022, Martin Liška wrote: > I really like the verification code you added. It's quite similar to what > I added to hash-table.h: *nod* Prompted by your encouragement, I've combined the element count verification code with the verify() loop, and also added it to expand, where it can b

[17/17] check hash table insertions

2022-12-28 Thread Alexandre Oliva via Gcc-patches
On Dec 27, 2022, Alexandre Oliva wrote: > The number of bugs it revealed tells me that leaving callers in charge > of completing insertions is too error prone. I found this > verification code a bit too expensive to enable in general. Here's a relatively cheap, checking-only test to catch dangl

Re: [17/17] check hash table insertions

2022-12-28 Thread Alexandre Oliva via Gcc-patches
On Dec 28, 2022, Richard Biener wrote: > I wonder if on INSERT, pushing a DELETED marker would fix the dangling > insert and search during delete problem be whether that would be > better from a design point of view? (It of course requires a DELETED > representation) I'm undecided whether a desi

Re: [17/17] check hash table insertions

2022-12-30 Thread Alexandre Oliva via Gcc-patches
On Dec 29, 2022, Richard Biener wrote: >> Am 29.12.2022 um 00:06 schrieb Alexandre Oliva : >> >> On Dec 28, 2022, Richard Biener wrote: >> >>> I wonder if on INSERT, pushing a DELETED marker would fix the dangling >>> insert and search during delete problem be whether that would be >>> better

Re: [17/17] check hash table insertions

2022-12-30 Thread Alexandre Oliva via Gcc-patches
On Dec 30, 2022, Richard Biener wrote: > Ah, OK, so the completion is checked at the next conflicting > operation. Yeah, that makes sense I guess. *nod* > Thus OK (I think Jeff already approved the patch). Thanks, 16/ and 17/ were still pending reviews. I'm installing 17/ now. > Thanks and h

[18/18] hash table: enforce testing is_empty before is_deleted

2023-01-12 Thread Alexandre Oliva via Gcc-patches
Existing hash_table traits that use the same representation for empty and deleted slots reject marking slots as deleted, and to not pass is_deleted for slots that pass is_empty. Nevertheless, nearly everywhere, we only test for is_deleted after checking that !is_empty first. The one exception w

Re: [RFC] Introduce -finline-memset-loops

2023-01-13 Thread Alexandre Oliva via Gcc-patches
Hello, Richard, Thank you for the feedback. On Jan 12, 2023, Richard Biener wrote: > On Tue, Dec 27, 2022 at 5:12 AM Alexandre Oliva via Gcc-patches > wrote: >> This patch extends the memset expansion to start with a loop, so as to >> still take advantage of known alignm

Re: [RFC] Introduce -finline-memset-loops

2023-01-13 Thread Alexandre Oliva via Gcc-patches
Hello, Paul, On Jan 13, 2023, Paul Koning wrote: >> On Jan 13, 2023, at 8:54 PM, Alexandre Oliva via Gcc-patches >> wrote: >> Target-specific code is great for tight optimizations, but the main >> purpose of this feature is not an optimization. AFAICT it actually

[PR106746] drop cselib addr lookup in debug insn mem

2023-01-14 Thread Alexandre Oliva via Gcc-patches
The testcase used to get scheduled differently depending on the presence of debug insns with MEMs. It's not clear to me why those MEMs affected scheduling, but the cselib pre-canonicalization of the MEM address is not used at all when analyzing debug insns, so the memory allocation and lookup ar

Re: [RFC] Introduce -finline-memset-loops

2023-01-19 Thread Alexandre Oliva via Gcc-patches
On Jan 16, 2023, Richard Biener wrote: > On Sat, Jan 14, 2023 at 2:55 AM Alexandre Oliva wrote: >> Target-specific code is great for tight optimizations, but the main >> purpose of this feature is not an optimization. AFAICT it actually >> slows things down in general (due to code growth, and t

[PR97714] final: accept markers at line 0

2020-12-22 Thread Alexandre Oliva via Gcc-patches
Back when I introduced debug markers, I seem to have been under the impression that location line 0 would only ever occur for unknown and builtin locations. Though line 0 never comes up in normal processing of source files, and debug info formats often cannot represent them, I suppose there's no

Re: [PATCH] Support multilib-aware target lib flags self-specs overriding

2022-11-05 Thread Alexandre Oliva via Gcc-patches
On Oct 6, 2022, Alexandre Oliva wrote: > I'd much rather we could use -fmultiflags, a far more elegant > arrangement IMHO, so... > Ping? https://gcc.gnu.org/pipermail/gcc-patches/2022-June/597419.html >> for gcc/ChangeLog >> * common.opt (fmultiflags): New. >> * doc/invoke.texi: Document it

Re: [PATCH v2 #1/2] enable adjustment of return_pc debug attrs

2023-04-27 Thread Alexandre Oliva via Gcc-patches
On Apr 14, 2023, Alexandre Oliva wrote: > On Mar 23, 2023, Alexandre Oliva wrote: >> This patch introduces infrastructure for targets to add an offset to >> the label issued after the call_insn to set the call_return_pc >> attribute. This will be used on rs6000, that sometimes issues another >>

harden-conditionals: detach values before compares

2023-04-27 Thread Alexandre Oliva via Gcc-patches
The optimization barriers inserted after compares enable GCC to derive information about the values from e.g. the taken paths, or the absence of exceptions. Move them before the original compares, so that the reversed compares test copies of the original operands, without further optimizations.

[FYI] Use CONFIG_SHELL-/bin/sh in genmultilib

2023-04-27 Thread Alexandre Oliva via Gcc-patches
There are still shells on some systems that lack the ability to start scripts when not using the shell name explicitly. Adjust genmultilib to use ${CONFIG_SHELL-/bin/sh} the same way configure does. Regstrapped on x86_64-linux-gnu. Also built riscv64-elf on an affected platform. I'm checking

[libstdc++] use strtold for from_chars even without locale

2023-05-04 Thread Alexandre Oliva via Gcc-patches
When we're using fast_float for 32- and 64-bit floating point, use strtold for wider long double, even if locales are unavailable. On vxworks, test for strtof's and strtold's declarations, so that they can be used even when cross compiling. Include stdlib.h in the decl-checking macro, so that i

[vxworks] [testsuite] [aarch64] use builtin in pred-not-gen-4.c

2023-05-04 Thread Alexandre Oliva via Gcc-patches
On vxworks, isunordered is defined as a macro that ultimately calls a _Fpcomp function, that GCC doesn't recognize as a builtin, so it can't optimize accordingly. Use __builtin_isunordered instead to get the desired code for the test. Regstrapped on x86_64-linux-gnu. Also tested on aarch64-vx7

Re: [libstdc++] use strtold for from_chars even without locale

2023-05-04 Thread Alexandre Oliva via Gcc-patches
On May 4, 2023, Jonathan Wakely wrote: > And we could use strtod for a target that doesn't support locales *at all* > (so strtod always behaves as specified for LANG=C). Oh, sorry, I misread the *_USELOCALE macro as *_USE_LOCALE, and I thought this was what I was doing. Nevermind, patch withdr

Re: [libstdc++] use strtold for from_chars even without locale

2023-05-05 Thread Alexandre Oliva via Gcc-patches
Here's a patch to skip/xfail the bits that are expected to fail on aarch64-vxworks. [libstdc++] [testsuite] xfail double-prec from_chars for ldbl When long double is wider than double, but from_chars is implemented in terms of double, tests that involve the full precision of long double are expe

[FYI] [docs] note that -g opts are implicitly negatable too

2023-01-26 Thread Alexandre Oliva via Gcc-patches
Back in 2017, I made -g* options implicitly negatable, without realizing there was documentation that required updating. Oops. Fixed, at last! Regstrapped on x86_64-linux-gnu. I'm installing this as obvious. for gcc/ChangeLog * doc/options.texi (option, RejectNegative): Mention that

Re: [PATCH] sched-deps, cselib: Fix up some -fcompare-debug issues and regressions [PR108463]

2023-02-02 Thread Alexandre Oliva via Gcc-patches
On Jan 27, 2023, Jakub Jelinek wrote: > Now, 1) is precondition of 2), we can only subst the VALUEs if we > have actually looked the address up, but as can be seen on that testcase, > we are relying on at least the 1) to be done because we subst the values > later on even on DEBUG_INSNs and actua

[PATCH] [PR105665] ivopts: check defs of names in base for undefs

2022-05-27 Thread Alexandre Oliva via Gcc-patches
The patch for PR 100810 tested for undefined SSA_NAMEs appearing directly in the base expression of the potential IV candidate, but that's not enough. The testcase for PR105665 shows an undefined SSA_NAME has the same ill effect if it's referenced as an PHI_NODE arg in the referenced SSA_NAME.

[COMMITTED] [Ada, build] Rename OSCONS_CC to GCC_FOR_ADA_RTS

2022-05-27 Thread Alexandre Oliva via Gcc-patches
Several gnatlib* targets perform, with a subshell and sed, the same GCC_FOR_TARGET pathname transformation that OSCONS_CC performs with make subst macros. Rename OSCONS_CC to a more general name, and use it for gnatlib as well. Tested on x86_64-linux-gnu, checking in. for gcc/ada/ChangeLog

Re: [PATCH] Support multilib-aware target lib flags self-specs overriding

2022-05-28 Thread Alexandre Oliva via Gcc-patches
On May 20, 2022, Alexandre Oliva wrote: > Regstrapped on x86_64-linux-gnu. Ok to install? Ping? https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595356.html > for gcc/ChangeLog > * common.opt (multiflags): New. > * doc/invoke.texi: Document it. > * gcc.cc (driver_self_sp

Re: [PATCH] [PR105665] ivopts: check defs of names in base for undefs

2022-05-31 Thread Alexandre Oliva via Gcc-patches
On May 30, 2022, Richard Biener wrote: > I don't think you can rely on TREE_VISITED not set at the start of the > pass (and you don't clear it either). I don't clear it, but I loop over all SSA names and set TREE_VISITED to either true or false, so that's covered. I even had a test patch that c

Re: [PATCH] [PR105665] ivopts: check defs of names in base for undefs

2022-06-01 Thread Alexandre Oliva via Gcc-patches
On Jun 1, 2022, Richard Biener wrote: > On Tue, May 31, 2022 at 3:27 PM Alexandre Oliva wrote: >int i; >if (flag) > i = init; >i++; > still would (the propagation stops at i++). Uh, are you sure? That doesn't sound right. I meant for the propagation to affect the incremente

Re: [PATCH] [PR105665] ivopts: check defs of names in base for undefs

2022-06-02 Thread Alexandre Oliva via Gcc-patches
On Jun 1, 2022, Alexandre Oliva wrote: > Now I'm thinking we can go for an even stricter predicate to disable > the optimization: if a non-PHI use of a maybe-undefined dominates the > loop, then we can still perform the optimization: Here it is. [PR105665] ivopts: check defs of names in base

Re: [PATCH] configure: arrange to use appropriate objcopy

2022-06-02 Thread Alexandre Oliva via Gcc-patches
On Jun 2, 2022, Jan Beulich via Gcc-patches wrote: > * Makefile.in (ORIGINAL_OBJCOPY_FOR_TARGET): New. > * configure.ac: Check for objcopy, producing > ORIGINAL_OBJCOPY_FOR_TARGET. > * configure: Update accordingly. > * exec-tool.in (ORIGINAL_OBJCOPY_FOR_TARGET): Ne

Re: [PATCH] [PR105665] ivopts: check defs of names in base for undefs

2022-06-03 Thread Alexandre Oliva via Gcc-patches
On Jun 2, 2022, Richard Biener wrote: >> + if (is_a (USE_STMT (use_p))) > I think you also want to skip debug stmts here? Indeed, thanks! (live by the sword, die by the sword ;-) >> + if (dump_file) > && (dump_flags & TDF_DETAILS) please ack >> + if (dump_file) > li

[PATCH, FYI] libcody: fix nonportable shell code in revision.stamp build rule

2022-06-03 Thread Alexandre Oliva via Gcc-patches
Two non-portable shell constructs have been long present in libcody's build rule for revision.stamp: $() instead of ``, and += to append to a shell variable. The former seems to work even when bash is operating as /bin/sh, but += doesn't, and it ends up trying to run revision+=M as a command nam

Re: [PATCH] Support multilib-aware target lib flags self-specs overriding

2022-06-03 Thread Alexandre Oliva via Gcc-patches
On Jun 1, 2022, Hans-Peter Nilsson wrote: > On Fri, 20 May 2022, Alexandre Oliva via Gcc-patches wrote: >> >> This patch introduces -multiflags, short for multilib TFLAGS, as an >> option that does nothing by default, but that can be added to TFLAGS >> and mapped

Re: [PING][PATCH][WIP] have configure probe prefix for gmp/mpfr/mpc [PR44425]

2022-06-20 Thread Alexandre Oliva via Gcc-patches
Hello, Eric, On Jun 9, 2022, Eric Gallager wrote: > (cc-ing the build machinery maintainers listed in MAINTAINERS this time) Thanks, I'd missed it the first time. > On Thu, Jun 2, 2022 at 11:53 AM Eric Gallager wrote: >> So, I'm working on fixing PR bootstrap/44425, and have this patch to >

[PATCH] libstdc++: testsuite: work around bitset namespace pollution

2022-06-20 Thread Alexandre Oliva via Gcc-patches
rtems6 declares a global struct bitset in a header file included indirectly by sys/types.h, that ambiguates the unqualified references to bitset after "using namespace std" in the testsuite. Work around the namespace pollution with using declarations of std::bitset. Regstrapped on x86_64-linux-

[PATCH] libstdc++: testsuite: require cmath for nexttowardl

2022-06-20 Thread Alexandre Oliva via Gcc-patches
nexttowardl is only expected to be available with C99 math, but 20_util/to_chars/long_double.cc uses it unconditionally. State the cmath requirement in the test. Regstrapped on x86_64-linux-gnu, also tested with a cross to aarch64-rtems6. Ok to install? for libstdc++-v3/ChangeLog *

<    1   2   3   4   5   >