[PATCH] c: Don't emit DEBUG_BEGIN_STMTs for K function argument declarations [PR105972]

2023-01-11 Thread Jakub Jelinek via Gcc-patches
Hi! K function parameter declarations are handled by calling recursively c_parser_declaration_or_fndef in a loop, where each such call will add_debug_begin_stmt at the start. Now, if the K function definition is not a nested function, building_stmt_list_p () is false and so we don't emit the

[PATCH] c++: Avoid incorrect shortening of divisions [PR108365]

2023-01-11 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase is miscompiled, because we shorten the division in a case where it should not be shortened. Divisions (and modulos) can be shortened if it is unsigned division/modulo, or if it is signed division/modulo where we can prove the dividend will not be the minimum signed

Re: [PING] Add '-Wno-complain-wrong-lang', and use it in 'gcc/testsuite/lib/target-supports.exp:check_compile' and elsewhere

2023-01-11 Thread Jakub Jelinek via Gcc-patches
Hi! On Wed, Jan 11, 2023 at 12:41:06PM +0100, Thomas Schwinge wrote: I think this should be reviewed by Joseph as option handling maintainer. > @@ -8896,6 +8897,13 @@ programs. > Warn for variables that might be changed by @code{longjmp} or > @code{vfork}. This warning is also enabled by

Re: [committed] testsuite: Add testcases from PR108292 and PR108308

2023-01-11 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 11, 2023 at 05:10:50AM -0500, NightStrike wrote: > Ok, then: > > /* { dg-do run { target { { ilp32 || lp64 } || llp64 } } } */ > > or even: > > /* { dg-do run { target { ! int16 } } } */ > > Though I'd point out that in your original message, you only cared > about the "important

[PATCH] c++: Avoid some false positive -Wfloat-conversion warnings with extended precision [PR108285]

2023-01-11 Thread Jakub Jelinek via Gcc-patches
Hi! On the following testcase trunk emits a false positive warning on ia32. convert_like_internal is there called with type of double and expr EXCESS_PRECISION_EXPR with float type with long double operand 2.L * (long double) x. Now, for the code generation we do the right thing, cp_convert to

Re: [committed] testsuite: Add testcases from PR108292 and PR108308

2023-01-11 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 11, 2023 at 04:27:11AM -0500, NightStrike wrote: > On Wed, Jan 11, 2023 at 4:07 AM Jakub Jelinek wrote: > > > > On Wed, Jan 11, 2023 at 03:58:40AM -0500, NightStrike wrote: > > > On Fri, Jan 6, 2023 at 4:56 AM Jakub Jelinek via Gcc-patches > > >

[PATCH] fortran: Fix up function types for realloc and sincos{,f,l} builtins [PR108349]

2023-01-11 Thread Jakub Jelinek via Gcc-patches
Hi! As reported in the PR, the FUNCTION_TYPE for __builtin_realloc in the Fortran FE is wrong since r0-100026-gb64fca63690ad which changed -  tmp = tree_cons (NULL_TREE, pvoid_type_node, void_list_node); -  tmp = tree_cons (NULL_TREE, size_type_node, tmp); -  ftype = build_function_type 

Re: [committed] testsuite: Add testcases from PR108292 and PR108308

2023-01-11 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 11, 2023 at 03:58:40AM -0500, NightStrike wrote: > On Fri, Jan 6, 2023 at 4:56 AM Jakub Jelinek via Gcc-patches > wrote: > > --- gcc/testsuite/gcc.dg/pr108308.c.jj 2023-01-06 10:43:45.793009294 +0100 > > +++ gcc/testsuite/gcc.dg/pr108308.c 2023-01-06 10:43:

Re: [RFC/PATCH] Remove the workaround for _Float128 precision [PR107299]

2023-01-10 Thread Jakub Jelinek via Gcc-patches
On Mon, Jan 09, 2023 at 10:21:52PM -0500, Michael Meissner wrote: > I had the patches to change the precision to 128, and I just ran them. C and > C++ do not seem to be bothered by changing the precision to 128 (once I got it > to build, etc.). But Fortran on the other hand does actually use the

Re: [PATCH] libgcc: Fix uninitialized RA signing on AArch64 [PR107678]

