Re: match.pd handling of three-constant bitops

2018-01-02 Thread Richard Sandiford
Richard Biener writes: > On Thu, Sep 21, 2017 at 1:17 PM, Richard Sandiford > wrote: >> Richard Biener writes: >>> On Wed, Sep 20, 2017 at 2:18 PM, Richard Sandiford >>> wrote: natch.pd tries to reassociate two bit operations if both of them have constant operands. However, with the

Re: PR82665 - missing value range optimization for memchr

2018-01-02 Thread Prathamesh Kulkarni
On 3 January 2018 at 12:33, Prathamesh Kulkarni wrote: > On 2 January 2018 at 17:49, Jakub Jelinek wrote: >> On Tue, Jan 02, 2018 at 05:39:17PM +0530, Prathamesh Kulkarni wrote: >>> --- /dev/null >>> +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr82665.c >>> @@ -0,0 +1,22 @@ >>> +/* { dg-do compile } */ >

Re: PR82665 - missing value range optimization for memchr

2018-01-02 Thread Prathamesh Kulkarni
On 2 January 2018 at 17:49, Jakub Jelinek wrote: > On Tue, Jan 02, 2018 at 05:39:17PM +0530, Prathamesh Kulkarni wrote: >> --- /dev/null >> +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr82665.c >> @@ -0,0 +1,22 @@ >> +/* { dg-do compile } */ >> +/* { dg-options "-O2 -fdump-tree-optimized" } */ >> + >> +vo

PR83648

