[PATCH PR95199] vect: Remove extra variable created for memory reference

2020-06-11 Thread zhoukaipeng (A)
Hi, This is a fix for pr95199. In vectorization, vinfo->ivexpr_map is supposed to catch those "IV base and/or step expressions". Just call cse_and_gimplify_to_preheader to handle gathering/scattering to avoid the extra variable. Bootstrap and tested on aarch64/x86_64 Linux platform. No new reg

[PATCH] middle-end: Parity folding optimizations.

2020-06-11 Thread Roger Sayle
This patch implements several constant folding optimizations for __builtin_parity and friends. We canonicalize popcount(x)&1 as parity(x) in gimple, and potentially convert back again when we expand to RTL. parity(~x) is simplified to parity(x), which is true for all integer modes with an

[PATCH, RS6000 PR target/94954] Fix wrong codegen for vec_pack_to_short_fp32() builtin

2020-06-11 Thread will schmidt via Gcc-patches
Hi, Fix codegen implementation for the builtin vec_pack_to_short_fp32. Regtests are underway against powerpc64 (power7be,power8le,power9le). (this is a power9 builtin, so should be a noop for most of those). OK for trunk and backports? Thanks -Will [gcc] targ

Re: [PATCH] Optimize multiplication for V8QI,V16QI,V32QI under TARGET_AVX512BW [target/95488]

