Re: [PATCH] Add -fgnu-retain/-fno-gnu-retain

2021-02-16 Thread Jakub Jelinek via Gcc-patches
On Mon, Feb 15, 2021 at 02:35:07PM -0800, H.J. Lu via Gcc-patches wrote: > When building Linux kernel, ld in bninutils 2.36 with GCC 11 generates > thousands of > > ld: warning: orphan section `.data.event_initcall_finish' from `init/main.o' > being placed in section `.data.event_initcall_finish'

[PATCH] split, i386, v5: Fix up df uses in i386 splitters [PR99104]

2021-02-17 Thread Jakub Jelinek via Gcc-patches
On Tue, Feb 16, 2021 at 03:03:56PM +, Richard Sandiford via Gcc-patches wrote: > > On Tue, Feb 16, 2021 at 01:09:43PM +, Richard Sandiford wrote: > >> Can I put in a plea to put this in recog.[hc], and possibly also make > >> it a copy constructor for recog_data_d? I can't think of any le

[PATCH] c++: Fix up build_zero_init_1 once more [PR99106]

2021-02-17 Thread Jakub Jelinek via Gcc-patches
Hi! My earlier build_zero_init_1 patch for flexible array members created an empty CONSTRUCTOR. As the following testcase shows, that doesn't work very well because the middle-end doesn't expect CONSTRUCTOR elements with incomplete type (that the empty CONSTRUCTOR at the end of outer CONSTRUCTOR

[PATCH] i386: Avoid C++ global constructors in every object that includes i386.h

2021-02-17 Thread Jakub Jelinek via Gcc-patches
Hi! When looking at recog.o when working on the recog.[ch] changes to make sure I have not introduced runtime construction of recog_data variable, I have noticed that at least in unoptimized build, every single *.o file that included i386.h has lots of runtime constructors for all the PTA_* variab

[PATCH] array-bounds: Fix up ICE on overaligned variables [PR99109]

2021-02-17 Thread Jakub Jelinek via Gcc-patches
Hi! check_mem_ref builds artificial arrays for variables that don't have array type. The C standard says: "For the purposes of these operators, a pointer to an object that is not an element of an array behaves the same as a pointer to the first element of an array of length one with the type of

Re: [PATCH] split, i386, v5: Fix up df uses in i386 splitters [PR99104]

2021-02-17 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 17, 2021 at 10:30:06AM +, Richard Sandiford wrote: > Hmm. I think that just means that the optimisation performed by > the copy constructor isn't valid in practice (even if it should be > in principle). Guess this is the curse of manipulating data structures > directly rather than

Re: [PATCH] handle VLA of zero length arrays and vice versa (PR 99121)

2021-02-17 Thread Jakub Jelinek via Gcc-patches
On Tue, Feb 16, 2021 at 08:34:41PM -0700, Martin Sebor via Gcc-patches wrote: > + if (integer_all_onesp (nelts)) > + /* Zero length array. */ > + eltsize = 0; > + else > { > - tree bnds[] = { TYPE_MIN_VALUE (dom), TYPE_MAX_VALUE (dom) }; > -

Re: [PATCH v2] Add -fgnu-retain to place used symbols in SHF_GNU_RETAIN section

2021-02-17 Thread Jakub Jelinek via Gcc-patches
On Tue, Feb 16, 2021 at 11:59:21AM -0800, H.J. Lu wrote: > PR target/99113 > * common.opt: Add -fgnu-retain. I'm not sure -fgnu-retain as the option name. Wouldn't say -fretain-used-vars be better? > @@ -1666,6 +1666,10 @@ floop-unroll-and-jam > Common Var(flag_unroll_jam) Optimizati

Re: [PATCH v3] Add retain attribute to place symbols in SHF_GNU_RETAIN section

2021-02-17 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 17, 2021 at 09:34:34AM -0800, H.J. Lu wrote: > -fretain-used-symols. > +/* Add the NAME attribute to *ANODE. */ > + > +static void > +add_attribute (tree *anode, int flags, tree name, tree args, tree ns, > +const bool cxx11_attr_p, > +const struct attribute_spec

Re: [PATCH v4] Add retain attribute to place symbols in SHF_GNU_RETAIN section

2021-02-17 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 17, 2021 at 12:04:34PM -0800, H.J. Lu wrote:> > > + /* For -fretain-used-symbol, a "used" attribute also implies "retain". */ s/-symbol/-symbols/ > + if (flag_retain_used_symbols > + && attributes > + && (TREE_CODE (*node) == FUNCTION_DECL > + || (VAR_P (*node) && T

Re: [PATCH] handle VLA of zero length arrays and vice versa (PR 99121)

2021-02-17 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 17, 2021 at 01:27:55PM -0700, Martin Sebor wrote: Not in this patch, but I've looked at what maxobjsize is and wonder why the roundtrip tree -> HOST_WIDE_INT -> offset_int: const offset_int maxobjsize = tree_to_shwi (max_object_size ()); Can't it be const offset_int maxobjsize = wi

Re: [PATCH] array-bounds: Fix up ICE on overaligned variables [PR99109]

2021-02-17 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 17, 2021 at 01:38:56PM -0700, Martin Sebor wrote: > > - reftype = build_array_type_nelts (reftype, 1); > > + { > > + if (overaligned_type_p (reftype)) > > + reftype = TYPE_MAIN_VARIANT (reftype); > > + reftype = build_array_type_nelts (reftype, 1); > > + } > > Rathe

Re: [PATCH] array-bounds: Fix up ICE on overaligned variables [PR99109]

2021-02-17 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 17, 2021 at 02:38:04PM -0700, Martin Sebor wrote: > How does build_printable_array_type sound? I'll go with that. > Also, would using TYPE_MAIN_VARIANT whenever TYPE_USER_ALIGN is set > be a simpler solution? (It might not be as refined as the test in > your patch but I don't think w

Re: [r11-7271 Regression] FAIL: g++.dg/modules/pr99023_a.H (test for excess errors) on Linux/x86_64

2021-02-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 17, 2021 at 02:19:11PM -0800, sunil.k.pandey via Gcc-patches wrote: > On Linux/x86_64, > > d8889c99aab4b599aa7ceb7079e69a9766171336 is the first bad commit > commit d8889c99aab4b599aa7ceb7079e69a9766171336 > Author: Nathan Sidwell > Date: Wed Feb 17 10:43:21 2021 -0800 > > c++:

[PATCH] c++: Fix -std=c++20 ICE on virtual method call [PR99132]

2021-02-18 Thread Jakub Jelinek via Gcc-patches
Hi! On the following testcase we ICE in C++20 mode during cp_get_callee_fndecl -> constexpr evaluation. It is only in C++20 mode on this testcase because virtual methods can't be constexpr in C++17 and earlier and so potential_constant_expression_1 rejects it earlier. And the ICE is caused by gene

[PATCH] c: Fix ICE with -fexcess-precision=standard [PR99136]

2021-02-18 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs on i686-linux, because c_finish_return wraps c_fully_folded retval back into EXCESS_PRECISION_EXPR, but when the function return type is void, we don't call convert_for_assignment on it that would then be fully folded again, but just put the retval into RETURN_EXPR'

[PATCH] array-bounds, v2: Fix up ICE on overaligned variables [PR99109]

2021-02-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 17, 2021 at 02:38:04PM -0700, Martin Sebor via Gcc-patches wrote: > How does build_printable_array_type sound? This adjusted version also works and has been successfully bootstrapped/regtested on x86_64-linux and i686-linux. Ok for trunk? 2021-02-18 Jakub Jelinek PR middl

Re: [PATCH] handle VLA of zero length arrays and vice versa (PR 99121)

2021-02-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 17, 2021 at 02:11:43PM -0700, Martin Sebor wrote: > On 2/17/21 1:47 PM, Jakub Jelinek wrote: > > On Wed, Feb 17, 2021 at 01:27:55PM -0700, Martin Sebor wrote: > > > > Not in this patch, but I've looked at what maxobjsize is and wonder why > > the roundtrip tree -> HOST_WIDE_INT -> offs

Re: [PATCH] i386: Avoid C++ global constructors in every object that includes i386.h

2021-02-18 Thread Jakub Jelinek via Gcc-patches
On Thu, Feb 18, 2021 at 09:42:00AM +0100, Richard Biener wrote: > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > OK. Can you quickly try whether GCC 4.8 is happy with it? Yes, at least non-bootstrap build with GCC 4.8.5 is just fine with it. Jakub

Re: [PATCH] match.pd: Restrict clz cmp 0 replacement by single_use, PR99142

2021-02-18 Thread Jakub Jelinek via Gcc-patches
On Thu, Feb 18, 2021 at 11:12:26AM +0100, Richard Biener via Gcc-patches wrote: > On Thu, Feb 18, 2021 at 12:35 AM Hans-Peter Nilsson via Gcc-patches > wrote: > > > > If we're not going to eliminate the clz, it's better for the > > comparison to use that result than its input, so we don't > > exte

Re: [PATCH] Add -fgnu-retain/-fno-gnu-retain

2021-02-18 Thread Jakub Jelinek via Gcc-patches
On Thu, Feb 18, 2021 at 12:00:59PM +, Jozef Lawrynowicz wrote: > If we can add ".retain " to GAS, then I agree, current GCC > SHF_GNU_RETAIN behavior should be removed. For GCC 12 we leverage > .retain to implement the functionality where "used" saves symbols form > linker garbage collection, w

Re: [PATCH] middle-end/99122 - Issues with VLA parameter inlining

2021-02-18 Thread Jakub Jelinek via Gcc-patches
On Thu, Feb 18, 2021 at 01:37:29PM +0100, Richard Biener wrote: > The following instructs IPA not to inline calls with VLA parameters > and adjusts inlining not to create invalid view-converted VLA > parameters on mismatch and makes the error_mark paths with debug > stmts actually work. > > The fi

Re: c++: Macros need to be GTY-reachable [PR 99023]

2021-02-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 17, 2021 at 01:46:37PM -0500, Nathan Sidwell wrote: > I'd missed that macros were allocated from GC storage, and that they can > become unattached from an identifier, and therefore not GC-reachable. > And then bad things happen. Fixed by making the module machinery's > ref

Re: [PATCH] Add -fgnu-retain/-fno-gnu-retain

2021-02-18 Thread Jakub Jelinek via Gcc-patches
On Thu, Feb 18, 2021 at 02:22:35PM +, Jozef Lawrynowicz wrote: > I think it is a enhancement, and true to the spirit of the attribute, > for "used" to save a symbol from linker garbage collection. > > Why should "used" mean: > Save this symbol from compiler optimization, but allow the linker

Re: [PATCH] handle VLA of zero length arrays and vice versa (PR 99121)

2021-02-18 Thread Jakub Jelinek via Gcc-patches
On Thu, Feb 18, 2021 at 09:24:28AM -0700, Martin Sebor via Gcc-patches wrote: > > Consider a different (GNU C, in C++ struct S has non-zero size) testcase: > > void f (void*); > > > > void g (int n) > > { > >struct S {} a[n]; > >((int*)a)[0] = 0; > >f (a); > > } > > yyy.c:6:12: warning

Re: [PATCH] handle VLA of zero length arrays and vice versa (PR 99121)

2021-02-18 Thread Jakub Jelinek via Gcc-patches
On Thu, Feb 18, 2021 at 07:00:52PM +0100, Jakub Jelinek wrote: > > The size of the VLA is zero regardless of its bound and accessing > > it is invalid so the warning is expected. > > Yes, some warning, but not the one you are giving, that is nonsensical. > Array subscript 0 is not outside of array

Re: [PATCH] split, i386, v5: Fix up df uses in i386 splitters [PR99104]

2021-02-18 Thread Jakub Jelinek via Gcc-patches
On Thu, Feb 18, 2021 at 06:29:06PM +, Richard Sandiford wrote: > Yeah, agree that copying 1KB isn't great, but I think we should keep any > optimisations of the copy in recog.[hc]. So IMO it would be better & > safer to go with a plain copy for now and leave optimising it as a nice > future im

[PATCH] tree-cfg: Fix up gimple_merge_blocks FORCED_LABEL handling [PR99034]

2021-02-19 Thread Jakub Jelinek via Gcc-patches
Hi! The verifiers require that DECL_NONLOCAL or EH_LANDING_PAD_NR labels are always the first label if there is more than one label. When merging blocks, we don't honor that though. On the following testcase, we try to merge blocks: [count: 0]: : S::~S (&s); and [count: 0]: : resx 1 where is

ARM patch ping

2021-02-19 Thread Jakub Jelinek via Gcc-patches
Hi! I'd like to ping the https://gcc.gnu.org/pipermail/gcc-patches/2021-February/565225.html patch - PR98998 P1 fix. Thanks Jakub

Re: [PATCH] gcov: use mmap pools for KVP.

2021-02-19 Thread Jakub Jelinek via Gcc-patches
On Tue, Feb 09, 2021 at 09:37:12AM +0100, Martin Liška wrote: > PING^2 > > @Honza: ? Just concerning Windows (though I don't have access to that OS and can't verify), e.g. https://github.com/m-labs/uclibc-lm32/blob/master/utils/mmap-windows.c contains public domain code to emulate mmap on top of

[PATCH] libstdc++: Fix up parallel_backend_serial.h [PR97549]

2021-02-20 Thread Jakub Jelinek via Gcc-patches
Hi! In GCC 10, parallel_backend.h just included parallel_backend_{serial,tbb}.h and did nothing beyond that, and parallel_backend_tbb.h provided directly namespace __pstl { namespace __par_backend { ... } } and defined everything in there, while parallel_backend_serial.h did: namespace __pstl { na

Re: [Patch] Fortran/OpenMP: Fix optional dummy procedures [PR99171]

2021-02-22 Thread Jakub Jelinek via Gcc-patches
On Mon, Feb 22, 2021 at 01:06:56PM +0100, Tobias Burnus wrote: > Normal dummy arguments get some additional redirection if they are > OPTIONAL; however, that's not the case for dummy procedures. > > That was shown by a simple 'procedure(), optional :: proc' example > in the PR. – The fix is as sim

Re: [WIP] Re: [PATCH] openmp: Fix intermittent hanging of task-detach-6 libgomp tests [PR98738]

2021-02-22 Thread Jakub Jelinek via Gcc-patches
On Fri, Feb 19, 2021 at 07:12:42PM +, Kwok Cheung Yeung wrote: > I have opted for a union of completion_sem (for tasks that are undeferred) > and a struct gomp_team *detach_team (for deferred tasks) that holds the team > if the completion event has not yet fulfilled, or NULL if is it. I don't s

Re: [WIP] Re: [PATCH] openmp: Fix intermittent hanging of task-detach-6 libgomp tests [PR98738]

2021-02-22 Thread Jakub Jelinek via Gcc-patches
On Mon, Feb 22, 2021 at 02:49:44PM +0100, Jakub Jelinek wrote: > So, I think for the team != gomp_thread ()->ts.team > && !do_wake > && gomp_team_barrier_waiting_for_tasks (&team->barrier) > && team->task_detach_count == 0 > case, we need to wake up 1 thread anyway and arrange for it to do: >

Re: [PATCH] Require SHF_GNU_RETAIN support for retain test

2021-02-22 Thread Jakub Jelinek via Gcc-patches
On Mon, Feb 22, 2021 at 03:06:58PM -0800, H.J. Lu via Gcc-patches wrote: > Since retain attribute requires SHF_GNU_RETAIN, run retain tests only > if SHF_GNU_RETAIN is supported. > > PR testsuite/99173 > * c-c++-common/attr-retain-5.c: Require R_flag_in_section. > * c-c++-common/

[committed] libstdc++: Fix up constexpr std::char_traits::compare [PR99181]

2021-02-23 Thread Jakub Jelinek via Gcc-patches
Hi! Because of LWG 467, std::char_traits::lt compares the values cast to unsigned char rather than char, so even when char is signed we get unsigned comparision. std::char_traits::compare uses __builtin_memcmp and that works the same, but during constexpr evaluation we were calling __gnu_cxx::cha

[PATCH] fold-const: Fix ICE in fold_read_from_constant_string on invalid code [PR99204]

2021-02-23 Thread Jakub Jelinek via Gcc-patches
Hi! fold_read_from_constant_string and expand_expr_real_1 have code to optimize constant reads from string (tree vs. rtl). If the STRING_CST array type has zero low bound, index is fold converted to sizetype and so the compare_tree_int works fine, but if it has some other low bound, it calls size_

Patch ping

2021-02-23 Thread Jakub Jelinek via Gcc-patches
Hi! I'd like to ping the https://gcc.gnu.org/pipermail/gcc-patches/2021-February/565350.html patch, P2 PR99085 ice-on-valid-code fix in fixup_partitions. Thanks Jakub

Re: [WIP] Re: [PATCH] openmp: Fix intermittent hanging of task-detach-6 libgomp tests [PR98738]

2021-02-23 Thread Jakub Jelinek via Gcc-patches
On Tue, Feb 23, 2021 at 09:43:51PM +, Kwok Cheung Yeung wrote: > On 19/02/2021 7:12 pm, Kwok Cheung Yeung wrote: > > I have included the current state of my patch. All task-detach-* tests > > pass when executed without offloading or with offloading to GCN, but > > with offloading to Nvidia, tas

[PATCH] match.pd, expand: Fold VCE from integer with [0, 1] range to bool into NOP_EXPR [PR80635]

2021-02-24 Thread Jakub Jelinek via Gcc-patches
Hi! SRA creates a VCE from integer to bool and that VCE then prevents other optimizations or e.g. prevents the uninit pass from avoiding a false positive warning. In the PR using NOP_EXPR has been discussed as one possibility and has been rejected because at expansion it will emit a superfluous &

[PATCH] fold-const: Fix up ((1 << x) & y) != 0 folding for vectors [PR99225]

2021-02-24 Thread Jakub Jelinek via Gcc-patches
Hi! This optimization was written purely with scalar integers in mind, can work fine even with vectors, but we can't use build_int_cst but need to use build_one_cst instead. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2021-02-24 Jakub Jelinek PR tree-optimiza

Re: [PATCH] match.pd, expand: Fold VCE from integer with [0, 1] range to bool into NOP_EXPR [PR80635]

2021-02-24 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 24, 2021 at 11:50:10AM +0100, Richard Biener wrote: > > In the PR using NOP_EXPR has been discussed as one possibility and has been > > rejected because at expansion it will emit a superfluous & 1 operation. > > I still think it is a good idea to use NOP_EXPR and so have changed > > exp

[PATCH] vrp: Handle VCE in vrp_simplify_cond_using_ranges [PR80635]

2021-02-24 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 24, 2021 at 01:32:02PM +0100, Richard Biener wrote: > Small comment about the patch below, which otherwise is OK: > > I think that !INTEGRAL_TYPE_P (TREE_TYPE (innerop)) is a sufficient > condition here. Unfortunately as shown during the bootstrap, that patch contained a fatal thinko,

[PATCH] match.pd: Use single_use for (T)(A) + CST -> (T)(A + CST) [PR95798]

2021-02-24 Thread Jakub Jelinek via Gcc-patches
Hi! The r10-2806 change regressed following testcases, instead of doing int -> unsigned long sign-extension once and then add 8, 16, ... 56 to it for each of the memory access, it adds 8, 16, ... 56 in int mode and then sign extends each. So that means: + movq$0, (%rsp,%rax,8) + l

[committed] libgcc: Avoid signed negation overflow in __powi?f2 [PR99236]

2021-02-24 Thread Jakub Jelinek via Gcc-patches
Hi! When these functions are called with integer minimum, there is UB on the libgcc side. Fixed in the obvious way, the code in the end wants ABSU_EXPR behavior. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk as obvious. 2021-02-24 Jakub Jelinek PR libgcc/

[committed] openmp: Diagnose invalid teams nested in target construct [PR99226]

2021-02-24 Thread Jakub Jelinek via Gcc-patches
Hi! The OpenMP standard says: "A teams region can only be strictly nested within the implicit parallel region or a target region. If a teams construct is nested within a target construct, that target construct must contain no statements, declarations or directives outside of the teams construct."

Re: [WIP] Re: [PATCH] openmp: Fix intermittent hanging of task-detach-6 libgomp tests [PR98738]

2021-02-24 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 24, 2021 at 06:17:01PM +, Kwok Cheung Yeung wrote: > > 1) while linux --enable-futex and accel gomp_sem_t is small (int), rtems > > and especially posix gomp_sem_t is large; so while it might be a good > > idea to inline gomp_sem_t on config/{linux,accel} into the union, for

Re: [PATCH] match.pd: Use single_use for (T)(A) + CST -> (T)(A + CST) [PR95798]

2021-02-24 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 24, 2021 at 08:52:44PM +0100, Marc Glisse wrote: > On Wed, 24 Feb 2021, Jakub Jelinek via Gcc-patches wrote: > > > The following patch adds single_use case which restores these testcases > > but keeps the testcases the patch meant to improve as is. > > He

Re: [PATCH] match.pd: Use single_use for (T)(A) + CST -> (T)(A + CST) [PR95798]

2021-02-25 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 24, 2021 at 08:56:55PM +0100, Jakub Jelinek via Gcc-patches wrote: > On Wed, Feb 24, 2021 at 08:52:44PM +0100, Marc Glisse wrote: > > On Wed, 24 Feb 2021, Jakub Jelinek via Gcc-patches wrote: > > > > > The following patch adds single_use case which restores t

Re: [PATCH] match.pd, expand: Fold VCE from integer with [0, 1] range to bool into NOP_EXPR [PR80635]

2021-02-25 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 24, 2021 at 05:54:08PM -0700, Martin Sebor via Gcc-patches wrote: > > > Why does uninit warn with VCE but not with NOP_EXPR? Or does the > > > warning disappear because of those other optimizations you mention? > > Can you comment on Jeff's POC patch in the PR? Would it make sense >

Re: [WIP] Re: [PATCH] openmp: Fix intermittent hanging of task-detach-6 libgomp tests [PR98738]

2021-02-25 Thread Jakub Jelinek via Gcc-patches
On Thu, Feb 25, 2021 at 04:21:31PM +, Kwok Cheung Yeung wrote: > Reversing the order reduces the hole to 3 bytes: > > size_t num_dependees;/*80 8 */ > union { > gomp_sem_t * completion_sem; /*88 8 */ >

[PATCH] c++: Implement P1102R2 - Down with ()!

2021-02-25 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch implements P1102R2. For attributes, we have already attribute parsing before the parameter declarations and so when that is omitted, if the attributes are first we already accept it. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? Or defer for GCC 12?

[PATCH] c++: Fix operator() lookup in lambdas [PR95451]

2021-02-25 Thread Jakub Jelinek via Gcc-patches
Hi! During name lookup, name-lookup.c uses: if (!(!iter->type && HIDDEN_TYPE_BINDING_P (iter)) && (bool (want & LOOK_want::HIDDEN_LAMBDA) || !is_lambda_ignored_entity (iter->value)) && qualify_lookup (iter->value, want))

Re: [PATCH] middle-end/99281 - avoid bitfield stores into addressable types

2021-02-26 Thread Jakub Jelinek via Gcc-patches
On Fri, Feb 26, 2021 at 09:40:05AM +0100, Richard Biener wrote: > This avoids doing bitfield stores into the return object of calls > when using return-slot optimization and the type is addressable. > Instead we have to pass down the original target RTX to the call > expansion which otherwise tries

[committed] gcse, ipa-devirt: Use %wd/%wu instead of HOST_WIDE_INT_PRINT* in diagnostics [PR99288]

2021-02-27 Thread Jakub Jelinek via Gcc-patches
Hi! HOST_WIDE_INT_PRINT* in the string literals of warning/error/inform etc. make those messages non-translatable, and we have a perfectly fine alternative when not using system *printf - %w{d,u}. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk as obvious. 2021-02-27 J

[PATCH] dwarf2out: Fix -gsplit-dwarf on riscv or other non-.uleb128 targets [PR99090]

2021-02-27 Thread Jakub Jelinek via Gcc-patches
Hi! As mentioned in the PR, riscv* only supports .uleb128 with constant arguments, doesn't support difference of two labels because of aggressive linker relaxations. But I bet various other targets, especially those not using GNU assembler, might suffer from the same problem. As the FIXME comment

Re: [PATCH] libgomp, testsuite : Require alias support for PR96390 testcase.

2021-02-27 Thread Jakub Jelinek via Gcc-patches
On Sat, Feb 27, 2021 at 02:59:03PM +, Iain Sandoe wrote: > This test fails everywhere on Darwin, which does not have support for symbol > aliases. Add a dg-require-alias to UNSUPPORT it. > > Ordinarily, I would have considered adding the dg-require as ‘obvious’ but I > see > that you already

[commit] typos: Fix various typos - mainly misspelled reference* [PR99304]

2021-02-28 Thread Jakub Jelinek via Gcc-patches
Hi! The PR is about a typo in handle_malloc_attribute diagnostic message, but grepping around I found many other cases and while fixing those I've noticed a couple of other typos. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk. 2021-02-28 Jakub Jelinek PR c

[committed] fortran: Replace double space in diagnostic with a single one [PR99300]

2021-02-28 Thread Jakub Jelinek via Gcc-patches
Hi! The diagnostic had " " in it instead of just " ". Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk as obvious. 2021-02-28 Jakub Jelinek PR fortran/99300 * frontend-passes.c (doloop_code): Replace double space in diagnostics with a single

[committed] fortran: Fix up wording of 3 OpenMP diagnostic messages [PR99303]dbI

2021-02-28 Thread Jakub Jelinek via Gcc-patches
Hi! As reported in the PR, some diagnostic messages need wording improvements. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk. 2021-02-28 Jakub Jelinek PR fortran/99303 * openmp.c (gfc_omp_requires_add_clause): Fix up diagnostic message word

Patch ping^2

2021-03-01 Thread Jakub Jelinek via Gcc-patches
On Tue, Feb 23, 2021 at 09:49:08AM +0100, Jakub Jelinek via Gcc-patches wrote: > I'd like to ping the > https://gcc.gnu.org/pipermail/gcc-patches/2021-February/565350.html > patch, P2 PR99085 ice-on-valid-code fix in fixup_partitions. Ping Thanks Jakub

[PATCH] dwarf2out: Fix up split-dwarf .debug_macro handling [PR99319]

2021-03-02 Thread Jakub Jelinek via Gcc-patches
Hi! The -gsplit-dwarf changes came a few months after .debug_macro and the r0-120109 changes just changed the 2nd operand of DW_MACRO_GNU_{define,undef}_indirect from the usual .debug_str section offset argument to leb128 index into .debug_str_offsets without changing the opcodes. DWARF5 standard

[PATCH] vrp: Improve register_edge_assert_for [PR95757]

2021-03-02 Thread Jakub Jelinek via Gcc-patches
Hi! The Wstringop-overflow-25.c testcase doesn't emit one of the expected warnings on targets that don't do short curcuiting due to target costs (or e.g. with --param=logical-op-non-short-circuit=0 on all targets). The problem is that only reassoc2 optimizes: _49 ={v} unsigned_value_source; i

[PATCH] c-family: Avoid ICE on va_arg [PR99324]

2021-03-02 Thread Jakub Jelinek via Gcc-patches
Hi! build_va_arg calls the middle-end mark_addressable, which e.g. requires that cfun is non-NULL. The following patch calls instead c_common_mark_addressable_vec which is the c-family variant similarly to the FE c_mark_addressable and cxx_mark_addressable, except that it doesn't error on addres

[PATCH] c++: Fix -fstrong-eval-order for operator &&, || and , [PR82959]

2021-03-02 Thread Jakub Jelinek via Gcc-patches
Hi! P0145R3 added "However, the operands are sequenced in the order prescribed for the built-in operator" rule for overloaded operator calls when using the operator syntax. op_is_ordered follows that, but added just the overloaded operators added in that paper. &&, || and comma operators had rule

[PATCH] i386: Fix a peephole2 for -mavx512vl -mno-avx512bw [PR99321]

2021-03-02 Thread Jakub Jelinek via Gcc-patches
Hi! As the testcase shows, the (define_peephole2 [(set (match_operand 0 "sse_reg_operand") (match_operand 1 "sse_reg_operand")) (set (match_dup 0) (match_operator 3 "commutative_operator" [(match_dup 0) (match_operand 2 "memory_operand")]))] peephole2 can

Re: [PATCH] testsuite: i386: Fix gcc.target/i386/pr95798-?.c on Solaris

2021-03-03 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 03, 2021 at 01:36:20PM +0100, Rainer Orth wrote: > The new gcc.target/i386/pr95798-?.c tests FAIL on 64-bit Solaris/x86: > > +FAIL: gcc.target/i386/pr95798-1.c scan-assembler 1, > 8(%rsp,%r[a-z0-9]*,8) > +FAIL: gcc.target/i386/pr95798-1.c scan-assembler 2, > 16(%rsp,%r[a-

Re: [PATCH] middle-end/97855 - fix diagnostic with default pretty printer

2021-03-03 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 03, 2021 at 04:23:59PM +0100, Richard Biener wrote: > I think it's the D.6750 which is printed via > > else if (TREE_CODE (node) == DEBUG_EXPR_DECL) > { > if (flags & TDF_NOUID) > pp_string (pp, "D#"); > else > pp_printf (pp

Re: [PATCH] middle-end/97855 - fix diagnostic with default pretty printer

2021-03-03 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 03, 2021 at 12:45:54PM -0500, David Malcolm wrote: > > I think it's the D.6750 which is printed via > > > >   else if (TREE_CODE (node) == DEBUG_EXPR_DECL) > >     { > >   if (flags & TDF_NOUID) > >     pp_string (pp, "D#"); > >   else > >   

Re: [PATCH] middle-end/97855 - avoid recursing into pp_printf

2021-03-04 Thread Jakub Jelinek via Gcc-patches
On Thu, Mar 04, 2021 at 09:08:35AM +0100, Richard Biener wrote: > 2021-03-04 Richard Biener > > PR middle-end/97855 > * tree-pretty-print.c: Poison pp_printf. > (dump_decl_name): Avoid use of pp_printf. > (dump_block_node): Likewise. > (dump_generic_node): Likewise

[committed] libgomp: Use sizeof(void*) based checks instead of looking through $CC $CFLAGS for -m32/-mx32

2021-03-04 Thread Jakub Jelinek via Gcc-patches
On Thu, Jan 14, 2021 at 07:18:13PM +0100, Thomas Schwinge wrote: > libgomp/ > PR libgomp/65099 > * plugin/configfrag.ac (PLUGIN_NVPTX): Restrict to supported > configurations. > * configure: Regenerate. > * plugin/plugin-nvptx.c (nvptx_get_num_devices): Remove 64

[PATCH] c-ppoutput: Fix preprocessing ICE on very large line number [PR99325]

2021-03-04 Thread Jakub Jelinek via Gcc-patches
Hi! In libcpp, lines are represented as linenum_type, which is unsigned int. The following testcases ICE because maybe_print_line_1 is sometimes called with UNKNOWN_LOCATION (e.g. at pragma eof) and while most of the time the && src_line >= print.src_line && src_line < print.src_line

[PATCH] expand: Fix ICE in store_bit_field_using_insv [PR93235]

2021-03-04 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs on aarch64. The problem is that op0 is (subreg:HI (reg:HF ...) 0) and because we can't create a SUBREG of a SUBREG and aarch64 doesn't have HImode insv, only SImode insv, store_bit_field_using_insv tries to create (subreg:SI (reg:HF ...) 0) which is not valid for t

[PATCH] c++: Fix up [[nodiscard]] on ctors on targetm.cxx.cdtor_returns_this targets [PR99362]

2021-03-04 Thread Jakub Jelinek via Gcc-patches
Hi! In the P1771R1 changes JeanHeyd reverted part of Alex' PR88146 fix, but that seems to be incorrect to me. Where P1771R1 suggests warnings for [[nodiscard]] on constructors is handled in a different place - in particular the TARGET_EXPR handling of convert_to_void. When we have CALL_EXPR of a

[PATCH] dwarf2out: Fix debug info for 2 byte floats [PR99388]

2021-03-05 Thread Jakub Jelinek via Gcc-patches
Hi! Aarch64, ARM and a couple of other architectures have 16-bit floats, HFmode. As can be seen e.g. on void foo (void) { __fp16 a = 1.0; asm ("nop"); a = 2.0; asm ("nop"); a = 3.0; asm ("nop"); } testcase, GCC mishandles this on the dwarf2out.c side by assuming all floating point type

[PATCH] libgcov: Fix build on Darwin [PR99406]

2021-03-05 Thread Jakub Jelinek via Gcc-patches
Hi! As reported, bootstrap currently fails on older Darwin because MAP_ANONYMOUS is not defined. The following is what gcc/system.h does, so I think it should work for libgcov. Build tested on x86_64-linux, ok for trunk? 2021-03-05 Jakub Jelinek PR gcov-profile/99406 * libgco

[PATCH] libstdc++: Improve std::rot[lr] [PR99396]

2021-03-05 Thread Jakub Jelinek via Gcc-patches
Hi! As can be seen on: #include unsigned char f1 (unsigned char x, int y) { return std::rotl (x, y); } unsigned char f2 (unsigned char x, int y) { return std::rotr (x, y); } unsigned short f3 (unsigned short x, int y) { return std::rotl (x, y); } unsigned short f4 (unsigned short x, int y) { ret

[PATCH] i386: Improve [QH]Imode rotates with masked shift count [PR99405]

2021-03-05 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase shows that while we nicely optimize away the useless and? of shift count before rotation for [SD]Imode rotates, we don't do that for [QH]Imode. The following patch optimizes that by using the right iterator on those 4 patterns. Bootstrapped/regtested on x86_64-linux an

Re: [PATCH] libgcov: Fix build on Darwin [PR99406]

2021-03-05 Thread Jakub Jelinek via Gcc-patches
On Fri, Mar 05, 2021 at 04:19:47PM +, Iain Sandoe wrote: > Jakub Jelinek via Gcc-patches wrote: > > > As reported, bootstrap currently fails on older Darwin because > > MAP_ANONYMOUS > > is not defined. > > > > The following is what gcc/system.h

[PATCH] testsuite: Fix up attr-flatten-1.c failure [PR99363]

2021-03-05 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 24, 2021 at 07:08:34PM -0500, Jason Merrill via Gcc-patches wrote: > gcc/ChangeLog: > > PR c++/96078 > * cgraphunit.c (process_function_and_variable_attributes): Don't > warn about flatten on an alias if the target also has it. > * cgraph.h (symtab_node::get_ali

[PATCH] i386: Fix some -mavx512vl -mno-avx512bw bugs [PR99321]

2021-03-05 Thread Jakub Jelinek via Gcc-patches
Hi! As I wrote in the mail with the previous PR99321 fix, we have various bugs where we emit instructions that need avx512bw and avx512vl ISAs when compiling with -mavx512vl -mno-avx512bw. Without the following patch, /* PR target/99321 */ /* Would need some effective target for GNU as that suppo

[committed] openmp: Avoid ICEs due to orphaned labels in OpenMP regions [PR99322]

2021-03-05 Thread Jakub Jelinek via Gcc-patches
Hi! When performing cfg cleanup at the end of cfg pass, if there are any OpenMP regions and some basic blocks are unreachable and contain forced labels, remove_bb moves the labels to previous bb, but if the two bb belong to different OpenMP regions, that means it will end up in a different functio

Re: [PATCH] i386: Fix some -mavx512vl -mno-avx512bw bugs [PR99321]

2021-03-06 Thread Jakub Jelinek via Gcc-patches
On Sat, Mar 06, 2021 at 11:19:15AM +0100, Uros Bizjak wrote: > > We already have Yw constraint which is equivalent to v for > > -mavx512bw -mavx512vl and to nothing otherwise, so for > > the instructions that need both we need to use xYw and > > v for modes that don't need that. > > Perhaps we sho

[PATCH] i386, v2: Fix some -mavx512vl -mno-avx512bw bugs [PR99321]

2021-03-07 Thread Jakub Jelinek via Gcc-patches
On Sat, Mar 06, 2021 at 01:39:23PM +0100, Uros Bizjak via Gcc-patches wrote: > > One possibility would be to change the meaning of Yw, because it > > is an internal undocumented constraint and all uses in GCC currently use it > > as xYw: > > constraints.md:(define_register_constraint "Yw" > > mmx.m

Re: [PATCH] target/98856 - split vpinsrq with new peephole2

2021-03-08 Thread Jakub Jelinek via Gcc-patches
On Mon, Mar 08, 2021 at 12:04:22PM +0100, Richard Biener wrote: > +;; Further split pinsrq variants of vec_concatv2di to hide the latency > +;; the GPR->XMM transition(s). > +(define_peephole2 > + [(match_scratch:DI 3 "Yv") > + (set (match_operand:V2DI 0 "sse_reg_operand") > + (vec_concat:V2

[PATCH] c++: Fix coroutines on targetm.cxx.cdtor_return_this targets [PR99459]

2021-03-09 Thread Jakub Jelinek via Gcc-patches
Hi! The r11-7528 build_co_await changes broke coroutines on arm*-linux-gnuabi, 2780 ^FAIL.*coroutines/ in total. The problem is that arm is targetm.cxx.cdtor_return_this target where both ctors and dtors in the ABI return this pointer rather than void, and build_new_method_call_1 does:

[PATCH] c++: Implement P0466R5 __cpp_lib_is_layout_compatible compiler helpers [PR101539]

2021-08-03 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch implements __is_layout_compatible trait and __builtin_is_corresponding_member helper function for the std::is_corresponding_member template function. For now it implements the IMHO buggy but standard definition of layout-compatible and std::is_layout_compatible requirements

[PATCH] analyzer: Fix ICE on MD builtin [PR101721]

2021-08-03 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs because DECL_FUNCTION_CODE asserts the builtin is BUILT_IN_NORMAL, but it sees a backend (MD) builtin instead. The FE, normal and MD builtin numbers overlap, so one should always check what kind of builtin it is before looking at specific codes. Fixed thusly, boots

[PATCH] c: Fix ICE caused by get_parm_array_spec [PR101702]

2021-08-03 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs, because nelts is NOP_EXPR around INTEGER_CST - it is a VLA whose extent folds into a constant - and get_parm_array_spec has specific INTEGER_CST handling and otherwise strips nops from nelts and stores it into a TREE_LIST that is later asserted to be a DECL_P or EX

Re: [PATCH, v2, libgomp, OpenMP 5.0] Implement omp_get_device_num

2021-08-03 Thread Jakub Jelinek via Gcc-patches
On Mon, Aug 02, 2021 at 09:10:57PM +0800, Chung-Lin Tang wrote: > > I think this won't work properly with the intel micoffload, where the host > > libgomp is used in the offloaded code. > > For omp_is_initial_device, the plugin solves it by: > > liboffloadmic/plugin/offload_target_main.cpp > > over

[committed] libgcc: Fix duplicated content of config/t-slibgcc-fuchsia

2021-08-04 Thread Jakub Jelinek via Gcc-patches
Hi! The file has two identical halves, seems like twice applied patch. Committed to trunk as obvious. 2021-08-04 Jakub Jelinek * config/t-slibgcc-fuchsia: Undo doubly applied patch. --- libgcc/config/t-slibgcc-fuchsia.jj 2021-01-04 10:25:53.777064609 +0100 +++ libgcc/config/t-slibg

[committed] testsuite: Fix duplicated content of gcc.c-torture/execute/ieee/pr29302-1.x

2021-08-04 Thread Jakub Jelinek via Gcc-patches
Hi! After seeing the config/t-slibgcc-fuchsia issue, I ran a dumb and slow for f in `find . -type f`; do sz=`ls -l $f | awk '{print $5}'`; sz=`expr $sz / 2`; [ $sz = 0 ] && continue; if [ $sz -gt 16 ]; then dd if=$f of=/tmp/1 bs=1 count=16 2>/dev/null; dd if=$f of=/tmp/2 bs=1 skip=$sz count=16 2

[committed] c++: Fix up #pragma omp declare {simd,variant} and acc routine parsing

2021-08-04 Thread Jakub Jelinek via Gcc-patches
Hi! When parsing default arguments, we need to temporarily clear parser->omp_declare_simd and parser->oacc_routine, otherwise it can clash with further declarations inside of e.g. lambdas inside of those default arguments. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk

[PATCH] c++: Fix up parsing of attributes for using-directive

2021-08-04 Thread Jakub Jelinek via Gcc-patches
Hi! As I've said earlier and added xfails in gen-attrs-76.C test, https://eel.is/c++draft/namespace.udir#nt:using-directive has attribute-specifier-seq[opt] at the start, not at the end before ; as gcc is expecting. IMHO we should continue parsing at the end the GNU attributes because using namesp

Re: [PATCH] omp-low.c split

2021-08-04 Thread Jakub Jelinek via Gcc-patches
On Wed, Aug 04, 2021 at 02:40:27PM +0200, Thomas Schwinge wrote: > Small fix-up for r243673 (Git commit 629b3d75c8c5a244d891a9c292bca6912d4b0dd9) > "Split omp-low into multiple files". > > gcc/ > * Makefile.in (GTFILES): Remove '$(srcdir)/omp-offload.c'. Ok, thanks. > --- > gcc/Makef

[PATCH] libcpp: Fix makeucnid bug with combining values [PR100977]

2021-08-05 Thread Jakub Jelinek via Gcc-patches
Hi! I've noticed in ucnid.h two adjacent lines that had all flags and combine values identical and as such were supposed to be merged. This is due to a bug in makeucnid.c, which records last_flag, last_combine and really_safe of what has just been printed, but because of a typo mishandles it for

[PATCH] libcpp: Regenerate ucnid.h using Unicode 13.0.0 files [PR100977]

2021-08-05 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch (incremental to the makeucnid.c fix) regenerates ucnid.h with https://www.unicode.org/Public/13.0.0/ucd/ files. Bootstrapped/regtested on top of the previous patch (which has also been bootstrapped/regtested alone) on x86_64-linux and i686-linux, ok for trunk? 2021-08-04

[PATCH] libgcc: Honor LDFLAGS_FOR_TARGET when linking libgcc_s

2021-08-05 Thread Jakub Jelinek via Gcc-patches
Hi! When building gcc with some specific LDFLAGS_FOR_TARGET, e.g. LDFLAGS_FOR_TARGET=-Wl,-z,relro,-z,now those flags propagate info linking of target shared libraries, e.g. lib{ubsan,tsan,stdc++,quadmath,objc,lsan,itm,gphobos,gdruntime,gomp,go,gfortran,atomic,asan}.so.* but there is one important

[PATCH] c++: Optimize constinit thread_local vars [PR101786]

2021-08-06 Thread Jakub Jelinek via Gcc-patches
Hi! The paper that introduced constinit mentioned in rationale that constinit can be used on externs as well and that it can be used to avoid the thread_local initialization wrappers, because the standard requires that if constinit is present on any declaration, it is also present on the initializ

[PATCH] libcpp: For C++23 treat UCNs and UTF-8 chars not valid in identifiers as separate tokens

2021-08-06 Thread Jakub Jelinek via Gcc-patches
On Fri, Aug 06, 2021 at 11:53:56AM +0200, Jakub Jelinek via Gcc-patches wrote: > Actually, there is another change in P1949R7 that I haven't touched > in the patch and not sure what the implications are. > > To the preprocessing-token non-terminal it adds > each univ

<    1   2   3   4   5   6   7   8   9   10   >