2018-01-02 Thread Prathamesh Kulkarni
Hi, malloc_candidate_p() in ipa-pure-const misses detecting that a function is malloc-like if the return value is result of PHI and one of the arguments of PHI is 0. For example: void g(unsigned n) { return (n) ? __builtin_malloc (n) : 0; } The reason is that the following check: if (TREE_CODE

Re: Fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders

2018-01-02 Thread Ed Smith-Rowland
On 01/02/2018 04:41 PM, Michele Pezzutti wrote: On 01/02/2018 05:59 PM, Ed Smith-Rowland wrote: OK, on *third* look summing up to k = nu/2 at minimum will a achieve the result of not blowing up the asymptotic series: nu^2 - (2k-1)^2.  And it will do that without a check. This stopping crite

update config.guess/sub

2018-01-02 Thread Ben Elliston
It's a new year, time to update these scripts. Ben 2018-01-03 Ben Elliston * config.guess: Import latest version. * config.sub: Likewise. Index: config.guess === --- config.guess(revision 256121) +++ con

Re: [Patch, fortran] PR83076 - [8 Regression] ICE in gfc_deallocate_scalar_with_status, at fortran/trans.c:1598

2018-01-02 Thread Damian Rouson
I have now confirmed that the patch works the same for the 7 branch: it doesn’t break any previously passing tests.   Damian On January 1, 2018 at 9:44:59 AM, Paul Richard Thomas (paul.richard.tho...@gmail.com) wrote: Committed to trunk as revision 256065. Damian, it would be good if you wo

Re: [patch, fortran] Implement simplification of minloc and maxloc

2018-01-02 Thread Damian Rouson
  On January 2, 2018 at 10:02:01 AM, Paul Richard Thomas (paul.richard.tho...@gmail.com(mailto:paul.richard.tho...@gmail.com)) wrote: > Somewhere, I have a list of situations where finalization is required > but not yet implemented. I'll dig it out and post it on the list. PR 37336 has a

Re: [PATCH] Handle noipa attribute in IPA visibility (PR ipa/83594).

2018-01-02 Thread Jeff Law
On 12/27/2017 07:14 AM, Martin Liška wrote: > Hi. > > As we introduced noipa attribute, I believe proper fix to not to crash > is to ignore all functions with the attribute in iteration of IPA visibility > pass. > > Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. > > R

Re: [PATCH] avoid using %lli et al.

2018-01-02 Thread Jeff Law
On 12/20/2017 05:28 PM, Martin Sebor wrote: > On 12/20/2017 05:07 PM, Richard Sandiford wrote: >> Martin Sebor  writes: >>> The attached patch replaces use of %lli and %llu with >>> HOST_WIDE_INT_PRINT_DEC and HOST_WIDE_INT_PRINT_UNSIGNED >>> for portability, and also replaces wide_int::to_shwi() w

Re: [PATCH] avoid -Wsuggest-attribute=const for void functions (PR 83559)

2018-01-02 Thread Jeff Law
On 01/01/2018 05:50 PM, Martin Sebor wrote: > Among the recent -Wattributes enhancements is to diagnose > declarations of void functions with attribute const or pure. > Declaring a void function const or pure means that calls to > the function have no effect and could be (and, with > optimization, 

Re: [5/4] Directly operate on CONST_VECTOR encoding

2018-01-02 Thread Jeff Law
On 01/02/2018 08:26 AM, Richard Sandiford wrote: > This patch makes some pieces of code operate directly on the new > CONST_VECTOR encoding. Sorry for the late posting, I'd forgotten > to include the patch when sending the original series. > > Tested as before. > > Thanks, > Richard > > > 2018

Re: [PATCH] exempt invalid built-in calls from -Wrestrict (PR 83655)

2018-01-02 Thread Jeff Law
On 01/02/2018 04:02 PM, Martin Sebor wrote: > In addition to assuming that built-in functions are called with > the correct number of arguments (bug 83603), the restrict pass > also assumes that they are called with arguments of the expected > types.  When a built-in is declared with no prototype a

Re: [PATCH] handle invalid calls to built-ins with no prototype (PR 83603)

2018-01-02 Thread Jeff Law
On 01/01/2018 05:58 PM, Martin Sebor wrote: > The -Wrestrict code assumes that built-ins are called with > the correct number of arguments.  When this isn't so it > crashes.  The attached patch avoids the ICE due to this > error. > > There are outstanding assumptions that the type of actual > argu

Re: [PATCH] constrain strcat destination offset (PR 83642)

2018-01-02 Thread Jeff Law
On 01/02/2018 10:27 AM, Martin Sebor wrote: > On 01/02/2018 09:44 AM, Jeff Law wrote: >> On 01/02/2018 02:57 AM, Jakub Jelinek wrote: >>> On Mon, Jan 01, 2018 at 03:31:46PM -0700, Martin Sebor wrote: The ICE in the test case submitted in PR tree-optimization/83640 is triggered by the tree

Re: [PATCH] [PR target/83641] Fix incorrect CFI for stack clash protected noreturn function on x86/x86_64

2018-01-02 Thread Jeff Law
On 01/02/2018 03:05 PM, Florian Weimer wrote: > On 01/02/2018 09:02 PM, Jeff Law wrote: >> * config/i386/i386.c (ix86_adjut_stack_and_probe_stack_clash): Do not > > Typo: “adjut”. > >> explicitly probe *sp in a noreturn function if there were any callee >> register saves. > > I recom

[PATCH] exempt invalid built-in calls from -Wrestrict (PR 83655)

2018-01-02 Thread Martin Sebor
In addition to assuming that built-in functions are called with the correct number of arguments (bug 83603), the restrict pass also assumes that they are called with arguments of the expected types. When a built-in is declared with no prototype and called with arguments of the wrong type (such as

Re: [PATCH][rs6000][PR target/82190] fix mem size info in rtl generated by memcmp and strncmp/strcmp builtin expansion

2018-01-02 Thread Aaron Sawdey
On Tue, 2017-12-12 at 14:12 -0600, Segher Boessenkool wrote: > That looks better :-) Okay for trunk, thanks! As we discussed on IRC before christmas, I've simplified this to use TARGET_EFFICIENT_UNALIGNED_VSX instead of checking explicitly for P8/P9 processors. Has the same effect but is cleaner/

Re: [PATCH, rs6000] Don't optimize swaps when a swap has mixed use

2018-01-02 Thread Bill Schmidt
Segher was kind enough to give me an offline review on his vacation. I made some small changes and committed the following. Thanks! Bill 2018-01-02 Bill Schmidt * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store): New function. (rs6000_analyze_swaps): Mar

Re: [patch, fortran, committed] Fix PR 83650 on gcc-7

2018-01-02 Thread Thomas Koenig
Am 02.01.2018 um 19:00 schrieb Thomas Koenig: Hello world, I have committed the patch below as obvious to fix the same bug on gcc-7 that my recent patch fixed on trunk. ... of course, better with a patch which includes the changes instead of the ChangeLog entries: Index: fortran/simplify.c ==

Re: [PATCH] [PR target/83641] Fix incorrect CFI for stack clash protected noreturn function on x86/x86_64

2018-01-02 Thread Florian Weimer
On 01/02/2018 09:02 PM, Jeff Law wrote: * config/i386/i386.c (ix86_adjut_stack_and_probe_stack_clash): Do not Typo: “adjut”. explicitly probe *sp in a noreturn function if there were any callee register saves. I recompiled glibc with this patch, and I can confirm it

Re: Fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders

2018-01-02 Thread Michele Pezzutti
On 01/02/2018 05:59 PM, Ed Smith-Rowland wrote: OK, on *third* look summing up to k = nu/2 at minimum will a achieve the result of not blowing up the asymptotic series: nu^2 - (2k-1)^2.  And it will do that without a check. This stopping criterion should work even near x=nu which would be th

[C++ PATCH] Improve code generation for static_cast of pointers to reference types (PR c++/83555)

2018-01-02 Thread Jakub Jelinek
Hi! This patch improves code generated for: struct A { int a; }; struct B { int b; }; struct C : A, B { int c; }; C *bar (B *b) { return &static_cast(*b); } Unlike return static_cast(b); where b can be validly NULL, the reference shouldn't bind to NULL, but we still emit b ? b - 4 : 0. The follow

[C++ PATCH] Fix ICE in ~macro_use_before_def (PR preprocessor/83602)

2018-01-02 Thread Jakub Jelinek
Hi! If lookup_name_fuzzy finds an exact match with a macro, it later in the dtor uses node->value.macro->line in libcpp. The problem is that for builtin macros node->value.macro contains garbage, we use node->value.builtin union member in those cases instead. It doesn't make any sense to look up

[PATCH] RISC-V: Fix for icache flush issue on multicore processors.

2018-01-02 Thread Jim Wilson
The gcc-7-branch version of the patch, tested same as the mainline patch. Committed. gcc/ * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New. * config/riscv/riscv.md (clear_cache): Use it. --- gcc/config/riscv/linux.h | 2 ++ gcc/config/riscv/riscv.md | 6 ++ 2 files cha

[C++ PATCH] Avoid NOP_EXPRs with error_mark_node operand (PR c++/83634)

2018-01-02 Thread Jakub Jelinek
Hi! The gimplifier uses in several places STRIP_USELESS_TYPE_CONVERSION and that, being primarily a middle-end predicate, doesn't like error_mark_nodes appearing in conversion operands. I've talked about it with Richi on IRC and he'd prefer not to change it. The reason we end up with them is bec

[PATCH] RISC-V: Fix for icache flush issue on multicore processors.

2018-01-02 Thread Jim Wilson
The RISC-V ISA defines fence.i as flushing the icache on the current hart (hardware thread, aka core) and not on any other hart. If the linux kernel moves a process to a different hart in between writes to code, and the following fence.i instruction, then the result is indeterminate. To fix this,

Re: [PATCH] PR libgfortran/83649 Chunk large reads and writes

2018-01-02 Thread Janne Blomqvist
On Tue, Jan 2, 2018 at 4:15 PM, Thomas Koenig wrote: > Hi Janne, > >> +#define MAX_CHUNK 2147479552 > > > Two things to discuss: > > Should this also be backported to the 7-branch? Probably yes. Is the 6 branch still active? If so, maybe that one as well. > Also, we could set the default subreco

Re: [PATCH] Expensive selftests: torture testing for fix-it boundary conditions (PR c/82050)

2018-01-02 Thread Andreas Schwab
/daten/gcc/gcc-20180101/gcc/testsuite/gcc.dg/plugin/expensive_selftests_plugin.c:175:1: warning: no return statement in function returning non-void [-Wreturn-type] Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now

Re: [PATCH, rs6000] Add additional builtin tests

2018-01-02 Thread Andreas Schwab
http://gcc.gnu.org/ml/gcc-testresults/2018-01/msg00089.html FAIL: gcc.target/powerpc/builtins-2.c execution test Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: [PATCH, rs6000] Add missing builtin functionality and tests

2018-01-02 Thread Andreas Schwab
FAIL: gcc.target/powerpc/altivec-7-be.c (test for excess errors) Excess errors: /daten/gcc/gcc-20180101/gcc/testsuite/gcc.target/powerpc/altivec-7.h:20:7: error: expected ';' before 'double' /daten/gcc/gcc-20180101/gcc/testsuite/gcc.target/powerpc/altivec-7.h:46:16: error: incompatible types when

Re: [PATCH, rs6000] Add missing builtin functionality and tests

2018-01-02 Thread Andreas Schwab
http://gcc.gnu.org/ml/gcc-testresults/2018-01/msg00089.html FAIL: gcc.target/powerpc/altivec-13.c (test for excess errors) Excess errors: /daten/gcc/gcc-20180101/gcc/testsuite/gcc.target/powerpc/altivec-13.c:24:3: error: use of 'long long' in AltiVec types is invalid without '-mvsx' /daten/gcc/gc

[PATCH] [PR target/83641] Fix incorrect CFI for stack clash protected noreturn function on x86/x86_64

2018-01-02 Thread Jeff Law
This time with the patch. Forwarded Message Subject: [PATCH] [PR target/83641] Fix incorrect CFI for stack clash protected noreturn function on x86/x86_64 Date: Tue, 2 Jan 2018 11:58:04 -0700 From: Jeff Law To: gcc-patches Oh how I sometimes wish we'd never opened the can o

Re: [PATCH] Remove out-of-date comment

2018-01-02 Thread Jeff Law
On 12/29/2017 01:01 AM, A. Skrobov wrote: > As of currently, `-fmessy-debugging` is not a valid option, nor is > `REG_USERVAR` looked at by the splitting logic. > > 2017-12-29 Artyom Skrobov tyomi...@gmail.com > > * web.c: Remove out-of-date comment Thanks. Committed. jeff

Re: RFA: Fix REG_ARGS_SIZE handling when pushing TLS addresses

2018-01-02 Thread Jeff Law
On 12/28/2017 01:37 PM, Richard Sandiford wrote: > Andreas Schwab writes: >> On Dez 23 2017, Richard Sandiford wrote: >>> gcc/ >>> * expr.c (fixup_args_size_notes): Check that any existing >>> REG_ARGS_SIZE notes are correct, and don't try to re-add them. >>> (emit_single_push_insn_1)

[PATCH] [PR target/83641] Fix incorrect CFI for stack clash protected noreturn function on x86/x86_64

2018-01-02 Thread Jeff Law
Oh how I sometimes wish we'd never opened the can of worms WRT stack clash protection of noreturn functions. In this BZ we have a noreturn function. So we trigger the special bits to emit a push/pop sequence to explicitly probe *sp. For ia32 we push/pop %esi. The pop %esi tells the generic CFI

Re: [07/13] Make vec_perm_indices use new vector encoding

2018-01-02 Thread Richard Sandiford
Richard Biener writes: > On Wed, Dec 20, 2017 at 2:48 PM, Richard Sandiford > wrote: >> Richard Biener writes: >>> On Tue, Dec 12, 2017 at 4:46 PM, Richard Sandiford >>> wrote: Richard Biener writes: > On Sun, Dec 10, 2017 at 12:20 AM, Richard Sandiford > wrote: >> This patch

Re: [patch, fortran] Implement simplification of minloc and maxloc

2018-01-02 Thread Paul Richard Thomas
Hi Thomas, Dominique has tested this patch and so, except for a few typos that I communicated to you on #gfortran, this is good for trunk. Somewhere, I have a list of situations where finalization is required but not yet implemented. I'll dig it out and post it on the list. Thanks Paul On 31

[patch, fortran, committed] Fix PR 83650 on gcc-7

2018-01-02 Thread Thomas Koenig
Hello world, I have committed the patch below as obvious to fix the same bug on gcc-7 that my recent patch fixed on trunk. 2018-01-02 Thomas Koenig PR fortran/83650 * simplify.c (gfc_simplify_cshift): Correct contition for negative shifts. 2018-01-02 Thomas Koenig

Re: [patch, fortran] Complete implementation and correction of simplification

2018-01-02 Thread Paul Richard Thomas
Hi Thomas, This looks very good. OK for trunk. Thanks Paul On 2 January 2018 at 15:53, Thomas Koenig wrote: > Hello world, > > the attached patch implements simplification for cshift completely. > It also fixes a bug where compile-time simplification was handled > incorrectly for a negative v

Re: [PATCH] constrain strcat destination offset (PR 83642)

2018-01-02 Thread Martin Sebor
On 01/02/2018 09:44 AM, Jeff Law wrote: On 01/02/2018 02:57 AM, Jakub Jelinek wrote: On Mon, Jan 01, 2018 at 03:31:46PM -0700, Martin Sebor wrote: The ICE in the test case submitted in PR tree-optimization/83640 is triggered by the tree-ssa-strlen pass transforming calls to strcat to strcpy wit

Re: Fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders

2018-01-02 Thread Ed Smith-Rowland
On 12/31/2017 09:38 PM, Michele Pezzutti wrote: Hi. This patch intends to fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders. Seehttps://gcc.gnu.org/bugzilla/show_bug.cgi?id=83566 forissue description.     * libstdc++-v3/include/tr1/bessel_function.tcc   Series

Re: [PATCH] make canonicalize_condition keep its promise

2018-01-02 Thread Aaron Sawdey
On Tue, 2017-12-19 at 16:56 -0700, Jeff Law wrote: > So the path to get_condition is reasonable. That's really all I > needed > to have verified one way or the other. > > With that in mind your patch is fine. > > I will note that I find it highly confusing that we attach a simple > loop > descri

Re: [PATCH] constrain strcat destination offset (PR 83642)

2018-01-02 Thread Jeff Law
On 01/02/2018 02:57 AM, Jakub Jelinek wrote: > On Mon, Jan 01, 2018 at 03:31:46PM -0700, Martin Sebor wrote: >> The ICE in the test case submitted in PR tree-optimization/83640 >> is triggered by the tree-ssa-strlen pass transforming calls to >> strcat to strcpy with an offset pointing to the termi

Re: Fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders

2018-01-02 Thread Michele Pezzutti
On 01/02/2018 02:28 AM, Ed Smith-Rowland wrote: I like the patch. I have a similar one in the tr29124 branch. Anyway, I got held up and I think it's good to have new folks looking into this. It looks good except that you need to uglify k. I looked at the GSL implementation, based on same

Re: [C++ PATCH] Fix replace_placeholders (PR c++/83556)

2018-01-02 Thread Nathan Sidwell
On 12/23/2017 03:28 AM, Jakub Jelinek wrote: Hi! Recently I've changed replace_placeholders to walk trees without duplicates to avoid compile time explosion with lots of nested SAVE_EXPRs. The problem as the following testcase shows is that it also prevents replacement of PLACEHOLDER_EXPRs we wa

Re: [PATCH] Change PRED_LOOP_EXIT from 85 to 92

2018-01-02 Thread Jeff Law
On 01/02/2018 04:57 AM, Martin Liška wrote: > On 12/24/2017 07:58 PM, Jeff Law wrote: >> On 12/24/2017 05:03 AM, Segher Boessenkool wrote: >>> On Sun, Dec 24, 2017 at 09:12:56AM +, Richard Sandiford wrote: Segher Boessenkool writes: > On Fri, Dec 22, 2017 at 04:53:47PM -0600, David Es

Re: C++ PATCH to add a test for c++/83644

2018-01-02 Thread Nathan Sidwell
On 01/02/2018 11:03 AM, Marek Polacek wrote: Another fixed PR, another additional test. Tested on x86_64-linux, ok for trunk? yes, thanks nathan -- Nathan Sidwell

Re: [PATCH] Fix PR83418

2018-01-02 Thread Jeff Law
On 01/02/2018 02:26 AM, Richard Biener wrote: > On Tue, 19 Dec 2017, Jeff Law wrote: > >> On 12/15/2017 09:30 AM, Richard Biener wrote: >>> On December 15, 2017 5:27:14 PM GMT+01:00, Jeff Law wrote: On 12/15/2017 01:10 AM, Richard Biener wrote: > On Thu, 14 Dec 2017, Richard Biener wrote

C++ PATCH to add a test for c++/83644

2018-01-02 Thread Marek Polacek
Another fixed PR, another additional test. Tested on x86_64-linux, ok for trunk? 2018-01-02 Marek Polacek PR c++/83644 * g++.dg/cpp1z/pr83644.C: New test. diff --git gcc/testsuite/g++.dg/cpp1z/pr83644.C gcc/testsuite/g++.dg/cpp1z/pr83644.C index e69de29bb2d..493d8c7cbe4 1006

[patch, fortran] Complete implementation and correction of simplification

2018-01-02 Thread Thomas Koenig
Hello world, the attached patch implements simplification for cshift completely. It also fixes a bug where compile-time simplification was handled incorrectly for a negative value. For PR 83650 (the wrong simplification) for the other branches I suspect a quite simple fix will be possible, which

Re: [PATCH] correct handling of offset ranges that cross PTRDIFF_MAX (PR 83640)

2018-01-02 Thread Martin Sebor
On 01/02/2018 07:25 AM, Richard Biener wrote: On Mon, Jan 1, 2018 at 11:30 PM, Martin Sebor wrote: PR tree-optimization/83640 - ice in generic_overlap at gimple-ssa-warn-restrict.c:814 highlights out a class of cases where the -Wrestrict checker assumes that the range of a pointer offset that u

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

2018-01-02 Thread Qing Zhao
Hi, I’d like to ping for the following patch: https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01454.html thanks a lot. For your reference, the first version of this patch is at: https://gcc.gnu.org/ml/gcc-patches/2017-12/msg00962.html

[5/4] Directly operate on CONST_VECTOR encoding

2018-01-02 Thread Richard Sandiford
This patch makes some pieces of code operate directly on the new CONST_VECTOR encoding. Sorry for the late posting, I'd forgotten to include the patch when sending the original series. Tested as before. Thanks, Richard 2018-01-02 Richard Sandiford gcc/ * cse.c (hash_rtx_cb): Hash o

C++ patch ping

2018-01-02 Thread Jakub Jelinek
Hi! I'd like to ping the: http://gcc.gnu.org/ml/gcc-patches/2017-12/msg01499.html - PR83556 fix replace_placeholders patch. Thanks. Jakub

Re: C++ PATCH to add a test for c++/81860

2018-01-02 Thread Nathan Sidwell
On 01/02/2018 09:36 AM, Marek Polacek wrote: This test exercising inheriting a template constructor in this PR got fixed with r251426. As I don't see any lambdas here, I thought it worth to add it. Tested on x86_64-linux, ok for trunk? 2018-01-02 Marek Polacek PR c++/81860

C++ PATCH to fix bogus warning with a non-type argument (PR c++/82541)

2018-01-02 Thread Marek Polacek
This PR complains about a bogus -Wduplicated-branches warning with a non-type template argument. That can be easily fixed with a new sentinel. I also noticed a missing tf_warning warning check, so I added it for good measure. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2018-01-02 Mar

[C++ PATCH] tiny code cleanup

2018-01-02 Thread Nathan Sidwell
In working on c++/83160 I came across this use-once set-to-constant 'variable'. It made me go looking for a non-existent change to it, so I'm eliding it. nathan -- Nathan Sidwell 2018-01-02 Nathan Sidwell * constexpr.c (cxx_bind_parameters_in_call): Remove unneeded local lval var. Index

C++ PATCH to add a test for c++/81860

2018-01-02 Thread Marek Polacek
This test exercising inheriting a template constructor in this PR got fixed with r251426. As I don't see any lambdas here, I thought it worth to add it. Tested on x86_64-linux, ok for trunk? 2018-01-02 Marek Polacek PR c++/81860 * g++.dg/cpp0x/inh-ctor30.C: New test. --- g

Re: [PATCH] correct handling of offset ranges that cross PTRDIFF_MAX (PR 83640)

2018-01-02 Thread Richard Biener
On Mon, Jan 1, 2018 at 11:30 PM, Martin Sebor wrote: > PR tree-optimization/83640 - ice in generic_overlap at > gimple-ssa-warn-restrict.c:814 highlights out a class of cases > where the -Wrestrict checker assumes that the range of a pointer > offset that us represented by a VR_RANGE has a lower b

Re: [PATCH] PR libgfortran/83649 Chunk large reads and writes

2018-01-02 Thread Thomas Koenig
Hi Janne, +#define MAX_CHUNK 2147479552 Two things to discuss: Should this also be backported to the 7-branch? Also, we could set the default subrecord length for unformatted I/O to the same value. Save a syscall :-) What do you think? Regards Thomas

Re: [RFC] Add vec::ordered_remove_if

2018-01-02 Thread Richard Biener
On Fri, Dec 29, 2017 at 2:55 PM, Tom de Vries wrote: > [ was: Re: [libgomp, openacc, openmp, PR83046] Prune removed funcs from > offload table ] > > On 12/28/2017 05:06 PM, Jakub Jelinek wrote: >> >> On Thu, Dec 28, 2017 at 04:53:29PM +0100, Tom de Vries wrote: >>> >>> --- a/gcc/lto-cgraph.c >>> +

Re: [4/4] Make CONST_VECTOR_ELT handle implicitly-encoded elements

2018-01-02 Thread Richard Biener
On Thu, Dec 28, 2017 at 9:54 PM, Richard Sandiford wrote: > This patch makes CONST_VECTOR_ELT handle implicitly-encoded elements, > in a similar way to VECTOR_CST_ELT. Ok. Richard. > > 2017-12-28 Richard Sandiford > > gcc/ > * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt. >

Re: [3/4] Make more use of rtx_vector_builder

2018-01-02 Thread Richard Biener
On Thu, Dec 28, 2017 at 9:53 PM, Richard Sandiford wrote: > This patch makes various bits of CONST_VECTOR-building code use > rtx_vector_builder, operating directly on a specific encoding. Ok. Richard. > > 2017-12-28 Richard Sandiford > > gcc/ > * expr.c: Include rtx-vector-builder.h

Re: [2/4] New CONST_VECTOR layout

2018-01-02 Thread Richard Biener
On Thu, Dec 28, 2017 at 9:51 PM, Richard Sandiford wrote: > This patch makes CONST_VECTOR use the same encoding as VECTOR_CST. > > One problem that occurs in RTL but not at the tree level is that a fair > amount of code uses XVEC and XVECEXP directly on CONST_VECTORs (which is > valid, just with l

Re: [1/4] Use CONST_VECTOR_ELT instead of XVECEXP

2018-01-02 Thread Richard Biener
On Thu, Dec 28, 2017 at 9:50 PM, Richard Sandiford wrote: > This patch replaces target-independent uses of XVECEXP with uses > of CONST_VECTOR_ELT. This kind of replacement isn't necessary > for code specific to targets other than AArch64. Ok. > > 2017-12-28 Richard Sandiford > > gcc/ >

Re: PR83501

2018-01-02 Thread Richard Biener
On Thu, Dec 28, 2017 at 8:42 AM, Prathamesh Kulkarni wrote: > On 21 December 2017 at 12:53, Prathamesh Kulkarni > wrote: >> Hi Jakub, >> Based on your suggestions in PR83501, I have updated the patch to >> check for integer_zerop for 2nd operand of mem_ref. >> >> With the patch, Warray-bounds sta

Re: Ping: [PATCH] x86: don't use AVX512BW vmovdqu variants without -mavx512bw

2018-01-02 Thread Jan Hubicka
> >>> On 02.01.18 at 11:05, wrote: > >> >>> On 13.12.17 at 10:33, wrote: > >> > Simply mirror the MODE_XI logic of handling unaligned operands in > >> > mov_internal into MODE_TI / MODE_OI handling. > >> > > >> > gcc/ > >> > 2017-12-13 Jan Beulich > >> > > >> > * sse.md (mov_internal): Tigh

[PATCH] PR libgfortran/83649 Chunk large reads and writes

2018-01-02 Thread Janne Blomqvist
It turns out that Linux never reads or writes more than 2147479552 bytes in a single syscall. For writes this is not a problem as libgfortran already contains a loop around write() to handle short writes. But for reads we cannot do this, since then read will hang if we have a short read when readin

Re: [PATCH] Fix PR83491

2018-01-02 Thread Richard Biener
On Wed, Dec 20, 2017 at 2:56 PM, Wilco Dijkstra wrote: > This patch fixes PR83491 - if an SSA expression contains 2 identical float > constants, the division reciprocal optimization will ICE. Fix this by > explicitly > checking for SSA_NAME in the tree code before walking the uses. Also fix >

Re: [07/13] Make vec_perm_indices use new vector encoding

2018-01-02 Thread Richard Biener
On Wed, Dec 20, 2017 at 2:48 PM, Richard Sandiford wrote: > Richard Biener writes: >> On Tue, Dec 12, 2017 at 4:46 PM, Richard Sandiford >> wrote: >>> Richard Biener writes: On Sun, Dec 10, 2017 at 12:20 AM, Richard Sandiford wrote: > This patch changes vec_perm_indices from a pl

Re: [11/13] Use vec_perm_builder::series_p in shift_amt_for_vec_perm_mask

2018-01-02 Thread Richard Biener
On Sun, Dec 10, 2017 at 12:24 AM, Richard Sandiford wrote: > This patch makes shift_amt_for_vec_perm_mask use series_p to check > for the simple case of a natural linear series before falling back > to testing each element individually. The series_p test works with > variable-length vectors but t

Re: [12/13] Use ssizetype selectors for autovectorised VEC_PERM_EXPRs

2018-01-02 Thread Richard Biener
On Sun, Dec 10, 2017 at 12:25 AM, Richard Sandiford wrote: > The previous patches mean that there's no reason that constant > VEC_PERM_EXPRs need to have the same shape as the data inputs. > This patch makes the autovectoriser use ssizetype elements instead, > so that indices don't get truncated f

Re: [10/13] Rework VEC_PERM_EXPR folding

2018-01-02 Thread Richard Biener
On Sun, Dec 10, 2017 at 12:23 AM, Richard Sandiford wrote: > This patch reworks the VEC_PERM_EXPR folding so that more of it works > for variable-length vectors. E.g. it means that we can now recognise > variable-length permutes that reduce to a single vector, or cases in > which a variable-lengt

Re: [09/13] Use explicit encodings for simple permutes

2018-01-02 Thread Richard Biener
On Sun, Dec 10, 2017 at 12:21 AM, Richard Sandiford wrote: > This patch makes users of vec_perm_builders use the compressed encoding > where possible. This means that they work with variable-length vectors. > Ok. Richard. > 2017-12-09 Richard Sandiford > > gcc/ > * optabs.c (expand_

[PATCH] Fix big_speedup_p "typo"

2018-01-02 Thread Richard Biener
Noticed by somebody else in a PR. Bootstrapped / tested on x86_64-unknown-linux-gnu, applied. Richard. 2018-01-02 Richard Biener * ipa-inline.c (big_speedup_p): Fix expression. Index: gcc/ipa-inline.c === --- gcc/ipa-

Re: PR82665 - missing value range optimization for memchr

2018-01-02 Thread Jakub Jelinek
On Tue, Jan 02, 2018 at 05:39:17PM +0530, Prathamesh Kulkarni wrote: > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr82665.c > @@ -0,0 +1,22 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O2 -fdump-tree-optimized" } */ > + > +void f1 (char *p, __SIZE_TYPE__ sz) > +{ > + char *q = __bui

Re: [PATCH 10/10] [ARC] Revamp trampoline implementation.

2018-01-02 Thread Andrew Burgess
* Claudiu Zissulescu [2017-11-27 12:09:59 +0100]: > From: Claudiu Zissulescu > > The new implementation attempts to clean up the existing trampoline > implementation for ARC making it to work for linux type of systems. > > gcc/ > 2017-11-10 Claudiu Zissulescu > > * config/arc/arc.c

Re: PR82665 - missing value range optimization for memchr

2018-01-02 Thread Prathamesh Kulkarni
On 20 November 2017 at 16:19, Jakub Jelinek wrote: > On Mon, Nov 20, 2017 at 04:13:49PM +0530, Prathamesh Kulkarni wrote: >> Hi, >> The attached patch tries to fix PR82665 by adding value-range for 'n' >> to [0, PTRDIFF_MAX - 1] in the following case: >> def = memchr(arg, 0, sz); >> n = def - arg

Re: [PATCH 08/10] [ARC] Enable unaligned access.

2018-01-02 Thread Andrew Burgess
* Claudiu Zissulescu [2017-11-27 12:09:57 +0100]: > From: Claudiu Zissulescu > > Use munaligned-access to control if we can have unaligned accesses. For ARC > HS family unaligned access is always on. > > 2017-10-19 Claudiu Zissulescu > > * config/arc/arc-c.def (__ARC_UNALIGNED__):

Re: [PATCH] Change PRED_LOOP_EXIT from 85 to 92

2018-01-02 Thread Martin Liška
On 12/24/2017 07:58 PM, Jeff Law wrote: > On 12/24/2017 05:03 AM, Segher Boessenkool wrote: >> On Sun, Dec 24, 2017 at 09:12:56AM +, Richard Sandiford wrote: >>> Segher Boessenkool writes: On Fri, Dec 22, 2017 at 04:53:47PM -0600, David Esparza wrote: > With a value of 85 GCC has a CP

Re: Ping: [PATCH] x86: don't use AVX512BW vmovdqu variants without -mavx512bw

2018-01-02 Thread Jan Beulich
>>> On 02.01.18 at 11:05, wrote: >> >>> On 13.12.17 at 10:33, wrote: >> > Simply mirror the MODE_XI logic of handling unaligned operands in >> > mov_internal into MODE_TI / MODE_OI handling. >> > >> > gcc/ >> > 2017-12-13 Jan Beulich >> > >> >* sse.md (mov_internal): Tighten condition fo

Re: Ping: [PATCH] x86: don't use AVX512BW vmovdqu variants without -mavx512bw

2018-01-02 Thread Jan Hubicka
> >>> On 13.12.17 at 10:33, wrote: > > Simply mirror the MODE_XI logic of handling unaligned operands in > > mov_internal into MODE_TI / MODE_OI handling. > > > > gcc/ > > 2017-12-13 Jan Beulich > > > > * sse.md (mov_internal): Tighten condition for when to use > > vmovdqu for TI and

Re: [PATCH] constrain strcat destination offset (PR 83642)

2018-01-02 Thread Jakub Jelinek
On Mon, Jan 01, 2018 at 03:31:46PM -0700, Martin Sebor wrote: > The ICE in the test case submitted in PR tree-optimization/83640 > is triggered by the tree-ssa-strlen pass transforming calls to > strcat to strcpy with an offset pointing to the terminating NUL > of the destination string, and allowi

Re: [PATCH] constrain strcat destination offset (PR 83642)

2018-01-02 Thread Richard Sandiford
Richard Sandiford writes: > Martin Sebor writes: >> The ICE in the test case submitted in PR tree-optimization/83640 >> is triggered by the tree-ssa-strlen pass transforming calls to >> strcat to strcpy with an offset pointing to the terminating NUL >> of the destination string, and allowing the

Re: [PATCH] constrain strcat destination offset (PR 83642)

2018-01-02 Thread Richard Sandiford
Martin Sebor writes: > The ICE in the test case submitted in PR tree-optimization/83640 > is triggered by the tree-ssa-strlen pass transforming calls to > strcat to strcpy with an offset pointing to the terminating NUL > of the destination string, and allowing the upper bound of the > offset's ran

Ping: [PATCH] x86: don't use AVX512BW vmovdqu variants without -mavx512bw

2018-01-02 Thread Jan Beulich
>>> On 13.12.17 at 10:33, wrote: > Simply mirror the MODE_XI logic of handling unaligned operands in > mov_internal into MODE_TI / MODE_OI handling. > > gcc/ > 2017-12-13 Jan Beulich > > * sse.md (mov_internal): Tighten condition for when to use > vmovdqu for TI and OI modes. > >

Fix cost of integer loads for generic model

2018-01-02 Thread Jan Hubicka
Hi, this patch fixes register allocation issue in spec2006 lbm benchmark improving it by about 13%. Bootstrapped/regtested x86_64-linux, will commit it soon. Honza * x86-tune-costs.h (generic_cost): Increase cost of integer load to match other memory operations. diff --git a/gc

Fix div/sqrt costs for generic model

2018-01-02 Thread Jan Hubicka
Hi, the following patch makes FP sqrt and div costs to match better modern chips. It enables vectorization of internal loops in spec2006 cactusAMD and leslie3d with over 10% speedup on Zen and also on Haswell. Bootstrapped/regtestex x86_64-linux, comitted. Honza PR target/81616 *

Re: [PATCH] Fix PR83418

2018-01-02 Thread Richard Biener
On Tue, 19 Dec 2017, Jeff Law wrote: > On 12/15/2017 09:30 AM, Richard Biener wrote: > > On December 15, 2017 5:27:14 PM GMT+01:00, Jeff Law wrote: > >> On 12/15/2017 01:10 AM, Richard Biener wrote: > >>> On Thu, 14 Dec 2017, Richard Biener wrote: > >>> > On December 14, 2017 4:43:42 PM GMT+

Re: [PATCH] Fix PR83452

2018-01-02 Thread Richard Biener
On Wed, 20 Dec 2017, Alan Modra wrote: > On Tue, Dec 19, 2017 at 03:37:10PM +0100, Richard Biener wrote: > > + while ((gnu_lto = memchr (gnu_lto, 'g', > > + strings + strsz - gnu_lto))) > > + if (strncmp (gnu_lto, "gnu_lto_v1", > > +