2020-06-11 Thread Jeff Law via Gcc-patches
On Fri, 2020-06-05 at 13:46 +0800, Hongtao Liu via Gcc-patches wrote: > Hi: > > +/* Optimize vector MUL generation for V8QI, V16QI and V32QI > + under TARGET_AVX512BW. i.e. for v16qi a * b, it has > + > + vpmovzxbw ymm2, xmm0 > + vpmovzxbw ymm3, xmm1 > + vpmullw ymm4, ymm2, ymm3 > + vp

Re: [PATCH] x86: Add UNSPECV_PATCHABLE_AREA

2020-06-11 Thread Jeff Law via Gcc-patches
On Sat, 2020-05-02 at 04:55 -0700, H.J. Lu wrote: > Currently patchable area is at the wrong place. It is placed immediately > after function label, before both .cfi_startproc and ENDBR. This patch > adds UNSPECV_PATCHABLE_AREA for pseudo patchable area instruction and > changes ENDBR insertion p

Re: collect2.exe errors not pruned

2020-06-11 Thread Jeff Law via Gcc-patches
On Wed, 2020-06-10 at 23:41 -0300, Alexandre Oliva wrote: > On May 26, 2020, Alexandre Oliva wrote: > > > On May 19, 2020, Joseph Myers wrote: > > > Allowing a missing executable name is reasonable enough, but I was > > > actually thinking that the messages should print "gcc" or whatever > > >

Re: [PATCH] Fix few -Wformat-diag warnings.

2020-06-11 Thread Jeff Law via Gcc-patches
On Thu, 2020-06-11 at 10:43 +0200, Martin Liška wrote: > Ready for master? > > Thanks, > Martin > > gcc/ChangeLog: > > * cgraphunit.c (process_symver_attribute): Wrap weakref keyword. > * dbgcnt.c (dbg_cnt_set_limit_by_index): Do not print extra new > line. > * lto-wrappe

Re: [PATCH 2/7 V3] rs6000: lenload/lenstore optab support

2020-06-11 Thread Kewen.Lin via Gcc-patches
Hi Segher, on 2020/6/12 上午6:55, Segher Boessenkool wrote: > Hi! > > On Wed, Jun 10, 2020 at 08:39:19PM +0800, Kewen.Lin wrote: >> +;; Define optab for vector access with length vectorization exploitation. >> +(define_expand "lenload" >> + [(match_operand:VEC_A 0 "vlogical_operand") >> + (match

RE: [PATCH PR95570] vect: ICE: Segmentation fault in vect_loop_versioning

2020-06-11 Thread Yangfei (Felix)
Hi, > -Original Message- > From: Richard Sandiford [mailto:richard.sandif...@arm.com] > Sent: Friday, June 12, 2020 2:29 AM > To: Yangfei (Felix) > Cc: gcc-patches@gcc.gnu.org > Subject: Re: [PATCH PR95570] vect: ICE: Segmentation fault in > vect_loop_versioning > > "Yangfei (Felix)" wr

Re: [PATCH] guard against calls with fewer arguments than the function type implies (PR 95581)

2020-06-11 Thread Segher Boessenkool
On Tue, Jun 09, 2020 at 09:51:12AM -0600, Martin Sebor wrote: > >I think the backend declaration is wrong, the function only takes > >a void * argument and returns a long. > > Thanks. In his comment on the bug Segher (CC'd) points to > the internals manual that documents the function: > > https:

Re: [PATCH] Port libgccjit to Windows.

2020-06-11 Thread JonY via Gcc-patches
On 6/11/20 10:02 PM, Nicolas Bértolo wrote: > Hi, > > On 6/7/20 11:12 PM, JonY wrote: >> Ideally, libtool is used so we get libgccjit-0.dll, unfortunately it is >> not. So the only way to ABI version the dll would be to use Unix style >> soname to mark when an ABI has changed. > > I tried generat

Re: [PATCH v1 1/2][PPC64] [PR88877]

2020-06-11 Thread Segher Boessenkool
On Tue, Jun 09, 2020 at 02:29:13PM -0600, Jeff Law wrote: > On Sun, 2020-05-24 at 11:22 -0500, Segher Boessenkool wrote: > > OTOH, you don't need to name Tuple at all... It should not *have* a > > constructor, since you declared it as class... But you can just use > > std::tuple here? > > > > >

Re: [PATCH 2/7 V3] rs6000: lenload/lenstore optab support

2020-06-11 Thread Segher Boessenkool
Hi! On Wed, Jun 10, 2020 at 08:39:19PM +0800, Kewen.Lin wrote: > +;; Define optab for vector access with length vectorization exploitation. > +(define_expand "lenload" > + [(match_operand:VEC_A 0 "vlogical_operand") > + (match_operand:VEC_A 1 "memory_operand") > + (match_operand:QI 2 "int_reg

Re: [PATCH] c++: Don't allow designated initializers with non-aggregates [PR95369]

2020-06-11 Thread Jason Merrill via Gcc-patches
On 6/11/20 5:28 PM, Marek Polacek wrote: On Thu, Jun 11, 2020 at 03:51:29PM -0400, Jason Merrill wrote: On 6/9/20 2:17 PM, Marek Polacek wrote: Another part of 95369 is that we accept designated initializers with non-aggregate types. That seems to be wrong since they're part of aggregate initi

Re: [PATCH 1/2] c++: Improve access checking inside templates [PR41437]

2020-06-11 Thread Jason Merrill via Gcc-patches
On 6/5/20 5:16 PM, Patrick Palka wrote: This patch generalizes our existing functionality for deferring access checking of typedefs when parsing a function or class template to now defer all kinds of access checks until template instantiation time, including member function and member object acce

Re: [PATCH] Port libgccjit to Windows.

2020-06-11 Thread Nicolas Bértolo via Gcc-patches
Hi, On 6/7/20 11:12 PM, JonY wrote: > Ideally, libtool is used so we get libgccjit-0.dll, unfortunately it is > not. So the only way to ABI version the dll would be to use Unix style > soname to mark when an ABI has changed. I tried generating the library as libgccjit-0.dll and naming its import

Re: [PATCH] c++: Don't allow designated initializers with non-aggregates [PR95369]

2020-06-11 Thread Marek Polacek via Gcc-patches
On Thu, Jun 11, 2020 at 03:51:29PM -0400, Jason Merrill wrote: > On 6/9/20 2:17 PM, Marek Polacek wrote: > > Another part of 95369 is that we accept designated initializers with > > non-aggregate types. That seems to be wrong since they're part of > > aggregate initialization. clang/icc also reje

Re: [PATCH] avoid false positives due to compute_objsize (PR 95353)

2020-06-11 Thread Rainer Orth
Hi Martin, > The compute_objsize() function started out as a thin wrapper around > compute_builtin_object_size(), but over time developed its own > features to compensate for the other function's limitations (such > as its inability to work with ranges). The interaction of these > features and th

Re: [PATCH] underline null argument in -Wnonnull (PR c++/86568)

2020-06-11 Thread Jason Merrill via Gcc-patches
On 6/5/20 3:41 PM, Martin Sebor wrote: + location_t loc += EXPR_HAS_LOCATION (param) ? EXPR_LOCATION (param) : pctx->loc; This could be EXPR_LOC_OR_LOC (param, pctx->loc) + location_t loc = (EXPR_HAS_LOCATION (ptr) + ? EXPR_LOCATION (ptr) : EXPR_LOCATION

Can we use safe-ctype.h in a library?

2020-06-11 Thread Thomas Koenig via Gcc-patches
Hi, I am currently looking at making libgfortran use the TOUPPER et al functions from ctype-safe.h. Adding this in a gfortran header results in lots of Gcc/trunk-bin/x86_64-pc-linux-gnu/./libgfortran/.libs/libgfortran.so: undefined reference to `_sch_istable' errors. So, can we use this, or

[PATCH] coroutines: Copy attributes to the outlined functions [PR95518]

2020-06-11 Thread Iain Sandoe
Hi We had omitted the copying of function attributes (including the 'used' status). Mark the outlined functions as artificial, since they are; some diagnostic processing tests this. tested on Linux and Darwin, OK for master? 10.2? thanks Iain gcc/cp/ChangeLog: PR c++/95518 * co

Re: [PATCH] c++: Don't allow designated initializers with non-aggregates [PR95369]

2020-06-11 Thread Jason Merrill via Gcc-patches
On 6/9/20 2:17 PM, Marek Polacek wrote: Another part of 95369 is that we accept designated initializers with non-aggregate types. That seems to be wrong since they're part of aggregate initialization. clang/icc also reject it. (Un)fortunately there are multiple contexts where we can use design

[PATCH] coroutines: Update handling and failure for g-r-o-o-a-f [PR95505]

2020-06-11 Thread Iain Sandoe
Hi, The reason that the code fails is that (by a somewhat complex implied route), when a user adds a 'get-return-on-alloc-fail’ to their coroutine promise, this implies the use of some content from ; we should not ICE because the user forgot that tho. Jonathan and I were discussing whether there’

Re: [PATCH] c++: constrained class template friend [PR93467]

2020-06-11 Thread Jason Merrill via Gcc-patches
On 6/9/20 2:18 PM, Patrick Palka wrote: This fixes two issues in our handling of constrained class template friend declarations. The first issue is that we fail to set the constraints on the injected class template declaration during tsubst_friend_class. The second issue is that the template pa

Re: [RFA] Fix various regressions and kernel build failure due to adjust-alignment issue

2020-06-11 Thread Hans-Peter Nilsson
On Tue, 9 Jun 2020, Jeff Law via Gcc-patches wrote: > On Tue, 2020-06-09 at 17:26 +0200, Jakub Jelinek wrote: > > On Tue, Jun 09, 2020 at 09:18:25AM -0600, Jeff Law wrote: > > > On Tue, 2020-06-09 at 16:59 +0200, Jakub Jelinek wrote: > > > > On Tue, Jun 09, 2020 at 08:54:47AM -0600, Jeff Law via G

Re: [PATCH] c++: Fix ICE in check_local_shadow with enum [PR95560]

2020-06-11 Thread Jason Merrill via Gcc-patches
On 6/11/20 3:32 PM, Jason Merrill wrote: On 6/10/20 5:11 PM, Marek Polacek wrote: Another indication that perhaps this warning is emitted too early.  We crash because same_type_p gets a null type: we have an enumerator without a fixed underlying type and finish_enum_value_list hasn't yet run.  S

Re: [PATCH] c++: Fix ICE in check_local_shadow with enum [PR95560]

2020-06-11 Thread Jason Merrill via Gcc-patches
On 6/11/20 3:34 PM, Jason Merrill wrote: On 6/11/20 3:32 PM, Jason Merrill wrote: On 6/10/20 5:11 PM, Marek Polacek wrote: Another indication that perhaps this warning is emitted too early.  We crash because same_type_p gets a null type: we have an enumerator without a fixed underlying type and

Re: [PATCH] c++: Fix ICE in check_local_shadow with enum [PR95560]

2020-06-11 Thread Jason Merrill via Gcc-patches
On 6/10/20 5:11 PM, Marek Polacek wrote: Another indication that perhaps this warning is emitted too early. We crash because same_type_p gets a null type: we have an enumerator without a fixed underlying type and finish_enum_value_list hasn't yet run. So check if the type is null before calling

[PATCH] middle-end: Optimize (A&C)^(B&C) to (A^B)&C in simplify_rtx.

2020-06-11 Thread Roger Sayle
My apologies in advance for a middle-end patch without a test case. The patch below implements a simple/safe missing transformation in the RTL optimizers, that transforms (A&C)^(B&C) into the equivalent (A^B)&C, when C doesn't side-effect, such as a constant. I originally identified this

PR fortran/95611 - ICE in access_attr_decl, at fortran/decl.c:9075

2020-06-11 Thread Harald Anlauf
Found by Steve. Committed as obvious. Thanks, Harald PR fortran/95611 - ICE in access_attr_decl, at fortran/decl.c:9075 When reporting a duplicate access specification of an operator, refer to the proper symbol. 2020-06-11 Harald Anlauf gcc/fortran/ PR fortran/95611 * decl.

Re: [PATCH] rs6000: skip debug info statements

2020-06-11 Thread Segher Boessenkool
Hi! On Thu, Jun 11, 2020 at 01:49:57PM +0200, Martin Liška wrote: > Since stmt_vec_info is not generated for debug info statements, these needs > to > be skipped in rs6000_density_test. > PR target/95627 > * config/rs6000/rs6000.c (rs6000_density_test): Skip debug > statements.

Re: [PATCH] PR fortran/95544 - ICE in gfc_can_put_var_on_stack, at fortran/trans-decl.c:494

2020-06-11 Thread Harald Anlauf
Hi Thomas, > one remark: Instead of > > + && !(strcmp(gfc_current_intrinsic, "associated") == 0 > + || strcmp(gfc_current_intrinsic, "null") == 0 > + || strcmp(gfc_current_intrinsic, "present") == 0)) > > could you maybe test sym->id ? > > OK with that change. done.

Re: [PATCH] c++: ICE with IMPLICIT_CONV_EXPR in array subscript [PR95508]

2020-06-11 Thread Jason Merrill via Gcc-patches
On 6/10/20 5:11 PM, Marek Polacek wrote: Since r10-7096 convert_like, when called in a template, creates an IMPLICIT_CONV_EXPR when we're converting to/from array type. In this test, we have e[f], and we're converting f (of type class A) to int, so convert_like in build_new_op_1 created the IMPL

Re: [PATCH PR95570] vect: ICE: Segmentation fault in vect_loop_versioning

2020-06-11 Thread Richard Sandiford
"Yangfei (Felix)" writes: > From 30a0196b0afd45bae9291cfab3fee4ad6b90cbcb Mon Sep 17 00:00:00 2001 > From: Fei Yang > Date: Thu, 11 Jun 2020 19:33:22 +0800 > Subject: [PATCH] vect: Fix an ICE in vect_loop_versioning [PR95570] > > In the test case for PR95570, the only data reference in the loop i

Re: [PATCH/RFC] How to fix PR95440

2020-06-11 Thread Jason Merrill via Gcc-patches
On 6/10/20 4:43 PM, Iain Sandoe wrote: Hi Jason, Jason Merrill wrote: On Tue, Jun 9, 2020 at 5:04 AM Iain Sandoe wrote: /* Don't bother reversing an operator with two identical parameters. */ - else if (args->length () == 2 && (flags & LOOKUP_REVERSED)) + else if (ar

[committed] libstdc++: Fix istream::ignore discarding too many chars (PR 94749)

2020-06-11 Thread Jonathan Wakely via Gcc-patches
The current code assumes that if the next character in the stream is equal to the delimiter then we stopped because we saw that delimiter, and so discards it. But in the testcase for the PR we stop because we reached the maximum number of characters, and it's coincidence that the next character eq

Re: [PATCH] Fix few -Wformat-diag warnings.

2020-06-11 Thread Martin Sebor via Gcc-patches
On 6/11/20 2:43 AM, Martin Liška wrote: Ready for master? I've been meaning to do some of this to resolve pr94982. Thanks a lot for taking the lead on it! I'll try to get to it soon! Martin Thanks, Martin gcc/ChangeLog: * cgraphunit.c (process_symver_attribute): Wrap weakref keywor

Re: [PATCH] PR fortran/95544 - ICE in gfc_can_put_var_on_stack, at fortran/trans-decl.c:494

2020-06-11 Thread Thomas Koenig via Gcc-patches
Hi Harald, one remark: Instead of + && !(strcmp(gfc_current_intrinsic, "associated") == 0 + || strcmp(gfc_current_intrinsic, "null") == 0 + || strcmp(gfc_current_intrinsic, "present") == 0)) could you maybe test sym->id ? OK with that change. Best regards,

