GCC 8.0.0 Status Report (2018-01-15), Trunk in Regression and Documentation fixes only mode

2018-01-15 Thread Richard Biener
Status == GCC 8 is in regression and documentation fixes stage now similar as if trunk was a release branch. We're still in pretty bad shape regression-wise. Please also take the opportunity to check the state of your favorite host/target combination to make sure building and testing works

[x86,avx] Fix __builtin_cpu_supports for icelake and cannonlake isa

2018-01-15 Thread Koval, Julia
Hi, This patch fixes subj. Ok for trunk? gcc/ * config/i386/i386.c (F_AVX512VBMI2, F_GFNI, F_VPCLMULQDQ, F_AVX512VNNI, F_AVX512BITALG): New. gcc/testsuite/ * gcc.target/i386/builtin_target.c (check_intel_cpu_model): Add cannonlake. (check_features): Add avx512vbmi

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-15 Thread Richard Biener
On Sun, Jan 14, 2018 at 4:08 PM, H.J. Lu wrote: > Now my patch set has been checked into trunk. Here is a patch set > to move struct ix86_frame to machine_function on GCC 7, which is > needed to backport the patch set to GCC 7: > > https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01239.html > https:

Re: [PATCH] Introduce -fwrapp and make -fno-strict-overflow imply it (PR middle-end/82694)

2018-01-15 Thread Richard Biener
On Fri, 12 Jan 2018, Jakub Jelinek wrote: > Hi! > > Apparently Linux kernel contains various UB code that has been worked around > through -fno-strict-overflow in 7.x and before, but when > POINTER_TYPE_OVERFLOW_UNDEFINED has been removed it now fails to boot. > > The following patch follows the

Re: [PATCH] Introduce -fwrapp and make -fno-strict-overflow imply it (PR middle-end/82694)

2018-01-15 Thread Richard Biener
On Fri, 12 Jan 2018, Marc Glisse wrote: > On Fri, 12 Jan 2018, Jakub Jelinek wrote: > > > Apparently Linux kernel contains various UB code that has been worked around > > through -fno-strict-overflow in 7.x and before, but when > > POINTER_TYPE_OVERFLOW_UNDEFINED has been removed it now fails to

Re: [PATCH][Middle-end][version 2]2nd patch of PR78809 and PR83026

2018-01-15 Thread Richard Biener
On Fri, 12 Jan 2018, Jeff Law wrote: > On 12/21/2017 02:25 PM, Qing Zhao wrote: > > Hi, > > > > I updated my patch based on all your comments. > > > > the major changes are the following: > > > > 1. replace the candidate calls with __builtin_str(n)cmp_eq instead of > > __builtin_memcmp_e

Re: [patch, fortran] Change ABI for F2008 - minloc/maxloc BACK argument

2018-01-15 Thread Janne Blomqvist
On Sun, Jan 14, 2018 at 12:58 PM, Thomas Koenig wrote: > Hello world, > > here is the latest take on the min/maxloc ABI change for BACK. > This version now passes BACK as a GFC_LOGCIAL_4 by value in all cases. > I did this by using the existing %VAL mechanism. I also added > another test case whic

[PATCH] PR83804, LTO memory consumption

2018-01-15 Thread Richard Biener
This axes the trivial part of trees made possible by early LTO debug to shrink WPA memory use. That's mainly TYPE_DECLs and BINFOs. Shaves off a bit of the 5% regression we've seen there. LTO bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2018-01-11 Richard B

Re: Add support for masked load/store_lanes

2018-01-15 Thread Christophe Lyon
On 13 January 2018 at 16:50, Jeff Law wrote: > On 01/12/2018 09:28 AM, Richard Sandiford wrote: >> >> Here's the patch with the updated docs. Does this version look OK? >> >> Thanks, >> Richard >> >> >> 2018-01-12 Richard Sandiford >> Alan Hayward >> David Sherwood >> >

Re: [PATCH] C/C++: Add -Waddress-of-packed-member

