Re: [pushed] libsanitizer, Darwin, Bootstrap : Fix bootstrap on Darwin <= 15.

2020-10-19 Thread Martin Liška
On 10/18/20 10:00 PM, Iain Sandoe wrote: Hi Hello. The latest upstream merge for libsanitizer introduces code that makes use of some macro values that are not available in SDKs for versions of Darwin <= 15 (macOS 10.11). [TBH, I am a bit surprised by this, I was under the impression that up

Re: [PATCH] Libsanitizer: merge from master.

2020-10-19 Thread Martin Liška
On 10/19/20 9:04 AM, Tobias Burnus wrote: Hi Martin, Hello. this patch caused here a build fail: gcc-mainline/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp:490:39:  error: 'NT_X86_XSTATE' was not declared in this scope It turned out that the used GLIBC of the cross

Re: [PATCH] Libsanitizer: merge from master.

2020-10-19 Thread Tobias Burnus
On 10/19/20 9:11 AM, Martin Liška wrote: The change was introduced in the upstream commit: https://github.com/llvm/llvm-project/commit/5813fca1076089c835de737834955a0fe7eb3898 Please create a LLVM bugzilla entry where you can mention that Filled as https://bugs.llvm.org/show_bug.cgi?id=47896

PING – Re: [Patch] collect-utils.c, lto-wrapper + mkoffload: Improve -save-temps filename

2020-10-19 Thread Tobias Burnus
PING. Attached patch has a minor change: the renamed suffixes for nvptx as suggested by Tom (and for considency, 'ltrans.args' → 'ltrans_args'). OK? Tobias On 10/13/20 9:37 PM, Tobias Burnus wrote: This patch avoids putting some [...] files to /tmp/cc* when -save-temps has been specified. Fo

[PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-10-19 Thread Hongtao Liu via Gcc-patches
Hi: It's implemented as below: V setg (V v, int idx, T val) { V idxv = (V){idx, idx, idx, idx, idx, idx, idx, idx}; V valv = (V){val, val, val, val, val, val, val, val}; V mask = ((V){0, 1, 2, 3, 4, 5, 6, 7} == idxv); v = (v & ~mask) | (valv & mask); return v; } Bootstrap is fine, reg

[PATCH] Simplify comparison GIMPLE IL verification

2020-10-19 Thread Richard Biener
There's an old extra allowance for same-mode pointer comparison for which I don't see any good reason today where the only special-case of pointers in useless_type_conversion_p is that of function/method pointers vs. non-function/method pointers. Bootstrapped / tested on x86_64-unknown-linux-gnu,

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-10-19 Thread Richard Biener via Gcc-patches
On Mon, Oct 19, 2020 at 10:21 AM Hongtao Liu wrote: > > Hi: > It's implemented as below: > V setg (V v, int idx, T val) > > { > V idxv = (V){idx, idx, idx, idx, idx, idx, idx, idx}; > V valv = (V){val, val, val, val, val, val, val, val}; > V mask = ((V){0, 1, 2, 3, 4, 5, 6, 7} == idxv); >

[PATCH] tree-optimization/97466 - remove spurious assert

2020-10-19 Thread Richard Biener
This removes an assertion that was supposed to be only for temporary debugging. I've also re-indented the code which I missed as well. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. 2020-10-19 Richard Biener PR tree-optimization/97466 * tree-vect-slp.c (vect_g

RE: [PATCH PR94442] [AArch64] Redundant ldp/stp instructions emitted at -O3

2020-10-19 Thread xiezhiheng
> -Original Message- > From: Richard Sandiford [mailto:richard.sandif...@arm.com] > Sent: Tuesday, October 13, 2020 4:08 PM > To: xiezhiheng > Cc: Richard Biener ; gcc-patches@gcc.gnu.org > Subject: Re: [PATCH PR94442] [AArch64] Redundant ldp/stp instructions > emitted at -O3 > Cut ...

[PATCH] tree-optimization/97486 - avoid edge insertion in SLP vectorizing

2020-10-19 Thread Richard Biener
This avoids edge inserting and eventual splitting during BB SLP vectorization for now. Bootstrap / regtest pending on x86_64-unknown-linux-gnu. 2020-10-19 Richard Biener PR tree-optimization/97486 * tree-vect-slp.c (vect_slp_function): Split after stmts ending a BB.

[PATCH v2] RISC-V: Add configure option: --with-multilib-config to flexible config multi-lib settings.

2020-10-19 Thread Kito Cheng
- Able to configure complex multi-lib rule in configure time, without modify any in-tree source. - I was consider to implmenet this into `--with-multilib-list` option, but I am not sure who will using that with riscv*-*-elf*, so I decide to using another option name for that. - --with

Re: [PATCH] dwarf: Multi-register CFI address support

2020-10-19 Thread Jakub Jelinek via Gcc-patches
On Fri, Aug 28, 2020 at 01:04:51PM +0100, Andrew Stubbs wrote: > This patch introduces DWARF CFI support for architectures that require > multiple registers to hold pointers, such as the stack pointer, frame > pointer, and return address. The motivating case is the AMD GCN architecture > which has

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-10-19 Thread Hongtao Liu via Gcc-patches
On Mon, Oct 19, 2020 at 5:07 PM Richard Biener wrote: > > On Mon, Oct 19, 2020 at 10:21 AM Hongtao Liu wrote: > > > > Hi: > > It's implemented as below: > > V setg (V v, int idx, T val) > > > > { > > V idxv = (V){idx, idx, idx, idx, idx, idx, idx, idx}; > > V valv = (V){val, val, val, val,

[PATCH] Handle right shifts by zero in range-ops.

2020-10-19 Thread Aldy Hernandez via Gcc-patches
If the shift amount in operator_lshift::op1_range was zero, an invalid range of [1, 0] was being created. Pushed. gcc/ChangeLog: PR tree-optimization/97467 * range-op.cc (operator_lshift::op1_range): Handle shifts by 0. gcc/testsuite/ChangeLog: * gcc.dg/pr97467.c: New t

[Patch] testsuite: Avoid TCL errors when ASAN/TSAN/UBSAN is not available

2020-10-19 Thread Tobias Burnus
In a --disable-libsanitizer build, I see errors such as: g++.sum:ERROR: can't read "asan_saved_library_path": no such variable I believe the following patch is the right way to solve this. OK? Tobias - Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germa

Re: [Ada,FYI] revamp ada.numerics.aux

2020-10-19 Thread Andreas Schwab
/opt/gcc/gcc-20201019/Build/./gcc/xgcc -B/opt/gcc/gcc-20201019/Build/./gcc/ -B/usr/aarch64-suse-linux/bin/ -B/usr/aarch64-suse-linux/lib/ -isystem /usr/aarch64-suse-linux/include -isystem /usr/aarch64-suse-linux/sys-include -c -g -O2 -fPIC -W -Wall -gnatpg -nostdinc a-nallfl.ads -o a

[Ada] AI12-0170: Abstract subprogram calls in class-wide precond exprs

2020-10-19 Thread Pierre-Marie de Rodat
As specified in AI12-0170, calls to abstract subprograms within pre- and postcondition expressions of an abstract subprogram of type T are allowed in some cases, and references to a formal parameter of the controlling type are reinterpreted as though they had a (notional) nonabstract type NT that i

[Ada] Crash in expression function defined in protected object

2020-10-19 Thread Pierre-Marie de Rodat
The frontend crashes processing an expression function defined in the body of protected type that depends on discriminants. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch8.adb (Find_Direct_Name): Do not trust in the decoration of the Entity attribute in const

[Ada] Refine type of a local variable

2020-10-19 Thread Pierre-Marie de Rodat
Formal parameters, while iterated with First_Formal/Next_Formal, are entities and not just nodes. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch6.adb (Is_Direct_Deep_Call): Refine type from Node_Id to Entity_Id.diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_c

[Ada] Clarify current design of Errout wrt global variable usage

2020-10-19 Thread Pierre-Marie de Rodat
Current design of Errout mandates that the global variables defining its input state for issuing messages is restored when needed by multiple successive calls. This is surprising, and deserves proper documenting. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * errout.ads: Ad

[Ada] Clarify protection offered by preconditions on Ada.Text_IO units

2020-10-19 Thread Pierre-Marie de Rodat
These preconditions are used in particular for analysis by SPARK tools. It is thus important that they precisely convey which errors they allow detecting, in callers of Ada.Text_IO. Here, Layout_Error cannot be detected in a number of cases. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/a

[Ada] Remove useless initialization and refine type of a local variable

2020-10-19 Thread Pierre-Marie de Rodat
A local variable Param_Count is only accessed after being initialized to 1 and then is only incremented, so it only takes positive values. There is no complex control flow involved, so code checkers like CodePeer should have no trouble with the new code. Semantics is unaffected. Tested on x86_64-

[Ada] Private type unexpectedly visible

2020-10-19 Thread Pierre-Marie de Rodat
The frontend erroneously allows referencing a subtype declaration of a private type defined in the private part of a package. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch7.adb (Uninstall_Declarations): Uninstall the declaration of a subtype declaration defi

[Ada] Clean up support of square brackets

2020-10-19 Thread Pierre-Marie de Rodat
We cannot support at the same time [] aggregate notation and the [""] wide character notation, and there's no agreement yet on the proper syntax for [] aggregates, so resolve this temporarily by supporting only [] as an aggregate under -gnatX and only the wide chars legacy notation otherwise.

[Ada] Implement initialization of CUDA runtime

2020-10-19 Thread Pierre-Marie de Rodat
Executing CUDA kernels requires registering the kernel with the CUDA runtime beforehand. This is achieved by keeping track of procedures marked with CUDA_Global when analyzing packages and then registering each of the procedures with a fat binary created by the CUDA toolchain. Tested on x86_64-pc-

[Ada] No range check on fixed point to integer conversion

2020-10-19 Thread Pierre-Marie de Rodat
In some cases, range checks are missing when converting fixed point values to integer. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * checks.adb (Apply_Type_Conversion_Checks): Minor code clean up. * exp_ch4.adb (Discrete_Range_Check): Optimize range checks.

[Ada] Compiler abort on in_out function parameter with type invariant

2020-10-19 Thread Pierre-Marie de Rodat
Compiler crashes on a function call when function profile includes an in_out parameter, the parameter type has an inherited type invariant, and the actual is a view conversion to an ancestor type. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch6.adb (Add_View_Conversi

[Ada] Do not replace bounds for packed arrays that depend on discriminants

2020-10-19 Thread Pierre-Marie de Rodat
When generating constraint checks for types whose size depend on a discriminant, the frontend would generate a reference to the discriminant. This would result in a crash as the backend actually needs a reference to the object itself. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Reject use of Relaxed_Initialization on scalar/access param or result

2020-10-19 Thread Pierre-Marie de Rodat
The rules for Relaxed_Initialization have been tightened in SPARK RM, to reject meaningless uses. This is implemented here. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch13.adb (Analyze_Aspect_Relaxed_Initialization): Fix bug where a call to Error_Msg_N leads

[Ada] Remove excessive guards in building predicate functions

2020-10-19 Thread Pierre-Marie de Rodat
When calling routine Add_Call, which extends the type predicate function with a call to its ancestor's type predicate function, we checked that the ancestor type is present twice: in the Add_Call itself and at its only call site. Also, when the ancestor type has a predicate function, this routine

[Ada] Use alternate stack for signal handling on PowerPC/Linux

2020-10-19 Thread Pierre-Marie de Rodat
This is necessary because the stack checking method has been changed on this platform and now requires an alternate stack to propagate the stack overflow exception. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * Makefile.rtl (PowerPC/Linux): Use s-taspri__posix.ads instead

[Ada] Ada2020: matching parentheses and brackets

2020-10-19 Thread Pierre-Marie de Rodat
This patch fixes a bug where the compiler allowed mismatched brackets and parentheses in aggregates in -gnatX mode, as in (...] and [...). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * par-ch4.adb (P_Aggregate_Or_Paren_Expr): Require matching parens or brackets.

[Ada] Ada2020: AI12-0304 Put_Image attrs of lang-def types

2020-10-19 Thread Pierre-Marie de Rodat
This patch implements AI12-0304. In particular, Put_Image (and therefore 'Image) is provided for the containers and for unbounded strings. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_put_image.adb (Build_Elementary_Put_Image_Call): Use the base type to recogn

[Ada] AI12-0352: Early derivation and equality of untagged types

2020-10-19 Thread Pierre-Marie de Rodat
This AI clarifies that declaring a user-defined primitive equality operation for a record type T is illegal if it occurs after a type has been derived from T. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch6.adb (Check_Untagged_Equality): Check for AI12-0352.diff --gi

[Ada] ACATS 4.1R - Exception missed

2020-10-19 Thread Pierre-Marie de Rodat
This new ACATS test shows that we are not taking the subtype constraint into account when a Default_Value (via a box notation) is used in an aggregate, e.g: B_Rec : Bad_Rec := (Cnt => <>); Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_aggr.adb (Resolve_Record_Aggregate

[Ada] Ada2020: AI12-0304 Put_Image attrs of lang-def types

2020-10-19 Thread Pierre-Marie de Rodat
More work on this AI. Replace the Put_Image procedures in Ada.Containers.Indefinite_Vectors and Indefinite_Doubly_Linked_Lists with versions that call procedure Iterate, rather than using a "for ... of" loop, because the "for ... of" loop causes regressions. Tested on x86_64-pc-linux-gnu, committe

[Ada] Expanded names in ghost assignments

2020-10-19 Thread Pierre-Marie de Rodat
If the left-hand side of an assignment statement denotes a ghost entity, then the assignment statement is a ghost assignment. This patch fixes a bug in which ghost assignments were not recognized in some cases. In particular, for an assignment of the form "P.R.C := ...;", where P is a nonghost pack

[Ada] Missing check on array concatenation

2020-10-19 Thread Pierre-Marie de Rodat
The expansion of array concatenation disables checks too much, so reenable checks that are needed on the relevant internal subtype declaration. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Expand_Concatenate): Enable needed range checks.diff --git a/gcc/ada/e

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-10-19 Thread Richard Biener via Gcc-patches
On Mon, Oct 19, 2020 at 11:37 AM Hongtao Liu wrote: > > On Mon, Oct 19, 2020 at 5:07 PM Richard Biener > wrote: > > > > On Mon, Oct 19, 2020 at 10:21 AM Hongtao Liu wrote: > > > > > > Hi: > > > It's implemented as below: > > > V setg (V v, int idx, T val) > > > > > > { > > > V idxv = (V){idx

[Ada] Alternative display of multi-line messages for GNATprove

2020-10-19 Thread Pierre-Marie de Rodat
GNATprove now supports better display of multi-line messages on the command-line, where additional information for a given check is issued on separate lines that are clearly associated to the main message, both by prefixing such lines with space characters, and by separating a block of lines corres

[Ada] Ada_2020: Implement Key_Expression for named container aggregates

2020-10-19 Thread Pierre-Marie de Rodat
This patch implements the Key_Expression mechanism for container aggregates. A Key_Expression specifies a mapping between the loop variable in an iterated element association, and the value of the key to be used for insertion of successive components into the container being populated. The parser c

PING: Fwd: [PATCH] Refactor range handling of builtins in vr_values and ranger.

2020-10-19 Thread Aldy Hernandez via Gcc-patches
Forwarded Message Subject: [PATCH] Refactor range handling of builtins in vr_values and ranger. Date: Fri, 9 Oct 2020 14:32:05 +0200 From: Aldy Hernandez To: GCC patches , Jakub Jelinek CC: Andrew MacLeod , Aldy Hernandez Hi Jakub. As the last known expert in this are

[committed] doc: Add closing parenthesis to -ffat-lto-objects docs

2020-10-19 Thread Jonathan Wakely via Gcc-patches
gcc/ChangeLog: * doc/invoke.texi (OPptimize Options): Add missing closing parenthesis. Committed to trunk. commit 2c6565d168204be5e99d960af727447c02f3a13f Author: Jonathan Wakely Date: Mon Oct 19 10:24:03 2020 doc: Add closing parenthesis to -ffat-lto-objects docs

[PATCH] Gracefully handle right shifts larger than the precision.

2020-10-19 Thread Aldy Hernandez via Gcc-patches
The test is trying to shift by 129, but the underlying type is 128 bits. This causes low_bits to wrap around to -1 and things go bad really quick. Attached is my proposed solution. Andrew, do you have a preference on how to fix this? gcc/ChangeLog: PR tree-optimization/97488 * r

Re: [RFC] Remove include/precompiled/expc++.h

2020-10-19 Thread Jonathan Wakely via Gcc-patches
On 16/10/20 14:36 -0400, Ed Smith-Rowland wrote: On 10/15/20 7:21 PM, Jonathan Wakely wrote: Ed, In commit r232377 (aka 2be75957b80b640c0aac4356ab861edd0c2f1b9d in the git repo) you added a new header to the include/precompiled directory. That wasn't mentioned in the ChangeLog, wasn't in the pa

Re: [PATCH] Gracefully handle right shifts larger than the precision.

2020-10-19 Thread Jakub Jelinek via Gcc-patches
On Mon, Oct 19, 2020 at 12:36:24PM +0200, Aldy Hernandez via Gcc-patches wrote: > The test is trying to shift by 129, but the underlying type is 128 bits. > This causes low_bits to wrap around to -1 and things go bad really > quick. > > Attached is my proposed solution. > > Andrew, do you have a

Re: [PATCH] Gracefully handle right shifts larger than the precision.

2020-10-19 Thread Aldy Hernandez via Gcc-patches
On Mon, Oct 19, 2020 at 12:44 PM Jakub Jelinek wrote: > > On Mon, Oct 19, 2020 at 12:36:24PM +0200, Aldy Hernandez via Gcc-patches > wrote: > > The test is trying to shift by 129, but the underlying type is 128 bits. > > This causes low_bits to wrap around to -1 and things go bad really > > quick

Re: [PATCH] Gracefully handle right shifts larger than the precision.

2020-10-19 Thread Jakub Jelinek via Gcc-patches
On Mon, Oct 19, 2020 at 12:55:38PM +0200, Aldy Hernandez wrote: > > Shifts are undefined already when the shift count is equal to the precision. > > And arbitrarily choosing one of the values as the shift count seems risky to > > me (and even when used, the most natural would be truncating the exce

Re: /home/rguenther/Mail/tem

2020-10-19 Thread Richard Biener
> Sender: "Gcc-patches" > > > > @@ -122,7 +201,8 @@ public: > > > unsigned int idx = arg_idx (i); > > > gcc_checking_assert (arg_specified_p (i)); > > > return str[idx] == 'w' || str[idx] == 'W' > > > -|| str[idx] == 'R' || str[idx] == 'r'; > > > +|| str[idx] == 'r' || str[

Re: [Ada,FYI] revamp ada.numerics.aux

2020-10-19 Thread Alexandre Oliva
Hello, Andreas, On Oct 19, 2020, Andreas Schwab wrote: > -nostdinc a-nallfl.ads -o a-nallfl.o > a-nallfl.ads:48:13: warning: intrinsic binding type mismatch on return value > a-nallfl.ads:48:13: warning: intrinsic binding type mismatch on argument 1 > a-nallfl.ads:48:13: warning: profile of "Sin

[PATCH][pushed] IPA: fix one more UBSAN error

2020-10-19 Thread Martin Liška
It fixes: /home/marxin/Programming/gcc2/gcc/ipa-modref-tree.h:482:22: runtime error: load of value 255, which is not a valid value for type 'bool' #0 0x18e5df3 in modref_tree::merge(modref_tree*, vec*) /home/marxin/Programming/gcc2/gcc/ipa-modref-tree.h:482 #1 0x18dc180 in ipa_merge_mo

[PATCH][GCC-10 backport][COMMITTED] arm: Fix the warning -mcpu=cortex-m55 conflicting with -march=armv8.1-m.main (pr97327).

2020-10-19 Thread Srinath Parvathaneni via Gcc-patches
As this patch is approved here https://gcc.gnu.org/pipermail/gcc-patches/2020-October/556387.html , committed to releases/gcc-10 branch. This patch fixes (PR97327) the warning -mcpu=cortex-m55 conflicts with -march=armv8.1-m.main for -mfloat-abi=soft by adding the isa_bit_mve_float to clearing F

Re: [PATCH][pushed] IPA: fix one more UBSAN error

2020-10-19 Thread Jan Hubicka
> It fixes: > > /home/marxin/Programming/gcc2/gcc/ipa-modref-tree.h:482:22: runtime error: > load of value 255, which is not a valid value for type 'bool' > #0 0x18e5df3 in modref_tree::merge(modref_tree*, > vec*) > /home/marxin/Programming/gcc2/gcc/ipa-modref-tree.h:482 > #1 0x18dc180

Re: [PATCH] Gracefully handle right shifts larger than the precision.

2020-10-19 Thread Aldy Hernandez via Gcc-patches
On 10/19/20 1:01 PM, Jakub Jelinek wrote: On Mon, Oct 19, 2020 at 12:55:38PM +0200, Aldy Hernandez wrote: Shifts are undefined already when the shift count is equal to the precision. And arbitrarily choosing one of the values as the shift count seems risky to me (and even when used, the most

[PATCH] rs6000: correct BE vextract_fp_from_short[hl] vperm mask

2020-10-19 Thread David Edelsohn via Gcc-patches
xvcvhpsp instruction converts a vector of bfloat16 half precision to single precision. The intrinsics vextract_fp_from_shorth and vextract_fp_from_shortl select the high or low four elements of a half precision vector to convert. The intrinsics use vperm to select the appropri

Re: [PATCH] Gracefully handle right shifts larger than the precision.

2020-10-19 Thread Andrew MacLeod via Gcc-patches
On 10/19/20 6:36 AM, Aldy Hernandez wrote: The test is trying to shift by 129, but the underlying type is 128 bits. This causes low_bits to wrap around to -1 and things go bad really quick. Attached is my proposed solution. Andrew, do you have a preference on how to fix this? If we know we ar

Re: [PATCH] coroutines: Emit error for invalid promise return types [PR97438].

2020-10-19 Thread Nathan Sidwell
On 10/18/20 4:13 PM, Iain Sandoe wrote: Hi, At one stage, use cases were proposed for allowing the promise type to contain both return_value and return_void. That was not accepted into C++20; so we should reject it as per the PR. Tested on x86_64-darwin, x86_64-linux-gnu, OK for master? (alth

Re: [PATCH][middle-end][i386][version 3]Add -fzero-call-used-regs=[skip|used-gpr-arg|used-arg|all-arg|used-gpr|all-gpr|used|all]

2020-10-19 Thread Qing Zhao via Gcc-patches
Ping. Richard and Uros, Could you please review the patch and let me know whether it’s Okay for gcc 11? Thanks a lot. Qing > On Oct 6, 2020, at 9:01 AM, Qing Zhao via Gcc-patches > wrote: > > Hi, Gcc team, > > This is the 3rd version of the implementation of patch -fzero-call-used-regs. >

Re: [PATCH] Handle right shifts by zero in range-ops.

2020-10-19 Thread Andrew MacLeod via Gcc-patches
On 10/19/20 5:38 AM, Aldy Hernandez wrote: If the shift amount in operator_lshift::op1_range was zero, an invalid range of [1, 0] was being created. Should we do the same thing with rshift::op1_range? ie, return the LHS if the shift is 0 instead of trying to figure it out Pushed.

Re: [PATCH] Handle right shifts by zero in range-ops.

2020-10-19 Thread Jakub Jelinek via Gcc-patches
On Mon, Oct 19, 2020 at 10:19:48AM -0400, Andrew MacLeod via Gcc-patches wrote: > On 10/19/20 5:38 AM, Aldy Hernandez wrote: > > If the shift amount in operator_lshift::op1_range was zero, an invalid range > > of [1, 0] was being created. > > Should we do the same thing with rshift::op1_range?  

Re: [PATCH] arm: Fix multiple inheritance thunks for thumb-1 with -mpure-code

2020-10-19 Thread Richard Earnshaw via Gcc-patches
On 12/10/2020 08:59, Christophe Lyon via Gcc-patches wrote: > On Thu, 8 Oct 2020 at 11:58, Richard Earnshaw > wrote: >> >> On 08/10/2020 10:07, Christophe Lyon via Gcc-patches wrote: >>> On Tue, 6 Oct 2020 at 18:02, Richard Earnshaw >>> wrote: On 29/09/2020 20:50, Christophe Lyon via Gc

Re: [PATCH] cplxlower: Avoid a transform when looking at a default definition

2020-10-19 Thread Martin Jambor
Hi, On Sat, Oct 17 2020, Richard Biener wrote: > On October 16, 2020 8:46:39 PM GMT+02:00, Martin Jambor > wrote: >>Hi, >> >>in PR 97456, IPA-SRA triggers a bug in tree-complex.c where it >>converts: >> >> >> a$_M_value_21 = COMPLEX_EXPR ; >> >>(where ISRA.18 is IPA-SRA created PARM_DECL with

preprocessor: Fix non-fn fn-like macro at EOF [PR97471]

2020-10-19 Thread Nathan Sidwell
We inject EOF tokens between macro argument lists, but had confused/stale logic in the non-fn invocation. Renamed the magic 'eof' token, as it's now only used for macro argument termination. Always rewind the non-OPEN_PAREN token. libcpp/ * internal.h (struct cpp_reader): Rename

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-19 Thread Richard Sandiford via Gcc-patches
Hongtao Liu writes: > On Thu, Oct 15, 2020 at 8:38 PM Richard Sandiford > wrote: >> >> Hongtao Liu via Gcc-patches writes: >> > + /* Simplify vec_select of a subreg of X to just a vec_select of X >> > + when X has same component mode as vec_select. */ >> > + int l2; >> > +

[PATCH][RFC] SLP vectorize across PHI nodes

2020-10-19 Thread Richard Biener
This enables SLP build to handle PHI nodes in full, continuing the SLP build to non-backedges. For loop vectorization this enables outer loop vectorization of nested SLP cycles and for BB vectorization this enables vectorization of PHIs at CFG merges. Bootstrapped on x86_64-unknown-linux-gnu, tes

Re: [PATCH 1/2] [target 87767] Refactor AVX512 broadcast patterns with speical memory constraint.

2020-10-19 Thread Vladimir Makarov via Gcc-patches
On 2020-10-11 8:58 p.m., Hongtao Liu wrote: Hi: This is done in 2 steps: 1. Extend special memory constraint to handle non MEM_P cases, i.e. (vec_duplicate:V4SF (mem:SF (addr))) 2. Refactor implementation of *_bcst{_1,_2,_3} patterns. Add new predicate bcst_mem_operand and correspondin

Re: [PATCH v3] c, c++: Implement -Wsizeof-array-div [PR91741]

2020-10-19 Thread Marek Polacek via Gcc-patches
Ping. On Thu, Oct 08, 2020 at 11:04:40AM -0400, Marek Polacek via Gcc-patches wrote: > Ping for the C parts. > > On Mon, Sep 28, 2020 at 02:15:41PM -0400, Marek Polacek via Gcc-patches wrote: > > On Tue, Sep 22, 2020 at 04:07:41PM -0400, Jason Merrill wrote: > > > On 9/22/20 1:29 PM, Marek Polace

[Patch] testsuite: Avoid TCL errors when rootme or ASAN/TSAN/UBSAN is not available (was: Re: [Patch] testsuite: Avoid TCL errors when ASAN/TSAN/UBSAN is not available)

2020-10-19 Thread Tobias Burnus
Thomas Schwinge and Joseph convinced me that 'rootme' only makes sense for in-tree testing and, hence, does not need (or: should not) be set in site.exp. Thus, if it is not set, we have to check its existence before using it – to avoid similar TCL errors. Hence, I updated the patch to check also

Re: [PATCH] arm: Fix multiple inheritance thunks for thumb-1 with -mpure-code

2020-10-19 Thread Christophe Lyon via Gcc-patches
On Mon, 19 Oct 2020 at 16:39, Richard Earnshaw wrote: > > On 12/10/2020 08:59, Christophe Lyon via Gcc-patches wrote: > > On Thu, 8 Oct 2020 at 11:58, Richard Earnshaw > > wrote: > >> > >> On 08/10/2020 10:07, Christophe Lyon via Gcc-patches wrote: > >>> On Tue, 6 Oct 2020 at 18:02, Richard Earns

Re: [PATCH] IBM Z: Emit vector alignment hints for strlen

2020-10-19 Thread Andreas Krebbel via Gcc-patches
On 18.10.20 20:32, Stefan Schulze Frielinghaus wrote: > In case the vectorized version of strlen is used, then each memory > access inside the loop is 16-byte aligned. Thus add this kind of > information so that vector alignment hints can later on be emitted. > > Bootstrapped and regtested on IBM

[committed] libstdc++: Optimize container node-handle type for size

2020-10-19 Thread Jonathan Wakely via Gcc-patches
The use of std::optional in _Node_handle makes the node handle types for associative and unordered containers larger than necessary. It also greatly increases the amount of code included, as is quite large. The boolean flag that records whether the std::optional contains a value is redundant, bec

[committed] libstdc++: Use reserved name for C++20 attribute

2020-10-19 Thread Jonathan Wakely via Gcc-patches
Although the compiler supports the [[no_unique_address]] attribute, it's not a reserved name prior to C++20, so we can't use it in std::tuple. Use [[__no_unique_address__]] instead. libstdc++-v3/ChangeLog: * include/std/tuple (_Head_base): Use reserved form of __no_unique_address_

PING: [PATCH] Convert -Walloca pass to ranger.

2020-10-19 Thread Aldy Hernandez via Gcc-patches
Rebased on current trunk. FWIW, we finally get rid of the Walloca-6.c XFAIL. This has been a long time in coming: -/* { dg-xfail-if "Currently broken but Andrew's work should fix this" { *-*-* } } */ :-) OK? Aldy gcc/ChangeLog: * gimple-ssa-warn-alloca.c (enum alloca_type):

PING: [PATCH] Convert -Wrestrict pass to ranger.

2020-10-19 Thread Aldy Hernandez via Gcc-patches
Rebased on current trunk. There is one adjustment to a C++ test which now gives a false positive. After talking with Martin Sebor, we've concluded this is expected. There is no way to communicate that libstdc++ allocated objects are always less than PTRDIFF_MAX. OK? gcc/ChangeLog:

Re: [PATCH] openmp: Implement support for OMP_TARGET_OFFLOAD

2020-10-19 Thread Kwok Cheung Yeung
On 15/10/2020 12:02 pm, Jakub Jelinek wrote: On Thu, Oct 15, 2020 at 12:50:18PM +0200, Jakub Jelinek via Gcc-patches wrote: Ok, the first response indicates that both if (false) and omp_get_initial_device () are valid. Therefore, I think until omp_get_initial_device () value is changed, we want i

Re: [PATCH] openmp: Implement support for OMP_TARGET_OFFLOAD

2020-10-19 Thread Jakub Jelinek via Gcc-patches
On Mon, Oct 19, 2020 at 06:57:49PM +0100, Kwok Cheung Yeung wrote: > --- a/libgomp/env.c > +++ b/libgomp/env.c > @@ -75,6 +75,7 @@ struct gomp_task_icv gomp_global_icv = { > > unsigned long gomp_max_active_levels_var = gomp_supported_active_levels; > bool gomp_cancel_var = false; > +enum gomp_t

[r11-4070 Regression] FAIL: gcc.dg/pr97488.c (test for excess errors) on Linux/x86_64

2020-10-19 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 2d2f4ffc97a8510e72a99ee106159aeae2627a42 is the first bad commit commit 2d2f4ffc97a8510e72a99ee106159aeae2627a42 Author: Aldy Hernandez Date: Mon Oct 19 06:18:46 2020 -0400 Gracefully handle right shifts larger than the precision. caused FAIL: gcc.dg/pr97488.c (test for

Re: [PATCH 0/9] PowerPC: Patches to enable changing the long double default to IEEE 128-bit on little endian PowerPC 64-bit Linux systems

2020-10-19 Thread Michael Meissner via Gcc-patches
On Fri, Oct 16, 2020 at 02:14:04PM -0500, Segher Boessenkool wrote: > On Thu, Sep 24, 2020 at 04:20:36PM -0400, Michael Meissner wrote: > > This series of 9 patches is an attempt to gather together all of the patches > > that are needed to be able to configure and build a little endian 64-bit > > P

[r11-4072 Regression] FAIL: gcc.dg/cpp/endif.c (test for excess errors) on Linux/x86_64

2020-10-19 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 5abe05b4331250b6a7798ce87c0a82adc2bd70f3 is the first bad commit commit 5abe05b4331250b6a7798ce87c0a82adc2bd70f3 Author: Nathan Sidwell Date: Mon Oct 19 07:57:50 2020 -0700 preprocessor: Fix non-fn fn-like macro at EOF [PR97471] caused FAIL: gcc.dg/cpp/endif.c (test for

Re: [PATCH 1/9, revised] PowerPC: Map long double built-in functions if IEEE 128-bit long double.

2020-10-19 Thread Michael Meissner via Gcc-patches
On Fri, Oct 16, 2020 at 03:30:56PM -0500, Segher Boessenkool wrote: > On Fri, Oct 09, 2020 at 12:35:44AM -0400, Michael Meissner wrote: > > This patch is revised from the first version of the patch posted. > > In the future, please send a NEW series, in a NEW thread, when you have > a new series.

Re: [PATCH][middle-end][i386][version 3]Add -fzero-call-used-regs=[skip|used-gpr-arg|used-arg|all-arg|used-gpr|all-gpr|used|all]

2020-10-19 Thread Uros Bizjak via Gcc-patches
On Tue, Oct 6, 2020 at 4:02 PM Qing Zhao wrote: > > Hi, Gcc team, > > This is the 3rd version of the implementation of patch -fzero-call-used-regs. > > We will provide a new feature into GCC: > > Add > -fzero-call-used-regs=[skip|used-gpr-arg|used-arg|all-arg|used-gpr|all-gpr|used|all] > command

Re: Extend builtin fnspecs

2020-10-19 Thread Jan Hubicka
> > + /* True if memory reached by the argument is read. > > + Valid only if all loads are known. */ > > + bool > > + arg_read_p (unsigned int i) > > + { > > +unsigned int idx = arg_idx (i); > > +gcc_checking_assert (arg_specified_p (i)); > > +gcc_checking_assert (loads_known_p

[committed] libstdc++: Implement std::make_unique_for_overwrite

2020-10-19 Thread Jonathan Wakely via Gcc-patches
This is the std::unique_ptr part of P1020R1 (as amended by P1973R1) for C++20. The std::shared_ptr part still needs to be done. libstdc++-v3/ChangeLog: * include/bits/unique_ptr.h (make_unique_for_overwrite): Define for C++20. * testsuite/20_util/unique_ptr/creation/array_

Re: [PATCH 1/9, revised] PowerPC: Map long double built-in functions if IEEE 128-bit long double.

2020-10-19 Thread Michael Meissner via Gcc-patches
On Fri, Oct 16, 2020 at 03:30:56PM -0500, Segher Boessenkool wrote: > > + if (len >= printf_len > > + && strcmp (name + len - printf_len, "printf") == 0) > > Thew first test is unnecessary. Actually no, it is necessary. If you are looking at a builtin function with 4 or fewer charact

Re: [PATCH 0/9] PowerPC: Patches to enable changing the long double default to IEEE 128-bit on little endian PowerPC 64-bit Linux systems

2020-10-19 Thread Segher Boessenkool
On Mon, Oct 19, 2020 at 03:12:13PM -0400, Michael Meissner wrote: > On Fri, Oct 16, 2020 at 02:14:04PM -0500, Segher Boessenkool wrote: > > On Thu, Sep 24, 2020 at 04:20:36PM -0400, Michael Meissner wrote: > > > You will need a new enough GLIBC in order to do this configuration. > > > > What happe

Re: using ENUM::V

2020-10-19 Thread Jason Merrill via Gcc-patches
On 11/15/19 12:07 PM, Nathan Sidwell wrote: Jason, using ENUM::v is proving rather tricky, when the memberness of the enumerator and the context of the using decl differ. struct B {   enum E {e}; }; struct D { private:   using B::e; // ok   static inline const auto ok1 = e; // #1 accessibl

[PATCH 2/2] c++: Clean up constraint normalization routines

2020-10-19 Thread Patrick Palka via Gcc-patches
Many of the high-level constraint normalization routines allow the caller to supply the initial template arguments for normalization, but in practice all of the callers ultimately supply either NULL_TREE or a set of generic template arguments (*). Since the previous patch made NULL_TREE act like a

[PATCH 1/2] c++: Tolerate empty initial targs during normalization [PR97412]

2020-10-19 Thread Patrick Palka via Gcc-patches
When normalizing the constraint-expression of a nested-requirement, we pass NULL_TREE as the initial template arguments for normalization, but tsubst_argument_pack is not prepared to handle a NULL_TREE targ vector. This causes us to ICE when normalizing a variadic concept as part of a nested-requir

[patch] Use precision and sign to compare types for ranges

2020-10-19 Thread Andrew MacLeod via Gcc-patches
This fixes the second test case in pr 97360. There are a few places in the ranger where we sanity check the types of the ranges.  We were using types_compatible_p() but thats not really acccurate as gimple allows types which are useless_type_conversion_p() in only one direction, whereas types_

[PATCH] c++: Member template function lookup failure [PR94799]

2020-10-19 Thread Marek Polacek via Gcc-patches
My earlier patch for this PR, r11-86, broke pybind11. That patch changed cp_parser_class_name to also consider the object expression scope (parser->context->object_type) to fix parsing of p->template A::foo(); // consider p's scope too Here we reject b.operator typename B::type(); because

Re: [PATCH] libstdc++: use lt_host_flags for libstdc++.la

2020-10-19 Thread Jonathan Yong via Gcc-patches
On 9/16/20 1:16 PM, JonY wrote: For platforms like Mingw and Cygwin, cygwin refuses to generate the shared library without using -no-undefined. Attached patch makes sure the right flags are used, since libtool is already used to link libstdc++. Patch OK? Ping. OpenPGP_0x713B5FE29C145D45_an

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-10-19 Thread Hongtao Liu via Gcc-patches
On Mon, Oct 19, 2020 at 5:55 PM Richard Biener wrote: > > On Mon, Oct 19, 2020 at 11:37 AM Hongtao Liu wrote: > > > > On Mon, Oct 19, 2020 at 5:07 PM Richard Biener > > wrote: > > > > > > On Mon, Oct 19, 2020 at 10:21 AM Hongtao Liu wrote: > > > > > > > > Hi: > > > > It's implemented as below

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-19 Thread Hongtao Liu via Gcc-patches
On Mon, Oct 19, 2020 at 11:31 PM Richard Sandiford wrote: > > Hongtao Liu writes: > > On Thu, Oct 15, 2020 at 8:38 PM Richard Sandiford > > wrote: > >> > >> Hongtao Liu via Gcc-patches writes: > >> > + /* Simplify vec_select of a subreg of X to just a vec_select of X > >> > + whe

Re: [PATCH 1/2] [target 87767] Refactor AVX512 broadcast patterns with speical memory constraint.

2020-10-19 Thread Hongtao Liu via Gcc-patches
On Mon, Oct 19, 2020 at 11:38 PM Vladimir Makarov wrote: > > > On 2020-10-11 8:58 p.m., Hongtao Liu wrote: > > Hi: > >This is done in 2 steps: > >1. Extend special memory constraint to handle non MEM_P cases, i.e. > > (vec_duplicate:V4SF (mem:SF (addr))) > >2. Refactor implementation o

[PATCH] Add { target int128 } to gcc.dg/pr97488.c

2020-10-19 Thread Aldy Hernandez via Gcc-patches
__int128 does not exist on 32-bit targets. Pushed. gcc/testsuite/ChangeLog: * gcc.dg/pr97488.c: Add target int128 predicate. --- gcc/testsuite/gcc.dg/pr97488.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/pr97488.c b/gcc/testsuite/gcc.dg/pr974