Re: [PATCH] diagnostics: Add options to control the column units [PR49973] [PR86904]

2020-06-11 Thread Lewis Hyatt via Gcc-patches
On Wed, Jun 10, 2020 at 12:11:00PM -0400, David Malcolm wrote: > Thanks for the patch; sorry about the delay in reviewing it. > > Some high-level review points > > - I like the patch overall > > - This will deserve an item in the release notes > > - I don't like adding "global_tabstop" (I don't

Re: [patch] Fix ICE in verify_sra_access_forest

2020-06-11 Thread Eric Botcazou
> I am not very good at reasoning about reverse storage order stuff but > can it ever happen that this reverse is not the same as racc->reverse? > > In order for that to happen, we'd have to have an assignment (folded > memcpy?) between two aggregates in the original code that, at the same > offse

[PATCH] PR fortran/95544 - ICE in gfc_can_put_var_on_stack, at fortran/trans-decl.c:494

2020-06-11 Thread Harald Anlauf
> Gesendet: Montag, 08. Juni 2020 um 22:25 Uhr > Von: "Harald Anlauf" > An: "fortran" , "gcc-patches" > Betreff: [PATCH] PR fortran/95544 - ICE in gfc_can_put_var_on_stack, at > fortran/trans-decl.c:494 OK, now with a brown bag over my head, here comes the patch instead of just the testcase. T