2023-01-10 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 10, 2023 at 04:33:59PM +, Wilco Dijkstra via Gcc-patches wrote: > @@ -1204,10 +1203,15 @@ execute_cfa_program (const unsigned char *insn_ptr, > case DW_CFA_GNU_window_save: > #if defined (__aarch64__) && !defined (__ILP32__) > /* This CFA is multiplexed with Sparc.

Re: [committed 1/3] libstdc++: Fix std::span constraint for sizeof(size_t) < sizeof(int) [PR108221]

2023-01-10 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 10, 2023 at 11:46:55AM +, Jonathan Wakely via Gcc-patches wrote: > Tested x86_64-linux. Pushed to trunk. > > -- >8 -- > > The default constructor has a constraint that is always false if > arithmetic on size_t values promotes to int. Rewrite the constraint > exactly as written in

Re: [PATCH, Modula2] PR-108142 Many empty directories created in the build directory

2023-01-10 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 10, 2023 at 11:16:28AM +0100, Richard Biener via Gcc-patches wrote: > > @@ -424,7 +388,7 @@ override PLUGINCFLAGS := $(filter-out > > -mdynamic-no-pic,$(PLUGINCFLAGS)) > > > > plugin/m2rte$(soext): $(srcdir)/m2/plugin/m2rte.cc > > $(GCC_HEADER_DEPENDENCIES_FOR_M2) \ > >

Patch ping

2023-01-09 Thread Jakub Jelinek via Gcc-patches
Hi! I'd like to ping a few pending patches: https://gcc.gnu.org/pipermail/gcc-patches/2022-November/606973.html - PR107465 - c-family: Fix up -Wsign-compare BIT_NOT_EXPR handling https://gcc.gnu.org/pipermail/gcc-patches/2022-November/607104.html - PR107465 - c-family: Incremental fix for

Re: [PATCH] expr.cc: avoid unexpected side effects in expand_expr_divmod optimization

2023-01-09 Thread Jakub Jelinek via Gcc-patches
On Mon, Jan 09, 2023 at 02:04:48PM +0100, Richard Biener via Gcc-patches wrote: > On Mon, Jan 9, 2023 at 10:58 AM Jakub Jelinek wrote: > > > > On Mon, Jan 09, 2023 at 09:05:26AM +0100, Richard Biener wrote: > > > On Wed, Jan 4, 2023 at 9:54 AM Jose E. Marchesi via Gcc-patches > > > wrote: > > >

[PATCH] calls: Fix up TYPE_NO_NAMED_ARGS_STDARG_P handling [PR107453]

2023-01-09 Thread Jakub Jelinek via Gcc-patches
Hi! On powerpc64le-linux, the following patch fixes -FAIL: gcc.dg/c2x-stdarg-4.c execution test -FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c -O0 execution test -FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c -O1 execution test -FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c -O2 execution test

[PATCH] c++: Only do maybe_init_list_as_range optimization if !processing_template_decl [PR108047]

2023-01-09 Thread Jakub Jelinek via Gcc-patches
Hi! The last testcase in this patch ICEs, because maybe_init_list_as_range -> maybe_init_list_as_array calls maybe_constant_init in: /* Don't do this if the conversion would be constant. */

Re: [PATCH] expr.cc: avoid unexpected side effects in expand_expr_divmod optimization

2023-01-09 Thread Jakub Jelinek via Gcc-patches
On Mon, Jan 09, 2023 at 09:05:26AM +0100, Richard Biener wrote: > On Wed, Jan 4, 2023 at 9:54 AM Jose E. Marchesi via Gcc-patches > wrote: > > > > > > ping. > > Would this be a good approach for fixing the issue? > > adding the is_libcall bit enlarges rtx_def by 8 bytes - there's no room for >

Re: [PATCH] Always define `WIN32_LEAN_AND_MEAN` before

2023-01-06 Thread Jakub Jelinek via Gcc-patches
On Sat, Jan 07, 2023 at 02:01:05AM +0800, LIU Hao via Gcc-patches wrote: > libgomp/ > > PR middle-end/108300 > * config/mingw32/proc.c: Define `WIN32_LEAN_AND_MEAN` before > . This change is ok for trunk. Jakub

[committed] testsuite: Add testcases from PR108292 and PR108308

2023-01-06 Thread Jakub Jelinek via Gcc-patches
Hi! These PRs were for now fixed by reversion of the r13-4977 patch, but so that the problems don't reappear during stage 1, I'm adding testcase coverage from those PRs. Tested on x86_64-linux -m32/-m64 before r13-5038 (where all tests FAIL) and after it (where they PASS), committed to trunk as

[committed] openmp: Fix up finish_omp_target_clauses [PR108286]

2023-01-05 Thread Jakub Jelinek via Gcc-patches
Hi! The comment in the loop says that we shouldn't add a map clause if such a clause exists already, but the loop was actually using OMP_CLAUSE_DECL on any clause. Target construct can have various clauses which don't have OMP_CLAUSE_DECL at all (e.g. nowait, device or if) or clause where it

Re: [PATCH] libstdc++: Export the __gnu_cxx::zoneinfo_dir_override symbol.

2023-01-04 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 04, 2023 at 03:17:42PM +, Jonathan Wakely via Gcc-patches wrote: > On Sat, 24 Dec 2022 at 12:21, Iain Sandoe wrote: > > > > > > > > > On 24 Dec 2022, at 12:12, Jonathan Wakely wrote: > > > > > > > > > > > > On Sat, 24 Dec 2022, 11:35 Iain Sandoe via Libstdc++, > > > wrote: > > >

[PATCH] c++: Error recovery in merge_default_template_args [PR108206]

2023-01-04 Thread Jakub Jelinek via Gcc-patches
Hi! We ICE on the following testcase during error recovery, both new_parm and old_parm are error_mark_node, the ICE is on error ("redefinition of default argument for %q+#D", new_parm); inform (DECL_SOURCE_LOCATION (old_parm), "original definition appeared

[PATCH] generic-match-head: Don't assume GENERIC folding is done only early [PR108237]

2023-01-04 Thread Jakub Jelinek via Gcc-patches
Hi! We ICE on the following testcase, because a valid V2DImode != comparison is folded into an unsupported V2DImode > comparison. The match.pd pattern which does this looks like: /* Transform comparisons of the form (X & Y) CMP 0 to X CMP2 Z where ~Y + 1 == pow2 and Z = ~Y. */ (for cst

[PATCH] vrp: Handle pointers in maybe_set_nonzero_bits [PR108253]

2023-01-04 Thread Jakub Jelinek via Gcc-patches
Hi! maybe_set_nonzero_bits calls set_nonzero_bits which asserts that var doesn't have pointer type. While we could punt for those cases, I think we can handle at least some easy cases. Earlier in maybe_set_nonzero_bits we've checked this is on (var & cst) == 0 edge and the other edge is

[PATCH] ubsan: Avoid narrowing of multiply for -fsanitize=signed-integer-overflow [PR108256]

2023-01-04 Thread Jakub Jelinek via Gcc-patches
Hi! We shouldn't narrow multiplications originally done in signed types, because the original multiplication might overflow but the narrowed one will be done in unsigned arithmetics and will never overflow. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2023-01-04 Jakub

Re: [PATCH] Various fixes for DWARF register size computation

2023-01-03 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 03, 2023 at 02:25:21PM +0100, Florian Weimer wrote: > > Though, I still wonder, because all of this is a hack for a single target > > - x86_64-linux -m64 - I think no other target has similar constant > > sizes, > > Really? That's odd. I've tried about 30 cross compilers I had

Re: [PATCH] Various fixes for DWARF register size computation

2023-01-03 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 03, 2023 at 12:15:23PM +0100, Florian Weimer wrote: > --- a/gcc/debug.h > +++ b/gcc/debug.h > @@ -245,7 +245,18 @@ extern const struct gcc_debug_hooks vmsdbg_debug_hooks; > > /* Dwarf2 frame information. */ > > -extern int dwarf_reg_sizes_constant (); > +/* Query size information

[PATCH] expr: Fix up store_expr into SUBREG_PROMOTED_* target [PR108264]

2023-01-03 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs on s390x-linux (e.g. with -march=z13). The problem is that target is (subreg/s/u:SI (reg/v:DI 66 [ x+-4 ]) 4) and we call convert_move from temp to the SUBREG_REG of that, expecting to extend the value properly. That works nicely if temp has some scalar integer

[PATCH] cfgrtl: Don't try to redirect asm goto to EXIT [PR108263]

2023-01-03 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase distilled from Linux kernel on ppc64le ICEs, because fixup_reorder_chain sees a bb with a single fallthru edge falling into a bb with simple return and decides to redirect that fallthru edge to EXIT. That is possible if the bb ending in the fallthru edge doesn't end

Re: [PATCH] Fix RTL simplifications of FFS, POPCOUNT and PARITY.

2023-01-02 Thread Jakub Jelinek via Gcc-patches
On Mon, Jan 02, 2023 at 09:20:33AM -0700, Jeff Law wrote: > > > In fact Raphael and I were about to submit a patch which takes advantage > > > of > > > that capability to improve the code slightly for risc-v. > > > > Just use a pattern with zero_extend or sign_extend around it or subreg of > >

Re: [PATCH] Fix RTL simplifications of FFS, POPCOUNT and PARITY.

2023-01-02 Thread Jakub Jelinek via Gcc-patches
On Mon, Jan 02, 2023 at 08:45:15AM -0700, Jeff Law via Gcc-patches wrote: > On 1/1/23 08:55, Roger Sayle wrote: > > In 2011, the rtl.texi documentation was updated to reflect that the > > modes of the RTX unary operations FFS, POPCOUNT and PARITY must > > match those of their operands.

[committed] tree-ssa-dom: can_infer_simple_equiv fixes [PR108068]

2022-12-23 Thread Jakub Jelinek via Gcc-patches
Hi! As reported in the PR, tree-ssa-dom.cc uses real_zerop call to find if a floating point constant is zero and it shouldn't try to infer equivalences from comparison against it if signed zeros are honored. This doesn't work at all for decimal types, because real_zerop always returns false for

[PATCH] phiopt, v2: Adjust instead of reset phires range

2022-12-22 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 22, 2022 at 08:46:33PM +0100, Aldy Hernandez wrote: > I haven't looked at your problem above, but have you tried using > int_range_max (or even int_range<2>) instead of value_range above? > > value_range is deprecated and uses the legacy anti-range business, > which has a really hard

Re: [PATCH] bootstrap/106482 - document minimal GCC version

2022-12-22 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 22, 2022 at 03:54:03PM +0100, Richard Biener wrote: > There's no explicit mention of what GCC compiler supports C++11 > and the cross compiler build requirement mentions GCC 4.8 but not > GCC 4.8.3 which is the earliest known version to not run into > C++11 implementation bugs. The

[PATCH] phiopt: Adjust instead of reset phires range

2022-12-22 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 22, 2022 at 01:09:21PM +0100, Aldy Hernandez wrote: > INTEGER_CST singleton and > > union that into the SSA_NAMEs range and then do set_range_info > > with the altered range I guess. > > > > Note that set_range_info is an intersect operation. It should really be > called

[PATCH] c, c++, cgraphunit: Prevent duplicated -Wunused-value warnings [PR108079]

2022-12-22 Thread Jakub Jelinek via Gcc-patches
Hi! On the following testcase, we warn with -Wunused-value twice, once in the FEs and later on cgraphunit again with slightly different wording. The following patch fixes that by registering a warning suppression in the FEs when we warn and not warning in cgraphunit anymore if that happened.

[PATCH] phiopt: Drop SSA_NAME_RANGE_INFO in maybe equal case [PR108166]

2022-12-22 Thread Jakub Jelinek via Gcc-patches
Hi! The following place in value_replacement is after proving that x == cst1 ? cst2 : x phi result is only used in a comparison with constant which doesn't care if it compares cst1 or cst2 and replaces it with x. The testcase is miscompiled because we have after the replacement incorrect range

[PATCH] cse: Fix up CSE const_anchor handling [PR108193]

2022-12-22 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs on aarch64, because insert_const_anchor inserts invalid CONST_INT into the CSE tables - 0x8000 for SImode. The second hunk of the patch fixes that, the first one is to avoid triggering undefined behavior at compile time during compute_const_anchors computations

Re: [PATCH V2 2/2] [x86] x86: Add a new option -mdaz-ftz to enable FTZ and DAZ flags in MXCSR.

2022-12-21 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 21, 2022 at 02:43:43PM -0800, H.J. Lu wrote: > > > > > > > Target RejectNegative > > > > > > > Set 80387 floating-point precision to 80-bit. > > > > > > > > > > > > > > +mdaz-ftz > > > > > > > +Target > > > > > > > > > > > > s/Target/Driver/ > > > > > Change to Driver and Got error

Re: [RFC/PATCH] Remove the workaround for _Float128 precision [PR107299]

2022-12-21 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 21, 2022 at 09:40:24PM +, Joseph Myers wrote: > On Wed, 21 Dec 2022, Segher Boessenkool wrote: > > > > --- a/gcc/tree.cc > > > +++ b/gcc/tree.cc > > > @@ -9442,15 +9442,6 @@ build_common_tree_nodes (bool signed_char) > > >if (!targetm.floatn_mode (n, extended).exists ()) >

Re: [PATCH V2 2/2] [x86] x86: Add a new option -mdaz-ftz to enable FTZ and DAZ flags in MXCSR.

2022-12-21 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 21, 2022 at 12:20:23PM -0800, H.J. Lu wrote: > On Mon, Dec 19, 2022 at 8:52 PM Hongtao Liu wrote: > > > > On Thu, Dec 15, 2022 at 3:45 PM Hongtao Liu wrote: > > > > > > On Thu, Dec 15, 2022 at 3:39 PM Jakub Jelinek wrote: > > > > > > > > On Thu, Dec 15, 2022 at 02:21:37PM +0800,

Re: [PATCH] aarch64: Fix plugin header install

2022-12-21 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 21, 2022 at 09:56:33AM +, Richard Sandiford wrote: > Jakub Jelinek writes: > > The r13-2943-g11a113d501ff64 made aarch64.h include > > aarch64-option-extensions.def, but that file isn't installed > > for building plugins. > > > > The following patch should fix that, ok for trunk

[committed] openmp: Don't try to destruct DECL_OMP_PRIVATIZED_MEMBER vars [PR108180]

2022-12-21 Thread Jakub Jelinek via Gcc-patches
Hi! DECL_OMP_PRIVATIZED_MEMBER vars are artificial vars with DECL_VALUE_EXPR of this->field used just during gimplification and omp lowering/expansion to privatize individual fields in methods when needed. As the following testcase shows, when not in templates, they were handled right, but in

[committed] modula2: Fix lto profiledbootstrap on powerpc64le-linux and s390x-linux [PR108153]

2022-12-21 Thread Jakub Jelinek via Gcc-patches
Hi! Lto profiledbootstrap was failing for me on {powerpc64le,s390x}-linux with modula 2 enabled, with: cc1gm2: internal compiler error: the location value is corrupt 0x11a3d2d m2assert_AssertLocation(unsigned int) ../../gcc/m2/gm2-gcc/m2assert.cc:40 0x11a3d2d

Re: [PATCH] fold-const: Treat fp conversion to a type with same mode as copy

2022-12-20 Thread Jakub Jelinek via Gcc-patches
On Mon, Dec 19, 2022 at 04:11:59PM +0800, Kewen.Lin wrote: > In function fold_convert_const_real_from_real, when the modes of > two types involved in fp conversion are the same, we can simply > take it as copy, rebuild with the exactly same TREE_REAL_CST and > the target type. It is more

[PATCH] aarch64: Fix plugin header install

2022-12-20 Thread Jakub Jelinek via Gcc-patches
Hi! The r13-2943-g11a113d501ff64 made aarch64.h include aarch64-option-extensions.def, but that file isn't installed for building plugins. The following patch should fix that, ok for trunk if it passes bootstrap/regtest + building plugin against it? 2022-12-20 Jakub Jelinek *

[PATCH] libstdc++: Don't call 4-5 argument to_chars with chars_format{}

2022-12-20 Thread Jakub Jelinek via Gcc-patches
Hi! In Fedora build libstdc++.so is built with assertions enabled and FAIL: 20_util/to_chars/float128_c++23.cc execution test was failing on all arches. The problem is that it called 5 argument version of to_chars with chars_format{}, which C++ says is invalid:

[committed] testsuite: Fix up pr64536.c for LLP64 targets [PR108151]

2022-12-19 Thread Jakub Jelinek via Gcc-patches
Hi! Apparently llp64 had 2 further warnings, fixed thusly. Committed as obvious after testing it with cross to mingw. 2022-12-19 Jakub Jelinek PR testsuite/108151 * gcc.dg/pr64536.c (bar): Cast long to __INTPTR_TYPE__ before casting to long *. ---

Re: [PATCH (pushed)] gcc-changelog: allow digit in component name

2022-12-19 Thread Jakub Jelinek via Gcc-patches
On Mon, Dec 19, 2022 at 02:40:29PM +0100, Martin Liška wrote: > contrib/ChangeLog: > > * gcc-changelog/git_commit.py: Allow digit in component name. > > contrib/ChangeLog: > > * gcc-changelog/test_email.py: Add new test. > * gcc-changelog/test_patches.txt: Add new patch. > ---

[committed] testsuite: Fix up pr64536.c for LLP64 targets [PR108151]

2022-12-19 Thread Jakub Jelinek via Gcc-patches
Hi! The test casts a pointer to long, which is ok for ilp32 and lp64 targets but not for llp64 targets. Nothing reads the values later, it is a link test, so all we care about is that it is the same cast on s390x-linux where it used to fail before the PR64536 fix, and that we don't warn about

[PATCH] modula2: Don't treat % in Modula 2 messages specially

2022-12-19 Thread Jakub Jelinek via Gcc-patches
Hi! On top of the just posted patch, this patch makes sure that any % chars in message strings aren't treated as format chars. None of these functions take variable number of arguments, so for most of format specifiers there is nowhere to take arguments from, it is true that a couple of format

[PATCH] modula2: Fix up bootstrap on powerpc64le-linux [PR108147]

2022-12-19 Thread Jakub Jelinek via Gcc-patches
Hi! As mentioned in the PR, bootstrap with m2 enabled currently fails on powerpc64le-linux, we get weird ICE after printing some diagnostics. The problem is that mc creates from *.def prototypes like extern void m2linemap_WarningAtf (m2linemap_location_t location, void * message); but the actual

[PATCH] c: Diagnose compound literals with function type [PR108043]

2022-12-19 Thread Jakub Jelinek via Gcc-patches
Hi! Both C99 and latest C2X say that compound literal shall have an object type (complete object type in the latter case) or array of unknown bound, so complit with function type is invalid. When the initializer had to be non-empty for such case, we used to diagnose it as incorrect initializer,

Re: [PATCH] fold-const: Treat fp conversion to a type with same mode as copy

2022-12-19 Thread Jakub Jelinek via Gcc-patches
On Mon, Dec 19, 2022 at 09:49:36AM +0100, Richard Biener wrote: > On Mon, Dec 19, 2022 at 9:12 AM Kewen.Lin wrote: > > In function fold_convert_const_real_from_real, when the modes of > > two types involved in fp conversion are the same, we can simply > > take it as copy, rebuild with the exactly

[committed] testsuite: Fix up pr107397.f90 test [PR107397]

2022-12-19 Thread Jakub Jelinek via Gcc-patches
On Sat, Dec 17, 2022 at 09:12:43AM -0800, Jerry D via Gcc-patches wrote: > The attached patch fixes a regression and is a patch from Steve. I have > regression tested it and provided a test case. It is fairly simple and I > will commit under the "simple" rule in a little while. > > Thanks Steve

[PATCH] hwasan: Add libhwasan_preinit.o

2022-12-16 Thread Jakub Jelinek via Gcc-patches
Hi! I've noticed an inconsistency with the other sanitizers. For -fsanitize={address,thread,leak} we link into binaries lib*san_preinit.o such that the -lasan, -ltsan or -llsan libraries are initialized as early as possible through .preinit_array. The hwasan library has the same thing, but we

[PATCH] loop-invariant: Split preheader edge if the preheader bb ends with jump [PR106751]

2022-12-16 Thread Jakub Jelinek via Gcc-patches
Hi! The RTL loop passes only request simple preheaders, but don't require fallthru preheaders, while move_invariant_reg apparently assumes the latter, that it can just append instruction(s) to the end of the preheader basic block. The following patch fixes that by splitting the preheader edge if

Re: [PATCH 2/3] Make __float128 use the _Float128 type, PR target/107299

2022-12-15 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 15, 2022 at 12:49:27PM -0600, Segher Boessenkool wrote: > On Thu, Dec 15, 2022 at 06:28:19PM +, Joseph Myers wrote: > > On Thu, 15 Dec 2022, Kewen.Lin via Gcc-patches wrote: > > > By investigating the exposed NaN failures, I found it's due to that it > > > wants > > > to convert

Re: [Patch] libgomp: Handle OpenMP's reverse offloads

2022-12-15 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 15, 2022 at 06:34:30PM +0100, Thomas Schwinge wrote: > --- a/libgomp/libgomp-plugin.c > +++ b/libgomp/libgomp-plugin.c > @@ -82,9 +82,9 @@ GOMP_PLUGIN_fatal (const char *msg, ...) > void > GOMP_PLUGIN_target_rev (uint64_t fn_ptr, uint64_t mapnum, uint64_t > devaddrs_ptr, >

Re: [PATCH] doc: Fix documentation for __builtin_dynamic_object_size

2022-12-15 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 15, 2022 at 12:21:21PM -0500, Siddhesh Poyarekar wrote: > On 2022-12-15 12:09, Jakub Jelinek wrote: > > > -This is a propagation pass similar to CCP that tries to remove calls > > > -to @code{__builtin_object_size} when the size of the object can be > > > -computed at compile-time.

Re: [PATCH] doc: Fix documentation for __builtin_dynamic_object_size

2022-12-15 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 15, 2022 at 11:58:14AM -0500, Siddhesh Poyarekar wrote: > --- a/gcc/doc/extend.texi > +++ b/gcc/doc/extend.texi > @@ -14291,8 +14291,14 @@ and GCC does not issue a warning. > @end deftypefn > > @deftypefn {Built-in Function}{size_t} __builtin_object_size (const void * > @var{ptr},

Re: [PATCH] middle-end/70090: Document that -fsanitize=object-size uses dynamic size

2022-12-15 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 15, 2022 at 11:33:40AM -0500, Siddhesh Poyarekar wrote: > Fix the documentation to say that object sizes are deduced using > __builtin_dynamic_object_size. > > gcc/ChangeLog: > > PR middle-end/70090 > * gcc/doc/invoke.texi (-fsanitize=object-size): Use >

Re: Make '-frust-incomplete-and-experimental-compiler-do-not-use' a 'Common' option (was: Rust front-end patches v4)

2022-12-15 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 15, 2022 at 04:01:33PM +0100, Thomas Schwinge wrote: > Or, options are applicable to just one front end, and can just be a no-op > for others, for shared-language compilation. For example, '-nostdinc++', > or '-frust-incomplete-and-experimental-compiler-do-not-use' need not >

Re: [PATCH] testsuite: Add support for Rust and Modula-2 effective target tests

2022-12-15 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 15, 2022 at 02:03:36PM +0100, Andreas Schwab wrote: > On Dez 15 2022, Jakub Jelinek via Gcc-rust wrote: > > > @@ -58,13 +60,15 @@ proc check_compile {basename type conten > > set options "" > > } > > switch -glob -- $contents { > > - "*/* Assembly*" { set src

[PATCH] testsuite: Add support for Rust and Modula-2 effective target tests

2022-12-15 Thread Jakub Jelinek via Gcc-patches
Hi! This patch allows magic comments also for Rust and Modula-2 for effective target tests etc. and fixes up the Assembly entry - it is a glob, so /* Assembly can match /whatever Assembly and not just /* Assembly. Tested on x86_64-linux with make check-g++ RUNTESTFLAGS=i386.exp=pr35513* and

Re: Make '-frust-incomplete-and-experimental-compiler-do-not-use' a 'Common' option (was: Rust front-end patches v4)

2022-12-15 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 15, 2022 at 12:39:38PM +0100, Iain Buclaw wrote: > For the gdc testsuite, those warnings arise because both language files > are compiled in the same invocation (dg-additional-sources "cpp11.cpp"), > so it ends up looking something like: > > gdc -fextern-std=c++11 testcpp11.d

Re: Make '-frust-incomplete-and-experimental-compiler-do-not-use' a 'Common' option (was: Rust front-end patches v4)

2022-12-15 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 15, 2022 at 11:14:10AM +0100, Thomas Schwinge wrote: > Hi! > > On 2022-12-15T08:53:13+0100, Richard Biener > wrote: > > On Wed, Dec 14, 2022 at 11:58 PM Thomas Schwinge > > wrote: > >> On 2022-12-13T14:40:36+0100, Arthur Cohen > >> wrote: > >> > We've also added one more commit,

[PATCH] into-ssa: Fix emitting debug stmts after asm goto [PR108095]

2022-12-14 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs, because ccp1 replaced s.0_1 = __asm__ goto("" : "=r" MEM[(T *)s.0_1] : : : "lab" lab); with __asm__ goto("" : "=r" s : : : "lab" lab); and because s is no longer addressable, we are rewriting it into ssa and want __asm__ goto("" : "=r" s_7 : : :

Re: [PATCH V2 2/2] [x86] x86: Add a new option -mdaz-ftz to enable FTZ and DAZ flags in MXCSR.

2022-12-14 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 15, 2022 at 02:21:37PM +0800, liuhongt via Gcc-patches wrote: > --- a/gcc/config/i386/i386.opt > +++ b/gcc/config/i386/i386.opt > @@ -420,6 +420,10 @@ mpc80 > Target RejectNegative > Set 80387 floating-point precision to 80-bit. > > +mdaz-ftz > +Target s/Target/Driver/ > +Set the

Re: [PATCH] contrib: add contrib to update-copyright.py script

2022-12-14 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 14, 2022 at 02:10:32PM +0100, Martin Liška wrote: > +class ContribFilder(GenericFilter): s/Filder/Filter/g ? > +def __init__ (self): > +GenericFilter.__init__ (self) > + > +self.skip_files |= set ([ > +# A different copyrights. > +

Re: [PATCH (pushed)] contrib: add copyright for my scripts

2022-12-14 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 14, 2022 at 02:07:38PM +0100, Martin Liška wrote: > Hi. > > The Copyright year will be updated automatically with a next patch > I'm going to send. Shouldn't that be added as 2016-2022 etc.? Jakub

Re: [PATCH 2/3] Make __float128 use the _Float128 type, PR target/107299

2022-12-14 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 14, 2022 at 06:11:26PM +0800, Kewen.Lin wrote: > > The hacks with different precisions of powerpc 128-bit floating types are > > very unfortunate, it is I assume because the middle-end asserted that scalar > > floating point types with different modes have different precision. > > We

Re: [PATCH 2/3] Make __float128 use the _Float128 type, PR target/107299

2022-12-14 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 14, 2022 at 04:46:07PM +0800, Kewen.Lin via Gcc-patches wrote: > on 2022/12/6 19:27, Kewen.Lin via Gcc-patches wrote: > > Hi Mike, > > > > Thanks for fixing this, some comments are inlined below. > > > > on 2022/11/2 10:42, Michael Meissner wrote: > >> This patch fixes the issue that

[PATCH] rust: Fix up aarch64-linux bootstrap [PR106072]

2022-12-14 Thread Jakub Jelinek via Gcc-patches
Hi! Bootstrap fails on aarch64-linux and some other arches with: .../gcc/rust/parse/rust-parse-impl.h: In member function ‘Rust::AST::ClosureParam Rust::Parser::parse_closure_param() [with ManagedTokenSource = Rust::Lexer]’: .../gcc/rust/parse/rust-parse-impl.h:8916:49: error: ‘this’ pointer

Re: [PATCH] [x86] x86: Don't add crtfastmath.o for -shared and add a new option -mdaz-ftz to enable FTZ and DAZ flags in MXCSR.

2022-12-14 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 14, 2022 at 09:08:02AM +0100, Richard Biener via Gcc-patches wrote: > On Wed, Dec 14, 2022 at 3:21 AM liuhongt via Gcc-patches > wrote: > > > > Don't add crtfastmath.o for -shared to avoid changing the MXCSR > > register when loading a shared library. crtfastmath.o will be used > >

Re: [PATCH] i386: Fix up *concat*_{5,6,7} patterns [PR108044]

2022-12-13 Thread Jakub Jelinek via Gcc-patches
On Tue, Dec 13, 2022 at 01:21:54PM +0100, Uros Bizjak wrote: > On Tue, Dec 13, 2022 at 10:20 AM Jakub Jelinek wrote: > > > > Hi! > > > > The following patch fixes 2 issues with the *concat3_5 and > > *concat3_{6,7} patterns. > > One is that if the destination is memory rather than register, then

Re: [PATCH] libstdc++: Update backtrace-rename.h

2022-12-13 Thread Jakub Jelinek via Gcc-patches
On Tue, Dec 13, 2022 at 09:50:23AM +, Jonathan Wakely via Gcc-patches wrote: > On Tue, 13 Dec 2022 at 09:44, Jakub Jelinek wrote: > > > > Hi! > > > > When writing the r13-4629 commit log I've realized that libsanitizer > > isn't the only place which nowadays renames libbacktrace symbols, > >

[PATCH] libstdc++: Update backtrace-rename.h

2022-12-13 Thread Jakub Jelinek via Gcc-patches
Hi! When writing the r13-4629 commit log I've realized that libsanitizer isn't the only place which nowadays renames libbacktrace symbols, libstdc++ does that too. Ok for trunk if this passes bootstrap/regtest? 2022-12-13 Jakub Jelinek * src/libbacktrace/backtrace-rename.h

[PATCH] c++, libstdc++: Add typeinfo for _Float{16,32,64,128,32x,64x} and __bf16 types [PR108075]

2022-12-13 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch adds typeinfos for the extended floating point types and _Float{32,64}x. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2022-12-13 Jakub Jelinek PR libstdc++/108075 gcc/cp/ * rtti.cc (emit_support_tinfos): Add pointers to

[committed] libsanitizer: Fix up libbacktrace build after r13-4547 [PR108072]

2022-12-13 Thread Jakub Jelinek via Gcc-patches
Hi! The r13-4547 commit added new non-static function to libbacktrace: backtrace_uncompress_zstd but for the libsanitizer use we need to rename it, so that it is in __asan_* namespace and doesn't clash with other copies of libbacktrace. Bootstrapped/regtested on x86_64-linux and i686-linux,

[PATCH] vect-patterns: Fix up vect_recog_rotate_pattern [PR108064]

2022-12-13 Thread Jakub Jelinek via Gcc-patches
Hi! Since vect_recog_rotate_pattern has been extended to work also on signed types in r13-1100 we miscompile the testcase below. vect_recog_rotate_pattern actually emits correct scalar code into the pattern def sequence (in particular cast to utype, doing the 2 shifts in utype so that the right

[PATCH] i386: Fix up *concat*_{5,6,7} patterns [PR108044]

2022-12-13 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch fixes 2 issues with the *concat3_5 and *concat3_{6,7} patterns. One is that if the destination is memory rather than register, then we can't use movabsq and so can't support all the possible immediates. I see 3 possibilities to fix that. One would be to use

Re: [PATCH] Backport gcc-12: jobserver FIFO support

2022-12-12 Thread Jakub Jelinek via Gcc-patches
On Mon, Dec 12, 2022 at 12:39:36PM +0100, Martin Liška wrote: > > I'm fine with backporting the whole > > series to GCC 12 but I wonder if earlier still maintained versions are also > > affected (noting that the series also addresses WPA streaming which is > > not part of the "troubles" here). >

[PATCH] ivopts: Fix IP_END handling for asm goto [PR107997]

2022-12-10 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs, because the latch bb ends with asm goto which has both fallthrough to the header and one or more labels in the header too. In that case there is just a single edge out of the latch block, but still the asm goto is stmt_ends_bb_p statement, yet ivopts decides to

[PATCH] c++: Ensure !!var is not an lvalue [PR107065]

2022-12-10 Thread Jakub Jelinek via Gcc-patches
Hi! The TRUTH_NOT_EXPR case in cp_build_unary_op is one of the spots where we somewhat fold immediately using invert_truthvalue_loc. I've tried using return build1_loc (location, TRUTH_NOT_EXPR, boolean_type_node, arg); in there instead, but unfortunately that regressed

Re: [Patch] libgomp: Handle OpenMP's reverse offloads

2022-12-10 Thread Jakub Jelinek via Gcc-patches
On Sat, Dec 10, 2022 at 09:11:24AM +0100, Tobias Burnus wrote: > It is used as 'typedef struct reverse_splay_tree_node_s > *reverse_splay_tree_node;' in > > struct target_mem_desc { > > reverse_splay_tree_node rev_array; > } > > but also as > > struct gomp_device_descr > { > ... >

Re: [Patch] Fortran/OpenMP: align/allocator modifiers to the allocate clause

2022-12-09 Thread Jakub Jelinek via Gcc-patches
On Fri, Dec 09, 2022 at 09:14:55PM +0100, Tobias Burnus wrote: > Implementing the 5.1 syntax inside the 'allocate' clause. That's a > fallout of working on something else... > > OK for mainline? > > Tobias > - > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße

Patch ping

2022-12-09 Thread Jakub Jelinek via Gcc-patches
Hi! I'd like to ping a few pending patches: https://gcc.gnu.org/pipermail/gcc-patches/2022-November/606973.html - PR107465 - c-family: Fix up -Wsign-compare BIT_NOT_EXPR handling https://gcc.gnu.org/pipermail/gcc-patches/2022-November/607104.html - PR107465 - c-family: Incremental fix for

Re: [Patch] libgomp: Handle OpenMP's reverse offloads

2022-12-09 Thread Jakub Jelinek via Gcc-patches
On Tue, Dec 06, 2022 at 08:45:07AM +0100, Tobias Burnus wrote: > 32bit vs. 64bit: libgomp itself is compiled with both -m32 and -m64; however, > nvptx and gcn requires -m64 on the device side and assume that the device > pointers are representable on the host (i.e. all are 64bit). The new code >

Re: [PATCH] i386: fix assert (__builtin_cpu_supports ("x86-64") >= 0)

2022-12-09 Thread Jakub Jelinek via Gcc-patches
On Fri, Dec 09, 2022 at 10:18:34AM +0100, Martin Liška wrote: > I'm going to push the revision. > > What exactly do you mean by random? I just know there are differences in > between > x86 and ppc: > > int __builtin_cpu_supports(const char *feature) > This function returns a positive integer if

Re: [PATCH v3] docs: Suggest options to improve ASAN stack traces

2022-12-08 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 08, 2022 at 05:56:41PM -0500, Marek Polacek wrote: > Can't hurt. Here's an updated patch. > > -- >8 -- > I got a complaint that while Clang docs suggest options that improve > the quality of the backtraces ASAN prints (cf. >

Re: [PATCH v2] docs: Suggest options to improve ASAN stack traces

2022-12-08 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 08, 2022 at 09:34:34AM -0500, Marek Polacek wrote: > I got a complaint that while Clang docs suggest options that improve > the quality of the backtraces ASAN prints (cf. > ), our docs > don't say anything to that effect. This

Re: [PATCH] docs: Suggest options to improve ASAN stack traces

2022-12-08 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 08, 2022 at 09:11:54AM -0500, Marek Polacek via Gcc-patches wrote: > On Thu, Dec 08, 2022 at 08:25:26AM +0100, Florian Weimer wrote: > > * Marek Polacek via Gcc-patches: > > > > > diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > > > index 726392409b6..2de14466dd3 100644 > > >

Re: [PATCH] expr.cc: avoid unexpected side effects in expand_expr_divmod optimization

2022-12-08 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 08, 2022 at 02:02:36PM +0100, Jose E. Marchesi wrote: > So, I guess the right fix would be to call assemble_external_libcall > during final? The `.global FOO' directive would be generated > immediately before the call sequence, but I guess that would be ok. During final only if all

Re: [PATCH] expr.cc: avoid unexpected side effects in expand_expr_divmod optimization

2022-12-08 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 08, 2022 at 11:59:44AM +0100, Jose E. Marchesi via Gcc-patches wrote: > gcc/ChangeLog > > * expr.cc (expand_expr_divmod): Avoid side-effects of trying > sequences involving funcalls in optimization. That looks wrong. The globals for mentioned calls just shouldn't be

Re: [PATCH 02/17] libgomp: pinned memory

2022-12-08 Thread Jakub Jelinek via Gcc-patches
On Thu, Jul 07, 2022 at 11:34:33AM +0100, Andrew Stubbs wrote: > > Implement the OpenMP pinned memory trait on Linux hosts using the mlock > syscall. Pinned allocations are performed using mmap, not malloc, to ensure > that they can be unpinned safely when freed. As I said before, I think the

Re: [PATCH 01/17] libgomp, nvptx: low-latency memory allocator

2022-12-08 Thread Jakub Jelinek via Gcc-patches
On Thu, Jul 07, 2022 at 11:34:32AM +0100, Andrew Stubbs wrote: > libgomp/ChangeLog: > > * allocator.c (MEMSPACE_ALLOC): New macro. > (MEMSPACE_CALLOC): New macro. > (MEMSPACE_REALLOC): New macro. > (MEMSPACE_FREE): New macro. > (dynamic_smem_size): New constants. >

[PATCH] cfgbuild: Fix DEBUG_INSN handling in find_bb_boundaries [PR106719]

2022-12-08 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase FAILs on aarch64-linux. We have some atomic instruction followed by 2 DEBUG_INSNs (if -g only of course) followed by NOTE_INSN_EPILOGUE_BEG followed by some USE insn. Now, split3 pass replaces the atomic instruction with a code sequence which ends with a conditional

[PATCH] i386: Add *concat3_{5,6,7} patterns [PR107627]

2022-12-08 Thread Jakub Jelinek via Gcc-patches
Hi! On Thu, Dec 01, 2022 at 09:09:51AM +0100, Jakub Jelinek via Gcc-patches wrote: > BTW, I wonder if we couldn't add additional patterns which would catch > the case where one of the operands is constant. The following patch does add those. The difference with the patch on the 2 tes

Re: [PATCH] RISC-V: Produce better code with complex constants [PR95632] [PR106602]

2022-12-07 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 07, 2022 at 05:55:17PM -0300, Raphael Moreira Zinsly wrote: > Due to RISC-V limitations on operations with big constants combine > is failing to match such operations and is not being able to > produce optimal code as it keeps splitting them. By pretending we > can do those operations

<    4   5   6   7   8   9   10   11   12   13   >