2018-01-15 Thread Jakub Jelinek
On Sun, Jan 14, 2018 at 06:29:54AM -0800, H.J. Lu wrote: > + if (TREE_CODE (field) == FIELD_DECL && DECL_PACKED (field)) > + { > + tree field_type = TREE_TYPE (field); > + unsigned int type_align = TYPE_ALIGN (field_type); > + tree context = DECL_CONTEXT

Re: [PATCH v2, rs6000] Add -msafe-indirect-jumps option and implement safe bctr / bctrl

2018-01-15 Thread Richard Biener
On Sun, Jan 14, 2018 at 5:53 AM, Bill Schmidt wrote: > Hi, > > [This patch supercedes and extends > https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01135.html. > There was a small error in the assembly code produced by that patch (bad > memory on my account of how to spell "crset eq"). I've also i

Re: [PATCH, PR82428] Add __builtin_goacc_{gang,worker,vector}_{id,size}

2018-01-15 Thread Tom de Vries
On 01/07/2018 02:17 PM, Tom de Vries wrote: On 01/06/2018 12:36 PM, Jakub Jelinek wrote: On Sat, Jan 06, 2018 at 09:21:59AM +0100, Tom de Vries wrote: this patch adds the following builtins in C/C++: - __builtin_goacc_gang_id - __builtin_goacc_worker_id - __builtin_goacc_vector_id - __builtin_g

Re: Add support for fully-predicated loops

2018-01-15 Thread Christophe Lyon
Hi Richard, On 7 January 2018 at 18:08, James Greenhalgh wrote: > On Mon, Dec 18, 2017 at 07:40:00PM +, Jeff Law wrote: >> On 11/17/2017 07:56 AM, Richard Sandiford wrote: >> > This patch adds support for using a single fully-predicated loop instead >> > of a vector loop and a scalar tail.

Re: Add support for reductions in fully-masked loops

2018-01-15 Thread Christophe Lyon
Hi Richard, On 7 January 2018 at 21:35, James Greenhalgh wrote: > On Wed, Dec 13, 2017 at 04:34:34PM +, Jeff Law wrote: >> On 11/17/2017 07:59 AM, Richard Sandiford wrote: >> > This patch removes the restriction that fully-masked loops cannot >> > have reductions. The key thing here is to m

Re: [PATCH, rs6000] Support for gimple folding of mergeh, mergel intrinsics

2018-01-15 Thread Richard Biener
On Fri, Jan 12, 2018 at 10:22 PM, Will Schmidt wrote: > Hi, > Add support for gimple folding of the mergeh, mergel intrinsics. > Since the merge low and merge high variants are almost identical, a > new helper function has been added so that code can be shared. > > This also adds define_insn for

Re: [PATCH, PR82428] Add __builtin_goacc_{gang,worker,vector}_{id,size}

2018-01-15 Thread Jakub Jelinek
On Mon, Jan 15, 2018 at 10:49:52AM +0100, Tom de Vries wrote: > On 01/07/2018 02:17 PM, Tom de Vries wrote: > > On 01/06/2018 12:36 PM, Jakub Jelinek wrote: > > > On Sat, Jan 06, 2018 at 09:21:59AM +0100, Tom de Vries wrote: > > > > this patch adds the following builtins in C/C++: > > > > - __built

[patch,avr,committed] Add tests for PR83801.

2018-01-15 Thread Georg-Johann Lay
Added the following avr specific test cases for the already fixed PR83801. Johann PR c/83801 PR c/83729 * gcc.target/avr/torture/pr83729.c: New test. * gcc.target/avr/torture/pr83801.c: New test. Index: gcc.target/avr/torture/pr83729.c ==

Re: Improve canonicalisation of TARGET_MEM_REFs

2018-01-15 Thread Richard Biener
On Tue, Jan 9, 2018 at 3:39 PM, Richard Sandiford wrote: > Richard Biener writes: >> On Tue, Nov 7, 2017 at 7:04 PM, Richard Sandiford >> wrote: >>> Richard Biener writes: On Fri, Nov 3, 2017 at 5:32 PM, Richard Sandiford wrote: > A general TARGET_MEM_REF is: > > BASE

Re: [PATCH] document -Wclass-memaccess suppression by casting (PR 81327)

2018-01-15 Thread Florian Weimer
* Martin Sebor: > +the virtual table. Modifying the representation of such objects may violate ^vtable pointer? The vtable itself is not corrupted, I assume.

Re: [PATCH] lto, testsuite: Fix ICE in -Wodr (PR lto/83121)

2018-01-15 Thread Richard Biener
On Mon, Jan 8, 2018 at 8:36 PM, David Malcolm wrote: > On Sat, 2018-01-06 at 08:44 +0100, Richard Biener wrote: >> On January 5, 2018 11:55:11 PM GMT+01:00, David Malcolm > hat.com> wrote: >> > On Fri, 2018-01-05 at 10:36 +0100, Richard Biener wrote: >> > > On Thu, Jan 4, 2018 at 10:52 PM, David M

Re: Make ivopts handle calls to internal functions

2018-01-15 Thread Christophe Lyon
Hi, On 13 January 2018 at 16:34, Jeff Law wrote: > On 01/09/2018 08:23 AM, Richard Sandiford wrote: >> Richard Biener writes: >>> On Mon, Nov 20, 2017 at 12:31 PM, Bin.Cheng wrote: On Fri, Nov 17, 2017 at 3:03 PM, Richard Sandiford wrote: > ivopts previously treated pointer argu

Re: Allow the number of iterations to be smaller than VF

2018-01-15 Thread Christophe Lyon
On 7 January 2018 at 21:51, James Greenhalgh wrote: > On Mon, Nov 20, 2017 at 12:12:38AM +, Jeff Law wrote: >> On 11/17/2017 08:11 AM, Richard Sandiford wrote: >> > Fully-masked loops can be profitable even if the iteration >> > count is smaller than the vectorisation factor. In this case >>

Re: Allow single-element interleaving for non-power-of-2 strides

2018-01-15 Thread Christophe Lyon
On 7 January 2018 at 21:55, James Greenhalgh wrote: > On Fri, Nov 17, 2017 at 06:40:13PM +, Jeff Law wrote: >> On 11/17/2017 08:33 AM, Richard Sandiford wrote: >> > This allows LD3 to be used for isolated a[i * 3] accesses, in a similar >> > way to the current a[i * 2] and a[i * 4] for LD2 and

Re: [PATCH, rs6000] Support for gimple folding of mergeh, mergel intrinsics

2018-01-15 Thread Richard Sandiford
Richard Biener writes: > On Fri, Jan 12, 2018 at 10:22 PM, Will Schmidt > wrote: >> Hi, >> Add support for gimple folding of the mergeh, mergel intrinsics. >> Since the merge low and merge high variants are almost identical, a >> new helper function has been added so that code can be shared. >>

Re: [PATCH, PR82428] Add __builtin_goacc_{gang,worker,vector}_{id,size}

2018-01-15 Thread Tom de Vries
On 01/15/2018 11:05 AM, Jakub Jelinek wrote: On Mon, Jan 15, 2018 at 10:49:52AM +0100, Tom de Vries wrote: On 01/07/2018 02:17 PM, Tom de Vries wrote: On 01/06/2018 12:36 PM, Jakub Jelinek wrote: On Sat, Jan 06, 2018 at 09:21:59AM +0100, Tom de Vries wrote: this patch adds the following built

Re: [PATCH, PR82428] Add __builtin_goacc_{gang,worker,vector}_{id,size}

2018-01-15 Thread Jakub Jelinek
On Mon, Jan 15, 2018 at 11:39:28AM +0100, Tom de Vries wrote: > > Does OpenACC have some term for the 3 dimensions/kinds of parallelism? > > openacc spec: "OpenACC exposes these three levels of parallelism via gang, > worker and vector parallelism." > > So, maybe we abbreviate to: 'parlevel' or '

Re: [v3 PATCH] Make optional conditionally trivially_{copy,move}_{constructible,assignable}

2018-01-15 Thread Jonathan Wakely
On 14/01/18 01:09 +0200, Ville Voutilainen wrote: On 8 January 2018 at 15:36, Jonathan Wakely wrote: On 25/12/17 23:59 +0200, Ville Voutilainen wrote: In the midst of the holiday season, the king and ruler of all elves, otherwise known as The Elf, was told by little elves that users are compl

Re: [PATCH, PR82428] Add __builtin_goacc_{gang,worker,vector}_{id,size}

2018-01-15 Thread Tom de Vries
On 01/15/2018 11:44 AM, Jakub Jelinek wrote: On Mon, Jan 15, 2018 at 11:39:28AM +0100, Tom de Vries wrote: Does OpenACC have some term for the 3 dimensions/kinds of parallelism? openacc spec: "OpenACC exposes these three levels of parallelism via gang, worker and vector parallelism." So, mayb

[patch,avr,committed] Adjust tests to AVR_TINY

2018-01-15 Thread Georg-Johann Lay
This obvious patch adds more handling of AVR_TINY, mostly by applying "!avr_tiny" target filter of by defaulting to generic address-space if __flash is not available. Committed as https://gcc.gnu.org/r256690 Johann * gcc.target/avr/progmem.h (pgm_read_char): Handle AVR_TINY. * g

[PATCH][arm] PR target/83687: Fix invalid combination of VSUB + VABS into VABD

2018-01-15 Thread Kyrill Tkachov
Hi all, In this wrong-code bug we combine a VSUB.I8 and a VABS.S8 into a VABD.S8 instruction . This combination is not valid for integer operands because in the VABD instruction the semantics are that the difference is computed in notionally infinite precision and the absolute difference is compu

Re: [PATCH, PR82428] Add __builtin_goacc_{gang,worker,vector}_{id,size}

2018-01-15 Thread Jakub Jelinek
On Mon, Jan 15, 2018 at 12:12:10PM +0100, Tom de Vries wrote: > > It can be just number of course. parlevel is fine for me. > > > > So, in summary, I propose as interface: > - int __builtin_goacc_parlevel_id (int); > - int __builtin_goacc_parlevel_size (int); > with arguments 0, 1, and 2 meaning

[PATCH] PR82964: Fix 128-bit immediate ICEs

2018-01-15 Thread Wilco Dijkstra
This fixes PR82964 which reports ICEs for some CONST_WIDE_INT immediates. It turns out decimal floating point CONST_DOUBLE get changed into CONST_WIDE_INT without checking the constraint on the operand, which results in failures. Avoid this by only allowing SF/DF/TF mode floating point constants

[PATCH] Fix PR83850

2018-01-15 Thread Richard Biener
The following fixes a typo to make gcc.target/i386/pr80846-1.c PASS again. Bootstrap and regtest running on x86_64-unknown-linux-gnu. Richard. 2018-01-15 Richard Biener PR middle-end/83850 * expmed.c (extract_bit_field_1): Fix typo. Index: gcc/expmed.c =

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-15 Thread H.J. Lu
On Mon, Jan 15, 2018 at 12:31 AM, Richard Biener wrote: > On Sun, Jan 14, 2018 at 4:08 PM, H.J. Lu wrote: >> Now my patch set has been checked into trunk. Here is a patch set >> to move struct ix86_frame to machine_function on GCC 7, which is >> needed to backport the patch set to GCC 7: >> >> h

[committed] Missing vect_double in gcc.dg/vect/pr79920.c (PR83836)

2018-01-15 Thread Richard Sandiford
Tested on aarch64-linux-gnu and x86_64-linux-gnu, also spot-tested on sparc-sun-solaris2.11. Installed as obvious. Richard 2018-01-15 Richard Sandiford gcc/testsuite/ PR testsuite/79920 * gcc.dg/vect/pr79920.c: Restrict reduction test to vect_double. Index: gcc/testsuite/gc

[PATCH] use shasum instead of sha512sum on FreeBSD and DragonFly

2018-01-15 Thread Jonathan Wakely
boru on Freenode's #gcc channel pointed out that contrib/download_prerequisites should use shasum for FreeBSD, not sha512sum (which comes from GNU coreutils on GNU/Linux). I checked FreeBSD 11.0 and 10.2 and neither has sha512sum, not does DragonFly 4.2, another FreeBSD derivative. OK for trunk?

Re: [PATCH v2, rs6000] Add -msafe-indirect-jumps option and implement safe bctr / bctrl

2018-01-15 Thread Bill Schmidt
On Jan 15, 2018, at 3:46 AM, Richard Biener wrote: > > On Sun, Jan 14, 2018 at 5:53 AM, Bill Schmidt > wrote: >> Hi, >> >> [This patch supercedes and extends >> https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01135.html. >> There was a small error in the assembly code produced by that patch (bad

[PATCH][i386] Fix PR83546 - missing RDRND for -march=silvermont

2018-01-15 Thread Peryt, Sebastian
Hi, This patch re-enables RDRND for Silvermont. It got lost in r206178 as pointed out in PR. Bootstraped and tested. 2018-01-15 Sebastian Peryt gcc/ PR target/83546 * config/i386/i386.c (ix86_option_override_internal): Add PTA_RDRND to PTA_SILVERMONT. 2018-01-15 Se

[PATCH][ARM] Use utxb rN, rM, ror #8 to implement zero_extract on armv6.

2018-01-15 Thread Roger Sayle
I was hoping I could ask an ARM backend maintainer to look over the following patch. I was examining the code generated for the following C snippet on a raspberry pi, static inline int popcount_lut8(unsigned *buf, int n) { int cnt=0; unsigned int i; do { i = *buf; cnt += lut[i&255]

[PATCH] PR libstdc++/83830 Define std::has_unique_object_representations_v

2018-01-15 Thread Jonathan Wakely
Add this missing C++17 variable template. PR libstdc++/83830 * include/std/type_traits (has_unique_object_representations_v): Add variable template. * testsuite/20_util/has_unique_object_representations/value.cc: Check variable template. Tested powerpc64le

Re: [PATCH] C/C++: Add -Waddress-of-packed-member

2018-01-15 Thread H.J. Lu
On Mon, Jan 15, 2018 at 1:42 AM, Jakub Jelinek wrote: > On Sun, Jan 14, 2018 at 06:29:54AM -0800, H.J. Lu wrote: >> + if (TREE_CODE (field) == FIELD_DECL && DECL_PACKED (field)) >> + { >> + tree field_type = TREE_TYPE (field); >> + unsigned int type_align = TYPE_A

Re: [PATCH, rs6000] Support for gimple folding of mergeh, mergel intrinsics

2018-01-15 Thread Segher Boessenkool
Hi Will, On Fri, Jan 12, 2018 at 03:22:06PM -0600, Will Schmidt wrote: > Add support for gimple folding of the mergeh, mergel intrinsics. > Since the merge low and merge high variants are almost identical, a > new helper function has been added so that code can be shared. > > This also adds def

Don't group gather loads (PR83847)

2018-01-15 Thread Richard Sandiford
In the testcase we were trying to group two gather loads, even though that isn't supported. Fixed by explicitly disallowing grouping of gathers and scatters. This problem didn't show up on SVE because there we convert to IFN_GATHER_LOAD/IFN_SCATTER_STORE pattern statements, which fail the can_gro

Re: [PATCH] Fix PR83435

2018-01-15 Thread Szabolcs Nagy
On 11/01/18 13:41, Richard Biener wrote: > 2018-01-11 Richard Biener > > PR tree-optimization/83435 > * graphite.c (canonicalize_loop_form): Ignore fake loop exit edges. > * graphite-scop-detection.c (scop_detection::get_sese): Likewise. > * tree-vrp.c (add_assert_info):

Re: [PATCH][i386] Fix PR83546 - missing RDRND for -march=silvermont

2018-01-15 Thread Uros Bizjak
On Mon, Jan 15, 2018 at 2:50 PM, Peryt, Sebastian wrote: > Hi, > > This patch re-enables RDRND for Silvermont. It got lost in r206178 as pointed > out in PR. > Bootstraped and tested. > > 2018-01-15 Sebastian Peryt > > gcc/ > > PR target/83546 > * config/i386/i386.c (ix86_optio

Re: [PATCH v2, rs6000] Add -msafe-indirect-jumps option and implement safe bctr / bctrl

2018-01-15 Thread Segher Boessenkool
Hi! On Sat, Jan 13, 2018 at 10:53:57PM -0600, Bill Schmidt wrote: > This patch adds a new option for the compiler to produce only "safe" indirect > jumps, in the sense that these jumps are deliberately mispredicted to inhibit > speculative execution. For now, this option is undocumented; this may

[PATCH] i386: Don't use ASM_OUTPUT_DEF for TARGET_MACHO

2018-01-15 Thread H.J. Lu
ASM_OUTPUT_DEF isn't defined for TARGET_MACHO. Use ASM_OUTPUT_LABEL to generate the __x86_return_thunk label, instead of the set directive. Update testcase to remove the __x86_return_thunk label check. Since -fno-pic is ignored on Darwin, update testcases to sscan or "push" only on Linux. Tested

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-15 Thread H.J. Lu
On Mon, Jan 15, 2018 at 3:38 AM, H.J. Lu wrote: > On Mon, Jan 15, 2018 at 12:31 AM, Richard Biener > wrote: >> On Sun, Jan 14, 2018 at 4:08 PM, H.J. Lu wrote: >>> Now my patch set has been checked into trunk. Here is a patch set >>> to move struct ix86_frame to machine_function on GCC 7, which

Re: [PATCH 3/5] x86: Add -mindirect-branch-register

2018-01-15 Thread Uros Bizjak
On Mon, Jan 15, 2018 at 4:05 AM, H.J. Lu wrote: > On Sun, Jan 14, 2018 at 1:23 PM, H.J. Lu wrote: >> On Sun, Jan 14, 2018 at 10:52 AM, Uros Bizjak wrote: >>> On Sun, Jan 14, 2018 at 7:08 PM, H.J. Lu wrote: On Sun, Jan 14, 2018 at 9:51 AM, Uros Bizjak wrote: > - (ior (and (not (match_

Re: [PATCH, rs6000] Executable tests for -msafe-indirect-jumps

2018-01-15 Thread Segher Boessenkool
Hi! On Sun, Jan 14, 2018 at 11:34:06AM -0600, Bill Schmidt wrote: > It was pointed out off-list that I should add some executable tests for > the new -msafe-indirect-jumps implementation. This patch adds three > such tests to demonstrate correct behavior. > > Tested on powerpc64-linux-gnu and po

Re: [PATCH, rs6000] Executable tests for -msafe-indirect-jumps

2018-01-15 Thread Bill Schmidt
On Jan 15, 2018, at 11:05 AM, Segher Boessenkool wrote: > > Hi! > > On Sun, Jan 14, 2018 at 11:34:06AM -0600, Bill Schmidt wrote: >> It was pointed out off-list that I should add some executable tests for >> the new -msafe-indirect-jumps implementation. This patch adds three >> such tests to d

Re: [PATCH 2/2] Fix unstable sort

2018-01-15 Thread Cory Fields
Thanks! Cory On Jan 15, 2018 1:06 AM, "Jeff Law" wrote: > On 01/12/2018 01:58 PM, li...@coryfields.com wrote: > > From: Cory Fields > > > > 2018-01-12 Cory Fields > >* tree-ira.c (allocno_hard_regs_compare): stabilize sort > Thanks. I fixed the ChangeLog entry and installed hte pat

Re: [PATCH, rs6000] Support for gimple folding of mergeh, mergel intrinsics

2018-01-15 Thread Will Schmidt
On Mon, 2018-01-15 at 10:24 +, Richard Sandiford wrote: > >> + for (int i = 0; i < midpoint; i++) > >> +{ > >> + tree tmp1 = build_int_cst (lhs_type_type, offset + i); > >> + tree tmp2 = build_int_cst (lhs_type_type, offset + n_elts + > i); > >> + CONSTRUCTOR_APPEND_ELT (cto

Re: [PATCH, rs6000] Support for gimple folding of mergeh, mergel intrinsics

2018-01-15 Thread Will Schmidt
On Mon, 2018-01-15 at 09:08 -0600, Segher Boessenkool wrote: > Hi Will, > > On Fri, Jan 12, 2018 at 03:22:06PM -0600, Will Schmidt wrote: > > Add support for gimple folding of the mergeh, mergel intrinsics. > > Since the merge low and merge high variants are almost identical, a > > new helper fu

Re: [PATCH, rs6000] Support for gimple folding of mergeh, mergel intrinsics

2018-01-15 Thread Segher Boessenkool
On Mon, Jan 15, 2018 at 11:29:50AM -0600, Will Schmidt wrote: > > How do these two differ? The xx variant can write all 64 VSR registers, > > it needs different constraints (wa?). Can the two patterns be merged? > > It doesn't need the TARGET_P8_VECTOR condition then: the constraints > > will han

Re: [PATCH v2, rs6000] Add -msafe-indirect-jumps option and implement safe bctr / bctrl

2018-01-15 Thread Bill Schmidt
Hi Segher, Thanks for the quick review! > On Jan 15, 2018, at 10:38 AM, Segher Boessenkool > wrote: > > Hi! > > On Sat, Jan 13, 2018 at 10:53:57PM -0600, Bill Schmidt wrote: >> This patch adds a new option for the compiler to produce only "safe" indirect >> jumps, in the sense that these jump

Re: Fwd: [PATCH] i386: Don't use ASM_OUTPUT_DEF for TARGET_MACHO

2018-01-15 Thread Jan Hubicka
> Hi Jan, > > Can you review this patch? This blocks the GCC 7 backport. > > Thanks. > > H.J. > > > -- Forwarded message -- > From: H.J. Lu > Date: Mon, Jan 15, 2018 at 8:45 AM > Subject: [PATCH] i386: Don't use ASM_OUTPUT_DEF for TARGET_MACHO > To: gcc-patches@gcc.gnu.org >

Re: [PATCH v2, rs6000] Add -msafe-indirect-jumps option and implement safe bctr / bctrl

2018-01-15 Thread Segher Boessenkool
On Mon, Jan 15, 2018 at 11:54:41AM -0600, Bill Schmidt wrote: > > I think we settled on calling the option -mmispredict-indirect-jumps; > > please let me know if you still agree with that. Or have thought of a > > better name :-) > > Looks like we are now looking at -m[no-]speculate-indirect-jump

[PATCH 4/4] i386: Rewrite indirect_branch_operand logic

2018-01-15 Thread H.J. Lu
* config/i386/predicates.md (indirect_branch_operand): Rewrite ix86_indirect_branch_register logic. --- gcc/config/i386/predicates.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index a502657f

[PATCH 2/4] x86: Rewrite ix86_indirect_branch_register logic

2018-01-15 Thread H.J. Lu
Rewrite ix86_indirect_branch_register logic with (and (not (match_test "ix86_indirect_branch_register")) (original condition before r256662)) * config/i386/predicates.md (constant_call_address_operand): Rewrite ix86_indirect_branch_register logic. (sibcall_insn_operan

[PATCH 3/4] Don't check ix86_indirect_branch_register for GOT operand

2018-01-15 Thread H.J. Lu
Since GOT_memory_operand and GOT32_symbol_operand are simple pattern matches, don't check ix86_indirect_branch_register here. If needed, -mindirect-branch= will convert indirect branch via GOT slot to a call and return thunk. * config/i386/constraints.md (Bs): Update ix86_indirect

[PATCH 1/4] i386: Rename to ix86_indirect_branch_register

2018-01-15 Thread H.J. Lu
Rename the variable for -mindirect-branch-register to ix86_indirect_branch_register to match the command-line option name. * config/i386/constraints.md (Bs): Replace ix86_indirect_branch_thunk_register with ix86_indirect_branch_register. (Bw): Likewise. * co

Re: [PATCH 3/5] x86: Add -mindirect-branch-register

2018-01-15 Thread H.J. Lu
On Mon, Jan 15, 2018 at 8:54 AM, Uros Bizjak wrote: > On Mon, Jan 15, 2018 at 4:05 AM, H.J. Lu wrote: >> On Sun, Jan 14, 2018 at 1:23 PM, H.J. Lu wrote: >>> On Sun, Jan 14, 2018 at 10:52 AM, Uros Bizjak wrote: On Sun, Jan 14, 2018 at 7:08 PM, H.J. Lu wrote: > On Sun, Jan 14, 2018 at 9

Re: Fwd: [PATCH] i386: Don't use ASM_OUTPUT_DEF for TARGET_MACHO

2018-01-15 Thread H.J. Lu
On Mon, Jan 15, 2018 at 10:00 AM, Jan Hubicka wrote: >> Hi Jan, >> >> Can you review this patch? This blocks the GCC 7 backport. >> >> Thanks. >> >> H.J. >> >> >> -- Forwarded message -- >> From: H.J. Lu >> Date: Mon, Jan 15, 2018 at 8:45 AM >> Subject: [PATCH] i386: Don't use AS

Re: [PATCH v4] Ability to remap file names in __FILE__, etc (PR other/70268)

2018-01-15 Thread Joseph Myers
On Sat, 13 Jan 2018, Boris Kolpackov wrote: > Joseph Myers writes: > > > Contrary to a previous review, you should *not* be removing RejectNegative > > from -fdebug-prefix-map=, and should be including it on both the new > > options. [...] > > > > The patch is OK with that fixed. > > Thanks

[PATCH] rs6000: Delete "delayed_cr" insn type

2018-01-15 Thread Segher Boessenkool
"delayed_cr" is just "cr_logical" with the second source operand not equal to the destination operand. This patch changes it to be expressed as type "cr_logical", with a new boolean attribute "cr_logical_3op" added. This simplifies code. Tested on powerpc64-linux {-m32,-m64}; I'll commit this la

Re: [patch, fortran] Change ABI for F2008 - minloc/maxloc BACK argument

2018-01-15 Thread Thomas Koenig
Hi Janne, Here, s/BOUND/BACK/ I presume? Yes. Also, it seems in the library some of the back arguments are by value, but some are still passed as pointers. Based on some quick grepping of the patch they seem to come from m4/iforeach.m4 (6 lines in total). With these fixes, Ok for trunk.

Go patch committed: keep variables captured by defer alive

2018-01-15 Thread Ian Lance Taylor
Local variables captured by the deferred closure need to be live until the function finishes, especially when the deferred function runs. Function::build, for functions that have a defer, wraps the function body in a try block. So the backend sees the local variables only live in the try block, wi

Go patch committed: Reclaim memory of escape analysis Nodes

2018-01-15 Thread Ian Lance Taylor
This patch by Cherry Zhang fixes the Go frontend to reclaim the memory of escape analysis Nodes before kicking off the backend, as they are not needed in get_backend. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE =

gcc-patches@gcc.gnu.org

2018-01-15 Thread Jonathan Wakely
The chi_squared_distribution::param(const param&) function should also update the parameters of the gamma_distribution member. PR libstdc++/83833 * include/bits/random.h (chi_squared_distribution::param): Update gamma distribution parameter. * testsuite/26_numerics

Re: [PATCH 3/5] x86: Add -mindirect-branch-register

2018-01-15 Thread Uros Bizjak
On Mon, Jan 15, 2018 at 7:11 PM, H.J. Lu wrote: > On Mon, Jan 15, 2018 at 8:54 AM, Uros Bizjak wrote: >> On Mon, Jan 15, 2018 at 4:05 AM, H.J. Lu wrote: >>> On Sun, Jan 14, 2018 at 1:23 PM, H.J. Lu wrote: On Sun, Jan 14, 2018 at 10:52 AM, Uros Bizjak wrote: > On Sun, Jan 14, 2018 at 7

Re: [PATCH] use shasum instead of sha512sum on FreeBSD and DragonFly

2018-01-15 Thread Andreas Tobler
On 15.01.18 13:59, Jonathan Wakely wrote: boru on Freenode's #gcc channel pointed out that contrib/download_prerequisites should use shasum for FreeBSD, not sha512sum (which comes from GNU coreutils on GNU/Linux). I checked FreeBSD 11.0 and 10.2 and neither has sha512sum, not does DragonFly 4.2,

[PATCH] Drop unused parameter of insert_save()

2018-01-15 Thread A. Skrobov
The only caller passes `before_p=1`, and I cannot imagine a use case for it with `before_p=0` 2018-01-15 Artyom Skrobov tyomi...@gmail.com * caller-save.c: Drop unused parameter of insert_save() --- gcc/caller-save.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff -

[PATCH] Fix warn_if_not_align ICE (PR c/83844)

2018-01-15 Thread Jakub Jelinek
Hi! As the testcase shows, handle_warn_if_not_align ICEs on fields with types with warn_if_not_align attribute in variable length structures. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2018-01-15 Jakub Jelinek PR c/83844 * stor-layout.c

[PATCH] Fix store-merging for ~ of bswap (PR tree-optimization/83843)

2018-01-15 Thread Jakub Jelinek
Hi! When using the bswap pass infrastructure, BIT_NOT_EXPRs aren't allowed in the middle, but due to the way process_store handles those it can appear around the value, which is something output_merged_store didn't handle. Fixed thusly, where we handle not just the case when the bswap (or nop) va

[C++ PATCH] Fix ICE in member_vec_dedup (PR c++/83825)

2018-01-15 Thread Jakub Jelinek
Hi! As the testcase shows, calls to member_vec_dedup and qsort are just guarded by the vector being non-NULL, which doesn't mean it must be non-empty, so we can't do (*member_vec)[0] on it. Fixed by the second hunk, the rest is just a small cleanup to use the vec.h methods. Bootstrapped/regteste

[committed] Fix OpenMP atomic expansion (PR middle-end/83837)

2018-01-15 Thread Jakub Jelinek
Hi! As the patch shows, expand_omp_atomic* was relying on the gimple_omp_atomic_load_rhs () pointer to be pointer to the type we want to atomically load. That doesn't work too well, because pointer conversions are useless in GIMPLE and so we can end up with a pointer to a different type like void

[committed] xfail two assertions due to bug 74762 (PR 83869)

2018-01-15 Thread Martin Sebor
The c-c++-common/attr-nonstring-3.c test has run afoul of c++ bug 74762 (missing uninitialized warning (C++, parenthesized expr, TREE_NO_WARNING)). Until that bug is fixed, I've committed r256709 and xfailed the two assertions that started failing after r256683, as a result of gating middle-end w

[PATCH] Preserve CROSSING_JUMP_P in peephole2 (PR rtl-optimization/83213)

2018-01-15 Thread Jakub Jelinek
Hi! On the testcase in the PR (too large and creduce not making sufficient progress) we ICE because i386.md: ;; Combining simple memory jump instruction (define_peephole2 [(set (match_operand:W 0 "register_operand") (match_operand:W 1 "memory_operand")) (set (pc) (match_dup 0))] "!

[C++ PATCH] Fix checking ICE in pt.c (PR c++/83817)

2018-01-15 Thread Jakub Jelinek
Hi! function in this case can be either a CALL_EXPR or AGGR_INIT_EXPR. CALL_FROM_THUNK_P macro is defined in tree.h and so knows just about the generic CALL_EXPR, and the C++ FE adds AGGR_INIT_FROM_THUNK_P macro, which is defined the same (protected_flag) except for the checking, one requires a CA

[PATCH] Bump minimum value for max-sched-ready-insns param to 1 (PR rtl-optimization/86620)

2018-01-15 Thread Jakub Jelinek
Hi! This param allows minimum of 0, which doesn't make much sense. On the i386/pr83620.c test (when used with the =0 value) we ICE because ix86_adjust_priority which has code to prevent moving of likely spilled hard regs doesn't have a chance to do anything, since we don't consider any other insns

Re: [PATCH] rs6000: Wrap diff of immediates in const (PR83629)

2018-01-15 Thread Segher Boessenkool
On Wed, Jan 10, 2018 at 02:55:07PM +, Segher Boessenkool wrote: > In various of our 32-bit load_toc patterns we take the difference of > two immediates (labels) as a term to something bigger; but this isn't > canonical RTL, it needs to be wrapped in CONST. > > This fixes it. Tested on powerpc

[PATCH v3, rs6000] Add -mspeculate-indirect-jumps option and implement non-speculating bctr / bctrl

2018-01-15 Thread Bill Schmidt
Hi, This patch supercedes v2: https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01204.html, and fixes the problems noted in its review. It also adds the test cases from https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01261.html and adjusts them according to the results of the review. There is more f

[PATCH 0/5] GCC 7: x86: CVE-2017-5715, aka Spectre

2018-01-15 Thread H.J. Lu
This set of patches for GCC 7, backported from trunk, mitigates variant #2 of the speculative execution vulnerabilities on x86 processors identified by CVE-2017-5715, aka Spectre. They convert indirect branches and function returns to call and return thunks to avoid speculative execution via indir

[PATCH 5/5] GCC 7: x86: Disallow -mindirect-branch=/-mfunction-return= with -mcmodel=large

2018-01-15 Thread H.J. Lu
Since the thunk function may not be reachable in large code model, -mcmodel=large is incompatible with -mindirect-branch=thunk, -mindirect-branch=thunk-extern, -mfunction-return=thunk and -mfunction-return=thunk-extern. Issue an error when they are used with -mcmodel=large. gcc/ Backport

[PATCH 4/5] GCC 7: x86: Add 'V' register operand modifier

2018-01-15 Thread H.J. Lu
Add 'V', a special modifier which prints the name of the full integer register without '%'. For extern void (*func_p) (void); void foo (void) { asm ("call __x86_indirect_thunk_%V0" : : "a" (func_p)); } it generates: foo: movqfunc_p(%rip), %rax call__x86_indirect_thunk

[PATCH 3/5] GCC 7: x86: Add -mindirect-branch-register

2018-01-15 Thread H.J. Lu
Add -mindirect-branch-register to force indirect branch via register. This is implemented by disabling patterns of indirect branch via memory, similar to TARGET_X32. -mindirect-branch= and -mfunction-return= tests are updated with -mno-indirect-branch-register to avoid false test failures when -mi

[PATCH 2/5] GCC 7: x86: Add -mfunction-return=

2018-01-15 Thread H.J. Lu
Add -mfunction-return= option to convert function return to call and return thunks. The default is 'keep', which keeps function return unmodified. 'thunk' converts function return to call and return thunk. 'thunk-inline' converts function return to inlined call and return thunk. 'thunk-extern' co

[PATCH 1/5] GCC 7: x86: Add -mindirect-branch=

2018-01-15 Thread H.J. Lu
Add -mindirect-branch= option to convert indirect call and jump to call and return thunks. The default is 'keep', which keeps indirect call and jump unmodified. 'thunk' converts indirect call and jump to call and return thunk. 'thunk-inline' converts indirect call and jump to inlined call and re

GCC 7 backport [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-15 Thread H.J. Lu
On Mon, Jan 15, 2018 at 8:53 AM, H.J. Lu wrote: > On Mon, Jan 15, 2018 at 3:38 AM, H.J. Lu wrote: >> On Mon, Jan 15, 2018 at 12:31 AM, Richard Biener >> wrote: >>> On Sun, Jan 14, 2018 at 4:08 PM, H.J. Lu wrote: Now my patch set has been checked into trunk. Here is a patch set to mov

Fortran, committed: ICE on CLASS(*) function result (pr 82257)

2018-01-15 Thread Louis Krupp
Fixed in revision 256720.

Re: [C++ PATCH] Fix checking ICE in pt.c (PR c++/83817)

2018-01-15 Thread Jason Merrill
OK. On Mon, Jan 15, 2018 at 4:58 PM, Jakub Jelinek wrote: > Hi! > > function in this case can be either a CALL_EXPR or AGGR_INIT_EXPR. > CALL_FROM_THUNK_P macro is defined in tree.h and so knows just about the > generic CALL_EXPR, and the C++ FE adds AGGR_INIT_FROM_THUNK_P macro, which > is defin

Re: [C++ PATCH] Fix ICE in member_vec_dedup (PR c++/83825)

2018-01-15 Thread Jason Merrill
OK. On Mon, Jan 15, 2018 at 4:46 PM, Jakub Jelinek wrote: > Hi! > > As the testcase shows, calls to member_vec_dedup and qsort are just guarded > by the vector being non-NULL, which doesn't mean it must be non-empty, > so we can't do (*member_vec)[0] on it. Fixed by the second hunk, the > rest i

Re: [PATCH] handle multiple flexible array members (PR 83588)

2018-01-15 Thread Jason Merrill
OK. On Sun, Jan 14, 2018 at 6:47 PM, Martin Sebor wrote: > The attached patch fixes PR c++/83588 - struct with two flexible > arrays causes an internal compiler error. The ICE is caused by > the same assertion in varasm.c that has led to other similar > reports in the past: > > /* Given a non-

[PATCH] RISC-V: Increase mult/div cost if not implemented in hardware.

2018-01-15 Thread Jim Wilson
This increases the cost of multiply and divide when not present. This makes it more likely that a multiply by constant gets replaced by a sequence of shift and adds which is faster than a call to a libgcc routine. The divide cost change doesn't do anything useful at present, but is added for cons

Re: [PATCH] handle multiple flexible array members (PR 83588)

2018-01-15 Thread Martin Sebor
On 01/15/2018 07:10 PM, Jason Merrill wrote: OK. Thanks. I keep forgetting to get approval to backport these simple bug fixes. Is this one okay for the 7 and 6 branches? Martin On Sun, Jan 14, 2018 at 6:47 PM, Martin Sebor wrote: The attached patch fixes PR c++/83588 - struct with two f

[PATCH, doc] NDS32: Add -mext-perf -mext-perf2 and -mext-string in the documentation

2018-01-15 Thread Chung-Ju Wu
Hi, all, In this patch of nds32 port: https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01585.html We add new options for NDS32 target. So we need to update documentation as well. The patch is attached and the plaintext ChangeLog is as follow: gcc/ChangeLog * doc/invoke.texi (NDS32 Options

Re: [PATCH] handle multiple flexible array members (PR 83588)

2018-01-15 Thread Jason Merrill
On Mon, Jan 15, 2018 at 10:05 PM, Martin Sebor wrote: > On 01/15/2018 07:10 PM, Jason Merrill wrote: >> >> OK. > > Thanks. I keep forgetting to get approval to backport these > simple bug fixes. Is this one okay for the 7 and 6 branches? Yes. Jason

Re: [PATCH][arm] XFAIL advsimd-intrinsics/vld1x2.c

2018-01-15 Thread Kugan Vivekanandarajah
Hi Kyrill, Sorry for the breakage and thanks for fixing the testcase. Thanks, Kugan On 12 January 2018 at 02:33, Kyrill Tkachov wrote: > Hi all, > > This recently added test fails on arm. We haven't implemented these > intrinsics for arm > (any volunteers?) so for now let's XFAIL these on that

Re: GCC 7 backport [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-15 Thread Jan Hubicka
> On Mon, Jan 15, 2018 at 8:53 AM, H.J. Lu wrote: > > On Mon, Jan 15, 2018 at 3:38 AM, H.J. Lu wrote: > >> On Mon, Jan 15, 2018 at 12:31 AM, Richard Biener > >> wrote: > >>> On Sun, Jan 14, 2018 at 4:08 PM, H.J. Lu wrote: > Now my patch set has been checked into trunk. Here is a patch set

  1   2   >