Re: BRIG FE testsuite: Fix all dump-scans (Was: Re: drop -aux{dir, base}, revamp -dump{dir, base})

2020-06-11 Thread Martin Jambor
Hi Mike, On Tue, Jun 09 2020, Mike Stump wrote: > I think I'd prefer the fix on the other side, if reasonable. I'd give > them some time to see about a fix there before selecting this patch. given Alexandre's email, are you OK with the patch? It essentially manually keeps the input name "rootna

Re: [patch] Fix ICE in verify_sra_access_forest

2020-06-11 Thread Martin Jambor
Hi, On Thu, Jun 11 2020, Eric Botcazou wrote: > Hi, > > this fixes an issue with reverse storage order in SRA, which is caught by the > built-in verifier: > > ===GNAT BUG DETECTED==+ > | 11.0.0 20200610 (experimental) (x86_64-suse-linux) GCC err

Re: [PATCH, PR fortran/95503] [9/10/11 Regression] ICE in gfc_is_simply_contiguous, at fortran/expr.c:5844

2020-06-11 Thread Thomas Koenig via Gcc-patches
Hi Harald, The following patch fixes an almost obvious ICE in invalid. Regtested on x86_64-pc-linux-gnu. OK for master, and backports to 9/10? OK. Thanks for the patch! Regards Thomas

Re: [Patch, fortran] PR fortran/95331 - Unlimited polymorphic arrays have wrong bounds

2020-06-11 Thread Thomas Koenig via Gcc-patches
Hi Jose, Proposed patch to PR95331 - Unlimited polymorphic arrays have wrong bounds. Patch tested only on x86_64-pc-linux-gnu. reviewed, ChangeLog reformatted, committed as r11-1235-g2ee70f5d161edd99a7af97d166b251bcf83cd91b . Thanks a lot for the patch! Do you have interest in getting write

Re: [PATCH] rs6000: skip debug info statements

