Re: [PATCH][libgomp, testsuite, nvptx] Add libgomp.c/declare-variant-3-sm*.c

2022-02-24 Thread Jakub Jelinek via Gcc-patches
On Thu, Feb 24, 2022 at 11:01:22AM +0100, Tom de Vries wrote: > [ was: Re: [Patch] nvptx: Add -mptx=6.0 + -misa=sm_70 ] > > On 2/24/22 09:29, Tom de Vries wrote: > > I'll try to submit a patch with one or more test-cases. > > Hi, > > These test-cases exercise the omp declare variant construct us

Re: [PATCH][libgomp, testsuite, nvptx] Add libgomp.c/declare-variant-3-sm*.c

2022-02-24 Thread Jakub Jelinek via Gcc-patches
On Thu, Feb 24, 2022 at 11:32:53AM +0100, Tom de Vries wrote: > libgomp/ChangeLog: > > 2022-02-24 Tom de Vries > > * testsuite/libgomp.c/declare-variant-3-sm30.c: New test. > * testsuite/libgomp.c/declare-variant-3-sm35.c: New test. > * testsuite/libgomp.c/declare-variant-3-s

Re: [PATCH][V2][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-24 Thread Jakub Jelinek via Gcc-patches
On Thu, Feb 24, 2022 at 02:30:05PM +, Qing Zhao wrote: > PR middle-end/104550 > > gcc/ChangeLog: > > * gimple-fold.cc (clear_padding_flush): Suppress warnings for new > created uses. > > gcc/testsuite/ChangeLog: > > * gcc.dg/auto-init-pr104550-1.c: New test. >

Re: [PATCH][V2][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-24 Thread Jakub Jelinek via Gcc-patches
On Thu, Feb 24, 2022 at 04:00:33PM +0100, Richard Biener wrote: > > > --- a/gcc/gimple-fold.cc > > > +++ b/gcc/gimple-fold.cc > > > @@ -4379,7 +4379,12 @@ clear_padding_flush (clear_padding_struct *buf, > > > bool full) > > > else > > > { > > > src = make_ssa_name (ty

Re: [PATCH] libgcc: fix a warning calling find_fde_tail

2022-02-24 Thread Jakub Jelinek via Gcc-patches
On Fri, Feb 25, 2022 at 02:35:07AM +0800, Xi Ruoyao via Gcc-patches wrote: > Bootstrapped on x86_64-linux-gnu. OK for master? > > The third parameter of find_fde_tail is an _Unwind_Ptr (which is an > integer type instead of a pointer), but we are passing NULL to it. This > causes a -Wint-convers

Re: [PATCH][V2][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Jakub Jelinek via Gcc-patches
On Fri, Feb 25, 2022 at 08:11:40AM +0100, Richard Biener via Gcc-patches wrote: > On Thu, 24 Feb 2022, Qing Zhao wrote: > > > I briefly checked all the usages of suppress_warning within the current > > gcc, > > and see that most of them are not guarded by any condition. > > > > So, the current

Re: [PATCH][V2][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Jakub Jelinek via Gcc-patches
On Fri, Feb 25, 2022 at 10:13:33AM +0100, Richard Biener via Gcc-patches wrote: > I meant > > /* Set the no_warning flag of STMT to NO_WARNING. */ > > static inline void > gimple_set_no_warning (gimple *stmt, bool no_warning) > { > stmt->no_warning = (unsigned) no_warning; > } > > on the arti

[PATCH] match.pd: Don't create BIT_NOT_EXPRs for COMPLEX_TYPE [PR104675]

2022-02-25 Thread Jakub Jelinek via Gcc-patches
Hi! We don't support BIT_{AND,IOR,XOR,NOT}_EXPR on complex types, &/|/^ are just rejected for them, and ~ is parsed as CONJ_EXPR. So, we should avoid simplifications which turn valid complex type expressions into something that will ICE during expansion. Bootstrapped/regtested on x86_64-linux and

[PATCH] i386: Use a new temp slot kind for splitter to floatdi2_i387_with_xmm [PR104674]

2022-02-25 Thread Jakub Jelinek via Gcc-patches
Hi! As mentioned in the PR, the following testcase is miscompiled for similar reasons as the already fixed PR78791 - we use SLOT_TEMP slots in various places during expansion and during expansion we can guarantee that the lifetime of those temporary slot doesn't overlap. But the following splitte

[PATCH] internal-fn: Call do_pending_stack_adjust in expand_SPACESHIP [PR104679]

2022-02-25 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase is miscompiled on ia32 at -O2, because when expand_SPACESHIP is called, we have pending stack adjustment from the foo call right before it. Now, ix86_expand_fp_spaceship uses emit_jump_insn several times but then emit_jump also several times. While emit_jump_insn doesn'

[committed] warning-control: Comment spelling fix

2022-02-25 Thread Jakub Jelinek via Gcc-patches
Hi! This fixes a spelling mistake I found while looking at warning-control implementation. Committed as obvious. 2022-02-25 Jakub Jelinek * warning-control.cc (get_nowarn_spec): Comment spelling fix. --- gcc/warning-control.cc.jj 2022-01-17 18:05:04.861306618 +0100 +++ gcc/warning

Re: [PATCH][V2][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Jakub Jelinek via Gcc-patches
On Fri, Feb 25, 2022 at 10:31:50AM +0100, Richard Biener wrote: > I think it's used as fallback for UNKNOWN_LOCATION, but if we "invent" > a creative location for the artificial stmt it will of course > affect other stmts/expressions using that location. > > > I think it will work. > > Yes, I thi

Re: [PATCH][V2][middle-end/104550]Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding

2022-02-25 Thread Jakub Jelinek via Gcc-patches
On Fri, Feb 25, 2022 at 11:12:13AM +0100, Richard Biener wrote: > On Fri, 25 Feb 2022, Jakub Jelinek wrote: > > > On Fri, Feb 25, 2022 at 10:31:50AM +0100, Richard Biener wrote: > > > I think it's used as fallback for UNKNOWN_LOCATION, but if we "invent" > > > a creative location for the artificia

[committed] testsuite: Move pr104540.C test to g++.target/i386/

2022-02-25 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 23, 2022 at 07:45:20PM -0300, Alexandre Oliva via Gcc-patches wrote: > PR middle-end/104540 > * g++.dg/PR104540.C: New. Both -mforce-drap and -mstackrealign options are x86 specific. Tested on x86_64-linux, i686-linux and powerpc64le-linux, committed to trunk. 2022-02-25

[PATCH] match.pd: Further complex simplification fixes [PR104675]

2022-02-25 Thread Jakub Jelinek via Gcc-patches
Hi! Mark mentioned in the PR further 2 simplifications that also ICE with complex types. For these, eventually (but IMO GCC 13 materials) we could support it for vector types if it would be uniform vector constants. Currently integer_pow2p is true only for INTEGER_CSTs and COMPLEX_CSTs and we can'

[committed] rs6000: Use rs6000_emit_move in movmisalign expander [PR104681]

2022-02-25 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs, because for some strange reason it decides to use movmisaligntf during expansion where the destination is MEM and source is CONST_DOUBLE. For normal mov expanders the rs6000 backend uses rs6000_emit_move to ensure that if one operand is a MEM, the other is a REG a

[PATCH] libatomic: Improve 16-byte atomics on Intel AVX [PR104688]

2022-02-27 Thread Jakub Jelinek via Gcc-patches
Hi! As mentioned in the PR, the latest Intel SDM has added: "Processors that enumerate support for Intel® AVX (by setting the feature flag CPUID.01H:ECX.AVX[bit 28]) guarantee that the 16-byte memory operations performed by the following instructions will always be carried out atomically: • MOVA

Re: [PATCH] libatomic: Improve 16-byte atomics on Intel AVX [PR104688]

2022-02-28 Thread Jakub Jelinek via Gcc-patches
On Mon, Feb 28, 2022 at 04:27:19PM +0800, Xi Ruoyao wrote: > On Mon, 2022-02-28 at 07:06 +0100, Jakub Jelinek via Gcc-patches wrote: > > +++ libatomic/Makefile.am   2022-02-25 17:25:16.298314196 +0100 > > @@ -138,8 +138,9 @@ IFUNC_OPTIONS    = -march=i586 > >

Re: [PATCH] openmp, fortran: Check that event handles passed to detach clauses are not arrays [PR104131]

2022-02-28 Thread Jakub Jelinek via Gcc-patches
On Mon, Feb 28, 2022 at 02:01:03PM +, Kwok Cheung Yeung wrote: > gcc/fortran/ > > PR fortran/104131 > * openmp.cc (gfc_match_omp_detach): Check that the event handle is not > an array type. > > gcc/testsuite/ > > PR fortran/104131 > * gfortran.dg/gomp/pr104131.f

Re: [PATCH] openmp, fortran: Check that event handles passed to detach clauses are not arrays [PR104131]

2022-02-28 Thread Jakub Jelinek via Gcc-patches
On Mon, Feb 28, 2022 at 04:54:24PM +0100, Mikael Morin wrote: > Le 28/02/2022 à 15:27, Kwok Cheung Yeung a écrit : > > On 28/02/2022 2:07 pm, Jakub Jelinek wrote: > (...) > > > Don't we usually test instead || (*expr)->rank != 0 when testing for > > > scalars? > > > > (...) > > > > So (*expr)->ra

Re: [PATCH] openmp, fortran: Check that event handles passed to detach clauses are not arrays [PR104131]

2022-02-28 Thread Jakub Jelinek via Gcc-patches
On Mon, Feb 28, 2022 at 06:33:15PM +0100, Mikael Morin wrote: > > It is true that the spots I saw in fortran/openmp.cc that test rank look > > like: > > if (!gfc_resolve_expr (el->expr) > > || el->expr->ts.type != BT_INTEGER || el->expr->rank != 0) > > etc., so probably !gfc_r

[PATCH] libsanitizer: Fix bootstrap on FreeBSD [PR102675]

2021-11-17 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 08, 2021 at 08:50:41AM +0100, Gerald Pfeifer wrote: > This is the first part I committed on Friday, the second will > follow today. Here is an alternative to the patch changing a file imported from compiler-rt upstream, so that we don't need to cary a local patch for that particular p

[PATCH] pch, v2: Add support for PCH for relocatable executables

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 08, 2021 at 08:48:07PM +0100, Jakub Jelinek via Gcc-patches wrote: > On Mon, Nov 08, 2021 at 12:46:04PM +0100, Jakub Jelinek via Gcc-patches wrote: > > So, if we want to make PCH work for PIEs, I'd say we can: > > 1) add a new GTY option, say callback, which would

[committed] libgomp: Fix up aligned_alloc arguments [PR102838]

2021-11-18 Thread Jakub Jelinek via Gcc-patches
Hi! C says that aligned_alloc size must be an integral multiple of alignment. While glibc doesn't care about it, apparently Solaris does. So, this patch decreases the priority of aligned_alloc among the other variants because it needs more work and can waste more memory and rounds up the size to m

[committed] libgomp: Ensure that either gomp_team is properly aligned [PR102838]

2021-11-18 Thread Jakub Jelinek via Gcc-patches
Hi! struct gomp_team has struct gomp_work_share array inside of it. If that latter structure has 64-byte aligned member in the middle, the whole struct gomp_team needs to be 64-byte aligned, but we weren't allocating it using gomp_aligned_alloc. This patch fixes that, except that on gcn team_mall

Re: [Patch] libcpp: Fix _Pragma in #__VA_ARGS__ [PR103165]

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 10, 2021 at 09:30:29PM +, Joseph Myers wrote: > On Wed, 10 Nov 2021, Tobias Burnus wrote: > > > Disclaimer: While this patch does a step into the right direction, > > it probably does help with any of the other _Pragma issues. Neither > > with 'gcc -E' when the pragma wasn't regist

Re: [PATCH 1/3] nptl: Extract from pthread_cond_common.c

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 05:27:42PM +0100, Florian Weimer wrote: > + /* S3. See __condvar_load_64_relaxed. */ Shouldn't that be See __atomic_wide_counter_load_relaxed ? > + if (((l >> 31) > 0) && ((h >> 31) > 0)) Any reason not to write it as (int) l < 0 && (int) h < 0? Yes, the compiler

Re: [PATCH 3/3] elf: Add _dl_find_eh_frame function

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 05:28:02PM +0100, Florian Weimer wrote: > This function is similar to __gnu_Unwind_Find_exidx as used on arm. > It can be used to speed up the libgcc unwinder. I'm little bit worried that this trades the speed of exceptions for speed of dlopen/dlclose and extra memory use i

Re: [PATCH 1/4] libgcc: Remove tbase member from struct unw_eh_callback_data

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 05:28:35PM +0100, Florian Weimer wrote: > It is always a null pointer. > > libgcc/ChangeLog > > * unwind-dw2-fde-dip.c (struct unw_eh_callback_data): Remove > tbase member. > (base_from_cb_data): Adjust. > (_Unwind_IteratePhdrCallback): Likewise. >

Re: [PATCH 2/4] libgcc: Remove dbase member from struct unw_eh_callback_data if NULL

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 05:28:41PM +0100, Florian Weimer wrote: > Only i386 and nios2 need this member at present. Only i386, nios2, frv and bfin to be precise. > > libgcc/ChangeLog > > * unwind-dw2-fde-dip.c (NEED_DBASE_MEMBER): Define. > (struct unw_eh_callback_data): Make dbase m

Re: [PATCH 3/4] libgcc: Split FDE search code from PT_GNU_EH_FRAME lookup

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 05:28:48PM +0100, Florian Weimer wrote: > @@ -383,12 +376,34 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, > size_t size, void *ptr) > # endif > #endif > > - _Unwind_Ptr dbase = unw_eh_callback_data_dbase (data); > + return 1; > +} > + > +/* Result type o

Re: [PATCH 3/3] elf: Add _dl_find_eh_frame function

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 05:28:02PM +0100, Florian Weimer wrote: > --- /dev/null > +++ b/bits/dlfcn_eh_frame.h > @@ -0,0 +1,33 @@ > +/* System dependent definitions for find unwind information using ld.so. > + Copyright (C) 2021 Free Software Foundation, Inc. > + This file is part of the GNU C L

Re: [PATCH 4/4] libgcc: Use _dl_find_eh_frame in _Unwind_Find_FDE

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 05:28:55PM +0100, Florian Weimer wrote: > --- a/libgcc/unwind-dw2-fde-dip.c > +++ b/libgcc/unwind-dw2-fde-dip.c > @@ -129,6 +129,30 @@ unw_eh_callback_data_dbase (const struct > unw_eh_callback_data *data > #endif > } > > +#ifdef DL_FIND_EH_FRAME_DBASE > +#if DL_FIND_EH

Re: [PATCH] c++/103326 - fix ICE in tsubst with VECTOR_CST

2021-11-19 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 19, 2021 at 08:57:01AM +0100, Richard Biener wrote: > This adds missing handling of VECTOR_CST. > > Bootstrap and regtest pending on x86_64-unknown-linux-gnu, OK? > > Thanks, > Richard. > > 2021-11-19 Richard Biener > > PR c++/103326 > * pt.c (tsubst_copy): Handle VEC

[PATCH] fortran, debug: Fix up DW_AT_rank [PR103315]

2021-11-19 Thread Jakub Jelinek via Gcc-patches
Hi! For DW_AT_rank we were emitting .uleb128 0x4# DW_AT_rank .byte 0x97# DW_OP_push_object_address .byte 0x23# DW_OP_plus_uconst .uleb128 0x1c .byte 0x6 # DW_OP_deref on 64-bit and .uleb128 0x4# DW_AT_rank .byte 0x

Re: [PATCH] Remove MAY_HAVE_DEBUG_MARKER_STMTS and MAY_HAVE_DEBUG_BIND_STMTS.

2021-11-19 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 19, 2021 at 10:38:41AM +0100, Richard Biener via Gcc-patches wrote: > > Yup. Though there is a 1:1 equivalence right now, conceptually other > > kinds of debug marker stmts, and of debug bind stmts, could be > > introduced, and then the macros would be adjusted to encompass the new > >

[PATCH] c++: Avoid adding implicit attributes during apply_late_template_attributes [PR101180]

2021-11-19 Thread Jakub Jelinek via Gcc-patches
Hi! decl_attributes and its caller cplus_decl_attributes sometimes add implicit attributes, e.g. optimize attribute if #pragma GCC optimize is active, target attribute if #pragma GCC target is active, or e.g. omp declare target attribute if in between #pragma omp declare target and #pragma omp end

Re: [PATCH] middle-end: fix de-optimizations with bitclear patterns on signed values

2021-11-19 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 07:30:35AM +, Tamar Christina via Gcc-patches wrote: > @@ -2099,7 +2124,7 @@ spaceship_replacement (basic_block cond_bb, basic_block > middle_bb, >|| !tree_fits_shwi_p (rhs) >|| !IN_RANGE (tree_to_shwi (rhs), -1, 1)) > return false; > - if (orig_us

Re: [PATCH 00/10] __builtin_dynamic_object_size

2021-11-19 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 10, 2021 at 12:31:26AM +0530, Siddhesh Poyarekar wrote: > - Instead of bailing out on non-constant sizes with > __builtin_object_size, it should be possible to use ranger to > get an upper and lower bound on the size expression and use that to > implement __builtin_object_size. I

Re: [PATCH 01/10] tree-object-size: Replace magic numbers with enums

2021-11-19 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 10, 2021 at 12:31:27AM +0530, Siddhesh Poyarekar wrote: > A simple cleanup to allow inserting dynamic size code more easily. > > gcc/ChangeLog: > > * tree-object-size.c: New enum. > (object_sizes, computed, addr_object_size, > compute_builtin_object_size, init_object

Re: [PATCH 02/10] tree-object-size: Abstract object_sizes array

2021-11-19 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 10, 2021 at 12:31:28AM +0530, Siddhesh Poyarekar wrote: > Put all accesses to object_sizes behind functions so that we can add > dynamic capability more easily. > > gcc/ChangeLog: > > * tree-object-size.c (object_sizes_grow, object_sizes_release, > object_sizes_unknown_p,

Re: [PATCH 03/10] tree-object-size: Use tree instead of HOST_WIDE_INT

2021-11-19 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 10, 2021 at 12:31:29AM +0530, Siddhesh Poyarekar wrote: > * tree-object-size.h (compute_builtin_object_size): Return tree > instead of HOST_WIDE_INT. > * builtins.c (fold_builtin_object_size): Adjust. > * gimple-fold.c (gimple_fold_builtin_strncat): Likewise. >

Re: [PATCH 03/10] tree-object-size: Use tree instead of HOST_WIDE_INT

2021-11-19 Thread Jakub Jelinek via Gcc-patches
On Sat, Nov 20, 2021 at 12:31:19AM +0530, Siddhesh Poyarekar wrote: > > Neither of these are equivalent to what it used to do before. > > If some target has e.g. pointers wider than size_t, then previously we could > > compute bytes that doesn't fit into size_t and would return NULL which > > event

[PATCH] i386: Fix up handling of target attribute [PR101180]

2021-11-20 Thread Jakub Jelinek via Gcc-patches
Hi! As shown in the testcase below, if a function has multiple target attributes (rather than a single one with one or more arguments) or if a function gets one target attribute on one declaration and another one on another declaration, on x86 their effect is not combined into DECL_FUNCTION_SPECIF

Re: [RFC PATCH] gcc: Improve reproducability when building cc1/cc1plus

2021-11-20 Thread Jakub Jelinek via Gcc-patches
On Sat, Nov 20, 2021 at 12:24:21AM -0800, Andrew Pinski via Gcc-patches wrote: > On Sat, Nov 20, 2021 at 12:18 AM Jacob Kroon via Gcc-patches > wrote: > > > > cc1/cc1plus both include a checksum of the object files, archives and > > options used during linking. Unless the host binutils has been bu

[PATCH] openacc: Fix up C++ #pragma acc routine handling [PR101731]

2021-11-20 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs because two function declarations are nested in each other and the acc routine handling code isn't prepared to put the pragma on both. The fix is similar to what #pragma omp declare {simd,variant} does, in particular set the fndecl_seen flag already in cp_parser_la

[committed] openmp: Handle OMP_MASKED in potential_constant_expression_1 [PR103349]

2021-11-22 Thread Jakub Jelinek via Gcc-patches
Hi! When adding OMP_MASKED, I apparently forgot to handle it in potential_constant_expression_1, which means we can ICE on it. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk. 2021-11-22 Jakub Jelinek PR c++/103349 * constexpr.c (potent

[PATCH] libcpp, v2: Fix _Pragma in #__VA_ARGS__ [PR103165]

2021-11-22 Thread Jakub Jelinek via Gcc-patches
On Thu, Nov 18, 2021 at 09:55:52PM +, Joseph Myers wrote: > On Thu, 18 Nov 2021, Jakub Jelinek via Gcc-patches wrote: > > > Are we handling the pragma at a wrong phase of preprocessing? > > I think that converting it to a single preprocessing token (rather than > four s

[PATCH] x86: Speed up target attribute handling by using a cache

2021-11-22 Thread Jakub Jelinek via Gcc-patches
Hi! The target attribute handling is very expensive and for the common case from x86intrin.h where many functions get implicitly the same target attribute, we can speed up compilation a lot by caching it. The following patches both create a single entry cache, where they cache for a particular ta

Re: [PATCH 03/10] tree-object-size: Use tree instead of HOST_WIDE_INT

2021-11-22 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 22, 2021 at 03:41:57PM +0530, Siddhesh Poyarekar wrote: > So I played around a bit with this. Basically: > > char buf[8]; > > __SIZE_TYPE__ test (void) > { > char *p = &buf[0x9004]; > return __builtin_object_size (p + 2, 0); > } > > when built with -m32 returns 0x7002 bu

Re: [PATCH 03/10] tree-object-size: Use tree instead of HOST_WIDE_INT

2021-11-22 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 22, 2021 at 06:01:08PM +0530, Siddhesh Poyarekar wrote: > On 11/22/21 17:30, Siddhesh Poyarekar wrote: > > So I've got patch 10/10, which handles dynamic (and consequently > > negative) offsets.  It basically computes a "whole size", which then > > gives the extent to which a negative o

Re: [PATCH] x86: Speed up target attribute handling by using a cache

2021-11-22 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 22, 2021 at 02:03:19PM +0100, Martin Liška wrote: > I see only one patch attached, Jakub. Can you please send also the second one? The first one has been inlined in the mail body (the one with attribs.[ch] changes), the second one has been attached (the one without that). Jaku

Re: [PATCH] x86: Speed up target attribute handling by using a cache

2021-11-22 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 22, 2021 at 02:10:08PM +0100, Martin Liška wrote: > On 11/22/21 14:05, Jakub Jelinek wrote: > > On Mon, Nov 22, 2021 at 02:03:19PM +0100, Martin Liška wrote: > > > I see only one patch attached, Jakub. Can you please send also the second > > > one? > > > > The first one has been inlin

Re: [PATCH] openacc: Fix up C++ #pragma acc routine handling [PR101731]

2021-11-22 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 22, 2021 at 03:49:42PM +0100, Thomas Schwinge wrote: > Then, regarding the user-visible behavior: > > > +#pragma acc routine /* { dg-error "not immediately followed by a single > > function declaration or definition" "" { target c++ } } */ > > +int foo (int bar ()); > > So in C++ we

[committed] openmp: Fix up handling of reduction clauses on the loop construct [PR102431]

2021-11-23 Thread Jakub Jelinek via Gcc-patches
Hi! We were using unshare_expr and walk_tree_without_duplicate replacement of the placeholder vars. The OMP_CLAUSE_REDUCTION_{INIT,MERGE} can contain other trees that need to be duplicated though, e.g. BLOCKs referenced in BIND_EXPR(s), or local VAR_DECLs. This patch uses the inliner code to cop

[PATCH] inliner: Remove unused transform_lang_insert_block hook

2021-11-23 Thread Jakub Jelinek via Gcc-patches
Hi! This struct copy_body_data's hook is always NULL since merge of the tuples branch, before that it has been shortly used by the C++ FE during ctor/dtor cloning to chain the remapped blocks, but only very shortly, before transform_lang_insert_block was a bool and the call to insert_block was don

Re: [PATCH 03/10] tree-object-size: Use tree instead of HOST_WIDE_INT

2021-11-23 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 22, 2021 at 01:32:22PM +0100, Jakub Jelinek via Gcc-patches wrote: > On Mon, Nov 22, 2021 at 06:01:08PM +0530, Siddhesh Poyarekar wrote: > > On 11/22/21 17:30, Siddhesh Poyarekar wrote: > > > So I've got patch 10/10, which handles dynamic (and consequently >

Re: [PATCH 04/10] tree-object-size: Single pass dependency loop resolution

2021-11-23 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 10, 2021 at 12:31:30AM +0530, Siddhesh Poyarekar wrote: > Use SSA names as placeholders self-referencing variables to generate > expressions for object sizes and then reduce those size expressions > to constants instead of repeatedly walking through statements. > > This change also mak

Re: [PATCH 05/10] __builtin_dynamic_object_size: Recognize builtin

2021-11-23 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 10, 2021 at 12:31:31AM +0530, Siddhesh Poyarekar wrote: > Recognize the __builtin_dynamic_object_size builtin and add paths in the > object size path to deal with it, but treat it like > __builtin_object_size for now. Also add tests to provide the same > testing coverage for the new bu

Re: [PATCH 05/10] __builtin_dynamic_object_size: Recognize builtin

2021-11-23 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 23, 2021 at 07:23:01PM +0530, Siddhesh Poyarekar wrote: > > What's the advantage of another argument and then merging it with > > object_size_type over just passing object_size_type which will have > > all the bits in? > > I kept the size bits as an internal detail, I can define them i

Re: [PATCH 04/10] tree-object-size: Single pass dependency loop resolution

2021-11-23 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 23, 2021 at 07:14:04PM +0530, Siddhesh Poyarekar wrote: > > This feels way too risky to me. I think making some code do something > > different between (x & OST_DYNAMIC) == 0 and == 1 is just fine, > > it doesn't have to share everything. After all, for __bdos we actually > > emit cod

Re: [PATCH 06/10] tree-object-size: Support dynamic sizes in conditions

2021-11-23 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 10, 2021 at 12:31:32AM +0530, Siddhesh Poyarekar wrote: > (object_sizes_execute): Don't insert min/max for dynamic sizes. I'm worried about this. I'd say what we might want to do is in the early pass for __bdos compute actually __bos (i.e. the static one) and add MIN_EXPR/MAX_EXP

Re: [PATCH 06/10] tree-object-size: Support dynamic sizes in conditions

2021-11-23 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 23, 2021 at 09:06:49PM +0530, Siddhesh Poyarekar wrote: > On 11/23/21 20:42, Jakub Jelinek wrote: > > On Wed, Nov 10, 2021 at 12:31:32AM +0530, Siddhesh Poyarekar wrote: > > > (object_sizes_execute): Don't insert min/max for dynamic sizes. > > > > I'm worried about this. > > I'd say

Re: [PATCH 06/10] tree-object-size: Support dynamic sizes in conditions

2021-11-23 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 23, 2021 at 09:08:35PM +0530, Siddhesh Poyarekar wrote: > On 11/23/21 21:06, Siddhesh Poyarekar wrote: > > On 11/23/21 20:42, Jakub Jelinek wrote: > > > On Wed, Nov 10, 2021 at 12:31:32AM +0530, Siddhesh Poyarekar wrote: > > > > (object_sizes_execute): Don't insert min/max for dynam

Re: [PATCH 06/10] tree-object-size: Support dynamic sizes in conditions

2021-11-23 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 23, 2021 at 09:30:30PM +0530, Siddhesh Poyarekar wrote: > On 11/23/21 21:22, Jakub Jelinek wrote: > > Evaluating __bdos in both passes is undesirable, certainly for the same > > SSA_NAME, but even for different SSA_NAMEs, if everything is done in a > > single pass it can easily share te

Re: [PATCH] libcpp: Use [[likely]] conditionally

2021-11-23 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 23, 2021 at 09:34:04PM +0100, Christophe Lyon via Gcc-patches wrote: > > > This patch breaks the build when the host compiler is gcc-4.8.5, > > > because __has_cpp_attribute is not defined. > > Sigh. I'd like to move to a more recent prereq if we could. > > > > I don't know why we hav

[PATCH] c++: Return early in apply_late_template_attributes if there are no late attribs [PR101180]

2021-11-24 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 19, 2021 at 10:40:50AM -0500, Jason Merrill wrote: > > Shall we also change the function so that it doesn't call > > cplus_decl_attributes if late_attrs is NULL [...]? > > Please. Here it is. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2021-11-24 Jakub Jeli

[PATCH] bswap: Fix up symbolic merging for xor and plus [PR103376]

2021-11-24 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 22, 2021 at 08:39:42AM -, Roger Sayle wrote: > This patch implements PR tree-optimization/103345 to merge adjacent > loads when combined with addition or bitwise xor. The current code > in gimple-ssa-store-merging.c's find_bswap_or_nop alreay handles ior, > so that all that's requi

[PATCH] attribs: Fix ICEs on attributes starting with _ [PR103365]

2021-11-24 Thread Jakub Jelinek via Gcc-patches
Hi! As the patch shows, we have quite a few asserts that we don't call lookup_attribute etc. with attr_name that starts with an underscore, to make sure nobody is trying to call it with non-canonicalized attribute name like "__cold__" instead of "cold". We canonicalize only attributes that start w

Re: [PATCH] middle-end/103193 - avoid canonicalizing <= and >= to == for floats

2021-11-24 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 24, 2021 at 10:00:56AM +0100, Richard Biener via Gcc-patches wrote: > On Mon, Nov 15, 2021 at 12:16 PM Richard Biener via Gcc-patches > wrote: > > > > This avoids doing aforementioned canoncalization when -ftrapping-math > > is in effect and we honor NaNs. > > > > Bootstrapped and test

Re: [PATCH] attribs: Fix ICEs on attributes starting with _ [PR103365]

2021-11-24 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 24, 2021 at 12:53:02AM -0800, Andrew Pinski wrote: > Only one comment on the new testcases, you might want to add a > testcase for the option on the command line too. You're right, I've committed the patch with the following incremental diff in it: --- gcc/testsuite/c-c++-common/Wno-a

[committed] openmp: Fix up handling of kind(host) and kind(nohost) in ACCEL_COMPILERs [PR103384]

2021-11-24 Thread Jakub Jelinek via Gcc-patches
Hi! As the testcase shows, we weren't handling kind(host) and kind(nohost) properly in the ACCEL_COMPILERs, the code written in there is valid for the host compiler only, where if we are maybe offloaded, we defer resolution after IPA, otherwise return 0 for kind(nohost) and accept it for kind(host

[PATCH] c++, v2: Implement C++23 P2128R6 - Multidimensional subscript operator [PR102611]

2021-11-24 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 23, 2021 at 10:28:48PM -0500, Jason Merrill wrote: Thanks. > > + while (true) > > + { > > + cp_expr expr (NULL_TREE); > > + /* Parse the next assignment-expression. */ > > + if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) > > +

Re: [PATCH, v2] c++: Diagnose taking address of an immediate member function [PR102753]

2021-11-24 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 23, 2021 at 03:45:20PM -0500, Jason Merrill wrote: > > I've played a little bit with this (tried to do it at cp_fold time), but > > there are problems with that. > > cp_fold of course isn't a good spot for this because it can be called from > > fold_for_warn and at that point we don't k

[PATCH] c++: Fix up diagnostics about taking address of an immediate member function [PR102753]

2021-11-24 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 24, 2021 at 05:02:03PM +0100, Jakub Jelinek via Gcc-patches wrote: > Unfortunately, the location wrappers are optimized away before we get a > chance to use them in cp_fold_r. > So, on the following patch, we get the location right on PTRMEM_CSTs not > used inside of initi

[PATCH] c++, v2: Fix up diagnostics about taking address of an immediate member function [PR102753]

2021-11-24 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 24, 2021 at 05:15:51PM -0500, Jason Merrill wrote: > > +case CALL_EXPR: > > + if (tree fndecl = cp_get_callee_fndecl_nofold (stmt)) > > + if (DECL_IMMEDIATE_FUNCTION_P (fndecl) > > + && source_location_current_p (fndecl)) > > + { > > + tree fn = cp_get_callee

[PATCH] bswap: Improve perform_symbolic_merge [PR103376]

2021-11-24 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 24, 2021 at 09:45:16AM +0100, Richard Biener wrote: > > Thinking more about it, perhaps we could do more for BIT_XOR_EXPR. > > We could allow masked1 == masked2 case for it, but would need to > > do something different than the > > n->n = n1->n | n2->n; > > we do on all the bytes toge

[PATCH] match.pd: Fix up the recent bitmask_inv_cst_vector_p simplification [PR103417]

2021-11-25 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase is miscompiled since the r12-5489-g0888d6bbe97e10 changes. The simplification triggers on (x & 4294967040U) >= 0U and turns it into: x <= 255U which is incorrect, it should fold to 1 because unsigned >= 0U is always true and normally the /* Non-equality compare simplific

Re: [PATCH] match.pd: Fix up the recent bitmask_inv_cst_vector_p simplification [PR103417]

2021-11-25 Thread Jakub Jelinek via Gcc-patches
On Thu, Nov 25, 2021 at 08:23:50AM +, Tamar Christina wrote: > > But, IMNSHO while it isn't incorrect to handle le and gt there, it is > > unnecessary. Because (x & cst) <= 0U and (x & cst) > 0U should never > > appear, > > again in > > /* Non-equality compare simplifications from fold_binary

Re: [PATCH] bswap: Improve perform_symbolic_merge [PR103376]

2021-11-25 Thread Jakub Jelinek via Gcc-patches
On Thu, Nov 25, 2021 at 09:21:37AM +0100, Richard Biener wrote: > OK if you can add a testcase that exercises this "feature". Sure, that is easy. Here is what I've committed. f2 tests the x | x = x handling in it, f3 tests x | y = unknown instead of punting, f4 tests x ^ x = 0 and f5 tests x ^ y

Re: [PATCH] match.pd: Fix up the recent bitmask_inv_cst_vector_p simplification [PR103417]

2021-11-25 Thread Jakub Jelinek via Gcc-patches
On Thu, Nov 25, 2021 at 10:17:52AM +0100, Richard Biener wrote: > > Ah I see, sorry I didn't see that rule before, you're right that if this is > > ordered > > after it then they can be dropped. > > So the patch is OK, possibly with re-ordering the matches. I've committed the patch as is because

[PATCH] c++, v3: Fix up diagnostics about taking address of an immediate member function [PR102753]

2021-11-25 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 24, 2021 at 09:07:48PM -0500, Jason Merrill wrote: > > --- gcc/cp/tree.c.jj2021-11-24 15:05:23.371927735 +0100 > > +++ gcc/cp/tree.c 2021-11-24 17:09:05.348164621 +0100 > > @@ -5167,6 +5167,7 @@ make_ptrmem_cst (tree type, tree member) > > tree ptrmem_cst = make_node (PTRM

Re: [PATCH 3/4] libgcc: Split FDE search code from PT_GNU_EH_FRAME lookup

2021-11-25 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 23, 2021 at 06:56:14PM +0100, Florian Weimer wrote: > 8<--8< > This allows switching to a different implementation for > PT_GNU_EH_FRAME lookup in a subsequent commit. > > This moves some of the PT_GNU_EH_FRAME parsing out

[PATCH] libcpp: Fix up #__VA_OPT__ handling [PR103415]

2021-11-26 Thread Jakub Jelinek via Gcc-patches
Hi! stringify_arg uses pfile->u_buff to create the string literal. Unfortunately, paste_tokens -> _cpp_lex_direct -> lex_number -> _cpp_unaligned_alloc can in some cases use pfile->u_buff too, which results in losing everything prepared for the string literal until the token pasting. The followi

Re: [PATCH] libstdc++: Define std::__is_constant_evaluated() for internal use

2021-11-26 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 26, 2021 at 12:29:25PM +, Jonathan Wakely via Gcc-patches wrote: > + // Internal version of std::is_constant_evaluated() for C++11. > + // This can be used without checking if the compiler supports the built-in. > + constexpr inline bool > + __is_constant_evaluated() noexcept >

Re: [PATCH] libstdc++: Define std::__is_constant_evaluated() for internal use

2021-11-26 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 26, 2021 at 12:43:44PM +, Jonathan Wakely wrote: > > On Fri, Nov 26, 2021 at 12:29:25PM +, Jonathan Wakely via Gcc-patches > > wrote: > > > + // Internal version of std::is_constant_evaluated() for C++11. > > > + // This can be used without checking if the compiler supports t

Re: [PATCH v2] elf: Add _dl_find_object function

2021-11-26 Thread Jakub Jelinek via Gcc-patches
On Thu, Nov 25, 2021 at 09:35:14PM +0100, Florian Weimer wrote: > +struct dl_find_object > +{ > + unsigned long long int dlfo_flags; /* Currently 0. */ > + void *dlfo_map_start; /* Beginning of mapping containing > address. */ > + void *dlfo_map_end;/* End of mappi

Re: [PATCH 4/4] libgcc: Use _dl_find_eh_frame in _Unwind_Find_FDE

2021-11-26 Thread Jakub Jelinek via Gcc-patches
On Thu, Nov 25, 2021 at 09:42:53PM +0100, Florian Weimer wrote: > I've included a simplified version below, based on the _dl_find_object > patch for glibc. > > This is a bit difficult to test, but I ran a full toolchain bootstrap > with GCC + glibc on all glibc-supported architectures (except Hurd

Re: [PATCH v3 1/8] tree-object-size: Replace magic numbers with enums

2021-11-26 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 26, 2021 at 10:58:44AM +0530, Siddhesh Poyarekar wrote: > A simple cleanup to allow inserting dynamic size code more easily. > > gcc/ChangeLog: > > * tree-object-size.c: New enum. > (object_sizes, computed, addr_object_size, > compute_builtin_object_size, expr_object

Re: [PATCH v3 2/8] tree-object-size: Abstract object_sizes array

2021-11-26 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 26, 2021 at 10:58:45AM +0530, Siddhesh Poyarekar wrote: > Put all accesses to object_sizes behind functions so that we can add > dynamic capability more easily. > > gcc/ChangeLog: > > * tree-object-size.c (object_sizes_grow, object_sizes_release, > object_sizes_unknown_p,

Re: [PATCH v3 3/8] tree-object-size: Save sizes as trees and support negative offsets

2021-11-26 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 26, 2021 at 10:58:46AM +0530, Siddhesh Poyarekar wrote: > Transform tree-object-size to operate on tree objects instead of host > wide integers. This makes it easier to extend to dynamic expressions > for object sizes. > > The compute_builtin_object_size interface also now returns a t

Re: [PATCH v3 1/8] tree-object-size: Replace magic numbers with enums

2021-11-26 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 26, 2021 at 11:23:31PM +0530, Siddhesh Poyarekar wrote: > On 11/26/21 22:16, Jakub Jelinek wrote: > > On Fri, Nov 26, 2021 at 10:58:44AM +0530, Siddhesh Poyarekar wrote: > > > A simple cleanup to allow inserting dynamic size code more easily. > > > > > > gcc/ChangeLog: > > > > > > *

Re: [PATCH v3 3/8] tree-object-size: Save sizes as trees and support negative offsets

2021-11-26 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 26, 2021 at 11:29:41PM +0530, Siddhesh Poyarekar wrote: > > > The trees in object_sizes are each a TREE_VEC with the first element > > > being the bytes from the pointer to the end of the object and the > > > second, the size of the whole object. This allows analysis of negative > > >

[PATCH] bswap: Fix UB in find_bswap_or_nop_finalize [PR103435]

2021-11-27 Thread Jakub Jelinek via Gcc-patches
Hi! On gcc.c-torture/execute/pr103376.c in the following code we trigger UB in the compiler. n->range is 8 because it is 64-bit load and rsize is 0 because it is a bswap sequence with load and known to be 0: /* Find real size of result (highest non-zero byte). */ if (n->base_addr) for (t

[PATCH] c++: Small incremental tweak to source_location::current() folding

2021-11-27 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 24, 2021 at 11:42:28PM +0100, Jakub Jelinek via Gcc-patches wrote: > > I'm surprised the source_location::current handling would be needed; why do > > calls to that function live long enough for us to walk into the ADDR_EXPR > > here? Maybe we should fold i

[PATCH] x86: Fix up x86_{,64_}sh{l,r}d patterns [PR103431]

2021-11-27 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase is miscompiled because the x86_{,64_}sh{l,r}d patterns don't properly describe what the instructions do. One thing is left out, in particular that there is initial count &= 63 for sh{l,r}dq and initial count &= 31 for sh{l,r}d{l,w}. And another thing not described prop

[PATCH] libstdc++: Implement std::byteswap for C++23

2021-11-27 Thread Jakub Jelinek via Gcc-patches
Hi! This patch attempts to implement P1272R4 (except for the std::bit_cast changes in there which seem quite unrelated to this and will need to be fixed on the compiler side). While at least for GCC __builtin_bswap{16,32,64,128} should work fine in constant expressions, I wonder about other compil

[PATCH] libstdc++, v2: Implement std::byteswap for C++23

2021-11-27 Thread Jakub Jelinek via Gcc-patches
On Sat, Nov 27, 2021 at 12:59:56PM +0100, Jakub Jelinek via Gcc-patches wrote: > This patch attempts to implement P1272R4 (except for the std::bit_cast > changes in there which seem quite unrelated to this and will need to be > fixed on the compiler side). > While at least for GCC __b

Patch ping (Re: [PATCH] x86_64: Issue -Wpsabi warning about C++ zero width bitfield ABI changes [PR102024])

2021-11-29 Thread Jakub Jelinek via Gcc-patches
Hi! On Tue, Aug 31, 2021 at 10:05:58AM +0200, Jakub Jelinek via Gcc-patches wrote: > This is an incremental patch to > https://gcc.gnu.org/pipermail/gcc-patches/2021-August/578447.html > for x86_64 ABI. > For zero-width bitfields current GCC classify_argument does: >

[PATCH] libcpp: Enable P1949R7 for C++11 and up as it was a DR [PR100977]

2021-11-29 Thread Jakub Jelinek via Gcc-patches
Hi! Jonathan mentioned on IRC that: "Accept P1949R7 (C++ Identifier Syntax using Unicode Standard Annex 31) as a Defect Report and apply the changes therein to the C++ working paper." while I've actually implemented it only for -std={gnu,c}++{23,2b}. As the C++98 rules were significantly different

<    9   10   11   12   13   14   15   16   17   18   >