2020-06-11 Thread Jakub Jelinek via Gcc-patches
On Thu, Jun 11, 2020 at 01:49:57PM +0200, Martin Liška wrote: > diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c > index 0bbd06ad1de..00daf979856 100644 > --- a/gcc/config/rs6000/rs6000.c > +++ b/gcc/config/rs6000/rs6000.c > @@ -4987,6 +4987,9 @@ rs6000_density_test (rs6000_cost

Re: [PATCH] rs6000: skip debug info statements

2020-06-11 Thread Richard Biener via Gcc-patches
On June 11, 2020 1:49:57 PM GMT+02:00, "Martin Liška" wrote: >Hi. > >Since stmt_vec_info is not generated for debug info statements, these >needs to >be skipped in rs6000_density_test. > >Patch can bootstrap on ppc64le-linux-gnu and survives regression tests. > >Ready to be installed? OK. Richa

Re: [Patch, fortran] PR fortran/52351, 85868 Wrong array section bounds when passing to an intent-in pointer dummy

2020-06-11 Thread Thomas Koenig via Gcc-patches
Hi Jose, Proposed patch to PRs 52351, 85868 Wrong array section bounds when passing to an intent-in pointer dummy. First, thanks for working on this and for this patch. Regarding the patch, there are a few style issues which I fixed for the commit. If you could try to adhere to a few more of

Re: [PR95416] outputs.exp: skip lto tests when not using linker plugin

2020-06-11 Thread Rainer Orth
Hi Alexandre, > On Jun 9, 2020, Rainer Orth wrote: > >> this is wrong unfortunately: braces are the Tcl equivalent of single >> quotes so you're setting skip_lto to the string inside. > > Aah, thanks. So when $skip_lto is expanded in the ifs, the whole thing > is evaluated, and that's why it wo

[PATCH PR94274] fold phi whose incoming args are defined from binary

2020-06-11 Thread Zhanghaijian (A)
Hi, This is a experimental fix for pr94274. For if/else structure, when the expressions is binary operation and have a common subexpression, and the opcode is the same, we can fold the merging phi node in tree_ssa_phiopt_worker (ssa-phiopt). It can be optimized to do csel first and then do binar

Re: [Patch, fortran] PR fortran/94022 - Array slices of assumed-size arrays

2020-06-11 Thread Thomas Koenig via Gcc-patches
Hi Jose, Proposed patch to Bug 94022 - Array slices of assumed-size arrays. Patch tested only on x86_64-pc-linux-gnu. Reviewed, regression-tested and commited as r11-1228-g6a07010b774cb5a0b1790b857e69d3d8534eebd2 . Thanks for the patch! Regards Thomas

Re: [PATCH] git_update_version: add --current argument.

2020-06-11 Thread Jakub Jelinek via Gcc-patches
On Thu, Jun 11, 2020 at 01:47:30PM +0200, Martin Liška wrote: > The argument can be useful to update arbitrary branch, the changes > are added to git index and user is supposed to make a commit. > > I'm going to install it if there are no objections. > > Martin > > contrib/ChangeLog: > >

(patch] Optimize assignment to volatile aggregate variable

2020-06-11 Thread Eric Botcazou
Hi, gimplify_modify_expr_rhs has an optimization whereby the assignment to an aggregate variable from a read-only object with a DECL_INITIAL is optimized into the direct assignment of the DECL_INITIAL, provided that no temporary is created in the process. The optimization is blocked if the rea

[PATCH] rs6000: skip debug info statements

2020-06-11 Thread Martin Liška
Hi. Since stmt_vec_info is not generated for debug info statements, these needs to be skipped in rs6000_density_test. Patch can bootstrap on ppc64le-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/ChangeLog: PR target/95627 * config/rs6000/rs

[PATCH] git_update_version: add --current argument.

2020-06-11 Thread Martin Liška
The argument can be useful to update arbitrary branch, the changes are added to git index and user is supposed to make a commit. I'm going to install it if there are no objections. Martin contrib/ChangeLog: * gcc-changelog/git_update_version.py: Add --curent argument. --- contrib/gcc-

RE: [PATCH PR95570] vect: ICE: Segmentation fault in vect_loop_versioning

2020-06-11 Thread Yangfei (Felix)
Hi, > -Original Message- > From: Richard Sandiford [mailto:richard.sandif...@arm.com] > Sent: Thursday, June 11, 2020 12:23 AM > To: Yangfei (Felix) > Cc: gcc-patches@gcc.gnu.org > Subject: Re: [PATCH PR95570] vect: ICE: Segmentation fault in > vect_loop_versioning > > "Yangfei (Felix)"

[patch] Fix ICE in verify_sra_access_forest

2020-06-11 Thread Eric Botcazou
Hi, this fixes an issue with reverse storage order in SRA, which is caught by the built-in verifier: ===GNAT BUG DETECTED==+ | 11.0.0 20200610 (experimental) (x86_64-suse-linux) GCC error:| | in verify_sra_access_forest, at tree-sra

[PATCH][RFC] __builtin_shuffle sometimes should produce zip1 rather than TBL (PR82199)

2020-06-11 Thread Dmitrij Pochepko
The following patch enables vector permutations optimization by using another vector element size when applicable. It allows usage of simpler instructions in applicable cases. example: #define vector __attribute__((vector_size(16) )) vector float f(vector float a, vector float b) { return __bu

Re: [PATCH 4/4 V2] vect: Factor out and rename some functions/macros

2020-06-11 Thread Richard Sandiford
"Kewen.Lin" writes: > @@ -9195,12 +9222,13 @@ optimize_mask_stores (class loop *loop) > } > > /* Decide whether it is possible to use a zero-based induction variable > - when vectorizing LOOP_VINFO with a fully-masked loop. If it is, > - return the value that the induction variable must b

[Ada] Put_Image attribute

2020-06-11 Thread Pierre-Marie de Rodat
Work around bug in Put_Image of types in Remote_Types packages. Use the switch -gnatd_z to control enabling of Put_Image. Put_Image is still disabled by default for all types. Tested on x86_64-pc-linux-gnu, committed on trunk 2020-06-11 Bob Duff gcc/ada/ * exp_put_image.adb (Build_

[Ada] Fix assertion failure on entry call through unchecked conversion

2020-06-11 Thread Pierre-Marie de Rodat
The Safe_Unchecked_Type_Conversion predicate was invoking the Has_Discriminant predicate without checking that the Etype really Is_Type, which is not the case for Standard_Void_Type "returned" by entry calls. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2020-06-11 Er

[Ada] Fix missing insertion of explicit dereference in instance

2020-06-11 Thread Pierre-Marie de Rodat
This adjusts the new Resolve_Implicit_Dereference procedure to the cases where nodes in an instance do not have the proper view of a type that was declared as private (a well-known limitation of the current implementation of generic instantiations for types that are only implicitly referenced in th

[Ada] Refine type of a routine parameter from Node_Id to Entity_Id

2020-06-11 Thread Pierre-Marie de Rodat
Routine Get_Value is only called with its Compon parameter equal to entity ids of components. This is now reflected in the type of this parameter. Code cleanup only; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk 2020-06-11 Piotr Trojanek gcc/ada/ * sem_a

[Ada] Allow specifying volatility refinement aspects for types

2020-06-11 Thread Pierre-Marie de Rodat
Previously, the four aspects Async_Readers, Async_Writers, Effective_Reads, and Effective_Writes could only be specified for volatile variables and for state abstractions. Allow specifying these aspects for volatile types. Tested on x86_64-pc-linux-gnu, committed on trunk 2020-06-11 Steve Baird

[Ada] Update SPARK RM rule numbers after removing a redundant rule

2020-06-11 Thread Pierre-Marie de Rodat
SPARK RM 7.1.3(8) has been deleted, but there were actually plenty of mistakes in references to rules 7.1.3(X). This patch fixes them in both comments and error messages. Tested on x86_64-pc-linux-gnu, committed on trunk 2020-06-11 Piotr Trojanek gcc/ada/ * sem_ch4.adb, sem_ch6.adb,

[Ada] Fix wrong access to large bit-packed arrays with reverse SSO

2020-06-11 Thread Pierre-Marie de Rodat
Large bit-packed arrays, i.e. whose size is greater than 64 bits, are implemented under the hood by means of arrays of storage units, the front-end generating the required mask-and-shifts operations to go back and forth between the two representations. These operations depend on the endianness of

[Ada] Put_Image attribute

2020-06-11 Thread Pierre-Marie de Rodat
Work around the fact that Put_Image doesn't work for private types whose full type is real. Make Put_Image_Unknown print out the name of the type. Put_Image is still disabled by default for all types. Tested on x86_64-pc-linux-gnu, committed on trunk 2020-06-11 Bob Duff gcc/ada/ *

[Ada] Consolidate handling of implicit dereferences into semantic analysis

2020-06-11 Thread Pierre-Marie de Rodat
This consolidates the handling of almost all the implicit dereferences allowed in Ada 95 into the semantic analysis phase of the compiler, and more precisely in the Resolve routine of the front-end. This both means that the generic code handling them in the expander is removed, and that various co

[Ada] Create constrained itypes for nested record aggregates

2020-06-11 Thread Pierre-Marie de Rodat
When resolving a record aggregate with a box as the value of one of its component that is itself of a discriminated record type, this box is replaced with an inner record aggregate. However, while a constrained itype is created for the outer record aggregate (as described in the comment of Resolve_

[Ada] Refine type of a counter-like variable

2020-06-11 Thread Pierre-Marie de Rodat
A local variable that is used as a counter (which is clear from both its comment and its used) will only be assigned with natural numbers. This is now reflected in its type. Code cleanup only; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk 2020-06-11 Piotr Trojanek

[Ada] Avoid "others => <>" association in resolved record aggregates

2020-06-11 Thread Pierre-Marie de Rodat
When resolving record aggregates, frontend was creating "others => <>" association to represent nested components, for example: type T1 (D1 : Boolean := False) is record C1 : Boolean := True; end record; type T2 is record C2 : T1; end record; X2 : T2 := (others => <>);

[Ada] Move duplicated routines for building itypes to Sem_Util

2020-06-11 Thread Pierre-Marie de Rodat
Routine Build_Constrained_Itype was created as an exact duplicate Build_Subtype with a comment suggesting that their code should be exported from Sem_Util and reused. Unfortunately, since then both routines diverged and now are subtly different, so reusing is not straightforward. However, it is sti

[Ada] Iterate with procedural version of Next routine where possible

2020-06-11 Thread Pierre-Marie de Rodat
Routine Next is implemented both as a procedure and as a function. The procedure variant seems meant to be used when iterating, e.g.: Next (Decl); because it is more readable than the corresponding functions: Decl := Next (Decl); (and it is inlined anyway, so there is no performance penal

[Ada] Additional warnings on overlapping actuals of composite types

2020-06-11 Thread Pierre-Marie de Rodat
This patch refines the handling of warnings on overlapping actuals of composite types when only one of them is writable. Formals of a generic type are excluded, given that the warning will be given on any instance. Uniform treatment of formals and actuals. Tested on x86_64-pc-linux-gnu, committed

[Ada] Skip unnecessary iterations over constraint expressions

2020-06-11 Thread Pierre-Marie de Rodat
When looking for references to discriminants within constraint expressions we now stop once the first such a reference is found. This is just a tiny performance improvement; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk 2020-06-11 Piotr Trojanek gcc/ada/

[Ada] Missing accessibility error on object in type conversion

2020-06-11 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby the compiler would incorrectly calculate accessibility levels of objects within type conversions - leading to potentially missing static and dynamic errors. Tested on x86_64-pc-linux-gnu, committed on trunk 2020-06-11 Justin Squirek gcc/ada/ * sem

[Ada] Simplify iteration over formal parameters for aliasing error

2020-06-11 Thread Pierre-Marie de Rodat
When iterating over pairs of formal parameters we now finish as soon as we find a single problematic pair; previously we continued iteration. This is just a simplification and a compiler performance improvement. Semantics is not affected. Tested on x86_64-pc-linux-gnu, committed on trunk 2020-06-

[Ada] Make Object Specific Dispatch tables constant

2020-06-11 Thread Pierre-Marie de Rodat
Internally generated static dispatch tables are preferably put in ROM, so they are declared as constant where possible. However, the Object Specific Dispatch tables were declared as variables, even though they are initialized with static aggregates (with only literal integers) and are never modifie

[Ada] Remove a dubious optimization for Object Specific Data dispatching

2020-06-11 Thread Pierre-Marie de Rodat
Routines Sem_Aggr.Build_Constrained_Itype and Sem_Ch3.Build_Subtype that create discriminated itypes were originally identical, but now they are subtly different. This patch removes one of their two subtle differences, namely a call to Set_Size_Known_At_Compile_Time that was meant as a very narrow

[Ada] Refine type for sorting case-choices tables

2020-06-11 Thread Pierre-Marie de Rodat
Tables with case-choices are sorted by Sort_Case_Table with an insertion sort. Contrary to what comments for the Case_Table_Type says, this routine doesn't use the table element at index 0 as a placeholder. Tested on x86_64-pc-linux-gnu, committed on trunk 2020-06-11 Piotr Trojanek gcc/ada/

[Ada] Remove useless code in Backend_Processing_Possible

2020-06-11 Thread Pierre-Marie de Rodat
The call to Set_Size_Known_At_Compile_Time in Backend_Processing_Possible happened just after querying Size_Known_At_Compile_Time several lines before. Both calls operated on the same type entity, so the call to "Set" routine had no effect and now is removed. Tested on x86_64-pc-linux-gnu, committ

[Ada] AI12-0356 Root_Storage_Pool_With_Subpools & Preelaborable_Init

2020-06-11 Thread Pierre-Marie de Rodat
This Ada 202x AI clarifies that Root_Storage_Pool_With_Subpools and Root_Subpool should have pragma Preelaborable_Initialization. Tested on x86_64-pc-linux-gnu, committed on trunk 2020-06-11 Arnaud Charlet gcc/ada/ * libgnat/s-stposu.ads (Root_Storage_Pool_With_Subpools, Root

[Ada] Fix unnesting crash with Predicate_Failure/no pred

2020-06-11 Thread Pierre-Marie de Rodat
This patch fixes a bug where if you have a Predicate_Failure aspect on a nested type, but no Predicate, Static_Predicate, or Dynamic_Predicate, the compiler crashes when compiled with assertions enabled. Tested on x86_64-pc-linux-gnu, committed on trunk 2020-06-11 Bob Duff gcc/ada/ *

[Ada] Generate predicate checks for on assignments in records

2020-06-11 Thread Pierre-Marie de Rodat
When an assignment of an allocator the type of which has predicate checks is made inside of a record, GNAT generates a call to the predicate function. However, before this commit, GNAT wouldn't check if the subtype mark had a predicate, which would result in the predicate check function not being c

Re: [committed] gcc-changelog: Use non-zero exit status on error

2020-06-11 Thread Martin Liška
On 6/11/20 11:47 AM, Jonathan Wakely wrote: Is the attached patch what you're asking for? Yes ;) Martin

Re: [committed] gcc-changelog: Use non-zero exit status on error

2020-06-11 Thread Jonathan Wakely via Gcc-patches
On 11/06/20 10:54 +0200, Martin Liška wrote: On 6/11/20 10:48 AM, Jonathan Wakely wrote: On 11/06/20 09:54 +0200, Martin Liška wrote: On 6/10/20 2:20 PM, Jonathan Wakely wrote: Oops, this line was left in while I was testing it by amending existing commits! Here's an updated patch without tha

Re: [PATCH] asan: fix RTX emission for ilp32

2020-06-11 Thread Martin Liška
On 6/11/20 10:50 AM, Jakub Jelinek wrote: On Thu, Jun 11, 2020 at 10:12:14AM +0200, Martin Liška wrote: gcc/ChangeLog: PR sanitizer/95634 * asan.c (asan_emit_stack_protection): Fix emission for ilp32 by using Pmode instead of ptr_mode. --- gcc/asan.c | 4 ++-- 1 file

Re: [committed] gcc-changelog: Use non-zero exit status on error

2020-06-11 Thread Martin Liška
On 6/11/20 10:48 AM, Jonathan Wakely wrote: On 11/06/20 09:54 +0200, Martin Liška wrote: On 6/10/20 2:20 PM, Jonathan Wakely wrote: Oops, this line was left in while I was testing it by amending existing commits! Here's an updated patch without that line. I generally like the suggested idea

Re: [stage1][PATCH] Lower VEC_COND_EXPR into internal functions.

2020-06-11 Thread Martin Liška
On 6/9/20 3:42 PM, Richard Biener wrote: I think we need to fix that before merging. There's updated version of the patch that should handle the EH properly. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin >From fc5a59e8c8887c102bff

Re: [PATCH] asan: fix RTX emission for ilp32

2020-06-11 Thread Jakub Jelinek via Gcc-patches
On Thu, Jun 11, 2020 at 10:12:14AM +0200, Martin Liška wrote: > gcc/ChangeLog: > > PR sanitizer/95634 > * asan.c (asan_emit_stack_protection): Fix emission for ilp32 > by using Pmode instead of ptr_mode. > --- > gcc/asan.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions

Re: [committed] gcc-changelog: Use non-zero exit status on error

2020-06-11 Thread Jonathan Wakely via Gcc-patches
On 11/06/20 09:54 +0200, Martin Liška wrote: On 6/10/20 2:20 PM, Jonathan Wakely wrote: Oops, this line was left in while I was testing it by amending existing commits! Here's an updated patch without that line. I generally like the suggested idea and I have suggestion to usage of the GCC_FO

[PATCH] Fix few -Wformat-diag warnings.

2020-06-11 Thread Martin Liška
Ready for master? Thanks, Martin gcc/ChangeLog: * cgraphunit.c (process_symver_attribute): Wrap weakref keyword. * dbgcnt.c (dbg_cnt_set_limit_by_index): Do not print extra new line. * lto-wrapper.c (merge_and_complain): Wrap option names. --- gcc/cgraphunit.c

[PATCH] asan: fix RTX emission for ilp32

2020-06-11 Thread Martin Liška
Hello. There's a patch for ilp32 where we should use Pmode instead of ptr_mode. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/ChangeLog: PR sanitizer/95634 * asan.c (asan_emit_stack_protection): Fix emission fo

Re: [committed] gcc-changelog: Use non-zero exit status on error

2020-06-11 Thread Martin Liška
On 6/11/20 9:45 AM, Martin Liška wrote: On 6/10/20 2:15 PM, Jonathan Wakely wrote: And this is another little patch that just avoids running 'git diff' twice, by using tee(1) to write to $GCC_GIT_DIFF_FILE as a side effect of generating the diff to pipe to mklog.py. Thanks, please install the

Re: [committed] gcc-changelog: Use non-zero exit status on error

2020-06-11 Thread Martin Liška
On 6/10/20 2:20 PM, Jonathan Wakely wrote: Oops, this line was left in while I was testing it by amending existing commits! Here's an updated patch without that line. I generally like the suggested idea and I have suggestion to usage of the GCC_FORCE_MKLOG. Right now, we use the env variable

Re: [committed] gcc-changelog: Use non-zero exit status on error

2020-06-11 Thread Martin Liška
On 6/10/20 2:15 PM, Jonathan Wakely wrote: And this is another little patch that just avoids running 'git diff' twice, by using tee(1) to write to $GCC_GIT_DIFF_FILE as a side effect of generating the diff to pipe to mklog.py. Thanks, please install the improvement. Martin

[PATCH 4/4 V2] vect: Factor out and rename some functions/macros

2020-06-11 Thread Kewen.Lin via Gcc-patches
on 2020/6/11 上午12:58, Richard Sandiford wrote: > "Kewen.Lin" writes: >> diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c >> index ca68d04a919..1fac5898525 100644 >> --- a/gcc/tree-vect-loop-manip.c >> +++ b/gcc/tree-vect-loop-manip.c >> @@ -420,8 +420,8 @@ vect_set_loop_control

[PATCH][OBVIOUS] Fix -Wformat-diag in options-save.c

2020-06-11 Thread Martin Liška
The patch removes bunch of warnings: options-save.c:12004:29: warning: unquoted identifier or keyword ‘global_options’ in format [-Wformat-diag] 12004 | internal_error ("Error: global_options are modified in local context\n"); gcc/ChangeLog: * optc-save-gen.awk: Quote error string