Re: [PATCH] Optimize certain end of loop conditions into min/max operation

2015-07-26 Thread Bin.Cheng
On Mon, Jul 27, 2015 at 12:23 PM, Bin.Cheng wrote: > On Mon, Jul 27, 2015 at 11:41 AM, Michael Collison > wrote: >> This patch is designed to optimize end of loop conditions involving of the >> form >> i < x && i < y into i < min (x, y). Loop condition involving '>' are >> handled similarly usin

Re: [PATCH] Optimize certain end of loop conditions into min/max operation

2015-07-26 Thread Bin.Cheng
On Mon, Jul 27, 2015 at 11:41 AM, Michael Collison wrote: > This patch is designed to optimize end of loop conditions involving of the > form > i < x && i < y into i < min (x, y). Loop condition involving '>' are > handled similarly using max(x,y). > As an example: > > #define N 1024 > > int a[N

Re: [RFC, PR66873] Use graphite for parloops

2015-07-26 Thread Sebastian Pop
On Sun, Jul 26, 2015 at 4:21 PM, Tom de Vries wrote: > I wrote an equivalent test-case in C: > ... > $ cat src/gcc/testsuite/gcc.dg/autopar/outer-7.c > /* { dg-do compile } */ > /* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details > -fdump-tree-optimized" } */ > > void abor

[PATCH] Optimize certain end of loop conditions into min/max operation

2015-07-26 Thread Michael Collison
This patch is designed to optimize end of loop conditions involving of the form i < x && i < y into i < min (x, y). Loop condition involving '>' are handled similarly using max(x,y). As an example: #define N 1024 int a[N], b[N], c[N]; void add (unsignedint m, unsignedint n) { unsignedin

[PATCH 6/9] tree-chkp.c: switch to targetm.pointer_size ()

2015-07-26 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2015-07-26 Trevor Saunders * tree-chkp.c (chkp_build_array_ref): Call targetm.pointer_size (). (chkp_find_bounds_for_elem): Likewise. (chkp_find_bound_slots_1): Likewise. (chkp_add_bounds_to_call_stmt): Likewise. (c

[PATCH 7/9] stor-layout.c: switch to targetm.pointer_size ()

2015-07-26 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2015-07-26 Trevor Saunders * stor-layout.c (layout_type): Call targetm.pointer_size (). --- gcc/stor-layout.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 160ffe2..6043398

[PATCH 4/9] varasm.c: switch from POINTER_SIZE to targetm.pointer_size ()

2015-07-26 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2015-07-26 Trevor Saunders * varasm.c (assemble_addr_to_section): Call targetm.pointer_size (). (dump_tm_clone_pairs): Likewise. --- gcc/varasm.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/varasm.c

[PATCH 9/9] emit-rtl.c: switch to targetm.pointer_size ()

2015-07-26 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2015-07-26 Trevor Saunders * emit-rtl.c (init_derived_machine_modes): Call targetm.pointer_size (). --- gcc/emit-rtl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index ed2b30b.

[PATCH 8/9] tree.c: switch to targetm.pointer_size ()

2015-07-26 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2015-07-26 Trevor Saunders * tree.c (build_common_tree_nodes): Call targetm.pointer_size (). --- gcc/tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/tree.c b/gcc/tree.c index 94263af..02cbda8 100644 --- a/gcc/tree

[PATCH 0/9] start converting POINTER_SIZE to a hook

2015-07-26 Thread tbsaunde+gcc
From: Trevor Saunders Hi, $subject. patches individually bootstrapped + regtested on x86_64-linux-gnu, and run through config-list.mk with more patches removing usage of the macro. Ok? Trev Trevor Saunders (9): remove POINTER_SIZE_UNITS macro add pointer_size target hook target.h: chan

[PATCH 5/9] ubsan.c: switch from POINTER_SIZE to targetm.pointer_size ()

2015-07-26 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2015-07-26 Trevor Saunders * ubsan.c (ubsan_encode_value): Call targetm.pointer_size (). --- gcc/ubsan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/ubsan.c b/gcc/ubsan.c index d75c4ee..55d9440 100644 --- a/gcc/ubsan

[PATCH 2/9] add pointer_size target hook

2015-07-26 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2015-07-26 Trevor Saunders * doc/tm.texi: Regenerate. * doc/tm.texi.in: Adjust. * target.def (pointer_size): New hook. * targhooks.c (default_pointer_size): New function. * targhooks.h (default_pointer_size): New fu

[PATCH 3/9] target.h: change to use targetm.pointer_size instead of POINTER_SIZE

2015-07-26 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2015-07-26 Trevor Saunders * target.h (pointer_size_units): Call targetm.pointer_size (). --- gcc/target.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/target.h b/gcc/target.h index 6715b07..435bc7e 100644 --- a/gcc/tar

[PATCH 1/9] remove POINTER_SIZE_UNITS macro

2015-07-26 Thread tbsaunde+gcc
From: Trevor Saunders gcc/lto/ChangeLog: 2015-07-26 Trevor Saunders * lto-object.c (lto_obj_begin_section): Call pointer_size_units (). gcc/c-family/ChangeLog: 2015-07-26 Trevor Saunders * c-cppbuiltin.c (cpp_atomic_builtins): Call pointer_size_units (). gcc/ChangeLog:

Re: [PR66726] Factor conversion out of COND_EXPR

2015-07-26 Thread Kugan
On 24/07/15 05:05, Jeff Law wrote: > On 07/15/2015 11:52 PM, Kugan wrote: >> diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 932c83a..3058eb5 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c >>> return false; bb = g

Re: [PATCH 1/2] Allow REG_EQUAL for ZERO_EXTRACT

2015-07-26 Thread Kugan
On 27/07/15 05:38, Andreas Schwab wrote: > Kugan writes: > >> * cse.c (cse_insn): Fix missing check for STRICT_LOW_PART and minor >> clean up. > > This breaks > > gcc.target/m68k/tls-ie-xgot.c scan-assembler jsr __m68k_read_tp > gcc.target/m68k/tls-ie.c scan-assembler jsr __m68k_re

Re: [ARM] Optimize compare against smin/umin

2015-07-26 Thread Michael Collison
Here is an updated patch that addresses the issues you mentioned: 2015-07-24 Michael Collison * gcc/config/arm/arm.md (*arm_smin_cmp): New pattern. (*arm_umin_cmp): Likewise. * gcc.target/arm/mincmp.c: Test min compare idiom. diff --git a/gcc/config/

Re: [wwwdocs] Mention -Wshift-overflow

2015-07-26 Thread Gerald Pfeifer
Hi Marek, On Tue, 21 Jul 2015, Marek Polacek wrote: > +A new command-line option -Wshift-overflow has been > + added for the C and C++ compilers, which warns about left shift > + overflows. -Wshift-overflow=2 also warns about > + left-shifting 1 into the sign bit. from what I can

Re: [RFC, PR66873] Use graphite for parloops

2015-07-26 Thread Tom de Vries
On 16/07/15 12:28, Richard Biener wrote: On Thu, Jul 16, 2015 at 12:23 PM, Richard Biener wrote: On Thu, Jul 16, 2015 at 12:19 PM, Thomas Schwinge wrote: Hi Tom! On Thu, 16 Jul 2015 10:46:00 +0200, Richard Biener wrote: On Wed, Jul 15, 2015 at 10:26 PM, Tom de Vries wrote: I tried to pa

[PATCH] Use lowpart_subreg instead of simplify_gen_subreg

2015-07-26 Thread Anatoliy Sokolov
Hello. This patch change function call simplify_gen_subreg (omode, x, imode, subreg_lowpart_offset (omode, imode)) with lowpart_subreg (omode, x, imode) and move lowpart_subreg function from loop-iv.c to simplify-rtx.c. Bootstrapped and reg-tested on x86_64-unknown-linux-gnu. OK for trunk? A

[MOXIE] Hookize PRINT_OPERAND and PRINT_OPERAND_ADDRESS

2015-07-26 Thread Anatoliy Sokolov
Hi. This patch removes obsolete PRINT_OPERAND and PRINT_OPERAND_ADDRESS macros from the MOXIE back end in the GCC and introduces equivalent TARGET_PRINT_OPERAND and TARGET_PRINT_OPERAND_ADDRESS target hooks. Regression tested on moxie-unknown-elf. OK for trunk? Anatoly. 2015-07-26 Anatoly So

[V850] Hookize LIBCALL_VALUE

2015-07-26 Thread Anatoliy Sokolov
Hi. This patch removes obsolete LIBCALL_VALUE macros from the V850 back end in the GCC and introduces equivalent TARGET_LIBCALL_VALUE target hook. Regression tested on v850-unknown-eabi. OK for trunk? 2015-07-26 Anatoly Sokolov * config/v850/v850.h (LIBCALL_VALUE): Remove macros.

Re: [PATCH 1/2] Allow REG_EQUAL for ZERO_EXTRACT

2015-07-26 Thread Andreas Schwab
Kugan writes: > * cse.c (cse_insn): Fix missing check for STRICT_LOW_PART and minor > clean up. This breaks gcc.target/m68k/tls-ie-xgot.c scan-assembler jsr __m68k_read_tp gcc.target/m68k/tls-ie.c scan-assembler jsr __m68k_read_tp gcc.target/m68k/tls-le-xtls.c scan-assembler jsr __

Re: [PATCH] Use single shared memory block pool for all pool allocators

2015-07-26 Thread pinskia
> On Jul 26, 2015, at 11:50 AM, Andi Kleen wrote: > > Mikhail Maltsev writes: > >> Hi, all! >> Recently I did some profiling of GCC to find hotspots and areas of possible >> performance improvement among them. glibc malloc(3) is one of (perhaps >> known) > > I've been compiling gcc with tc

Re: [PATCH] Use single shared memory block pool for all pool allocators

2015-07-26 Thread Andi Kleen
Mikhail Maltsev writes: > Hi, all! > Recently I did some profiling of GCC to find hotspots and areas of possible > performance improvement among them. glibc malloc(3) is one of (perhaps > known) I've been compiling gcc with tcmalloc to do a similar speedup. It would be interesting to compare tha

Re: [PATCH] Fix PR c++/18969 (invalid return statement diagnosed too late)

2015-07-26 Thread Patrick Palka
On Sun, Jul 26, 2015 at 1:09 PM, Patrick Palka wrote: > Committed with this additional change to fix a latent testcase bug: > > diff --git a/gcc/testsuite/g++.old-deja/g++.jason/overload.C > b/gcc/testsuite/g++.old-deja/g++.jason/overload.C > index 6a747ff..28b029f 100644 > --- a/gcc/testsuite/g++

[PATCH] Use single shared memory block pool for all pool allocators

2015-07-26 Thread Mikhail Maltsev
Hi, all! Recently I did some profiling of GCC to find hotspots and areas of possible performance improvement among them. glibc malloc(3) is one of (perhaps known) hotspots. It seemed rather strange to me that pool allocators call malloc(3) and free(3) rather often, and spend considerable time in ma

Re: [PATCH] Fix PR c++/18969 (invalid return statement diagnosed too late)

2015-07-26 Thread Patrick Palka
Committed with this additional change to fix a latent testcase bug: diff --git a/gcc/testsuite/g++.old-deja/g++.jason/overload.C b/gcc/testsuite/g++.old-deja/g++.jason/overload.C index 6a747ff..28b029f 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/overload.C +++ b/gcc/testsuite/g++.old-deja/g+

[gomp4] fiuxup openacc default handling

2015-07-26 Thread Nathan Sidwell
I've committed this update to my earlier breakout of default handling. After complaining about something because of 'none', we should fall through to the default handling, to prevent ICEing later (on patch seriesI'm working on). This matches the OMP default handling. Also tweaked the setting

[PATCH] Enable fixed-point reductions in graphite

2015-07-26 Thread Tom de Vries
Hi, In patch "Don't allow unsafe reductions in graphite" ( submitted https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01861.html , committed r226193) we've disabled fixed-point reductions. In this patch we enable it again, for the case that it's safe, in other words, for the case that the fixed

Re: [PATCH] Allow non-overflow ops in vect_is_simple_reduction_1

2015-07-26 Thread Tom de Vries
On 26/07/15 18:49, Tom de Vries wrote: On 24/07/15 16:39, Tom de Vries wrote: Hi, this patch allows parallelization and vectorization of reduction operators that are guaranteed to not overflow (such as min and max operators), independent of the overflow behaviour of the type. Bootstrapped and

Re: [PATCH] Allow non-overflow ops in vect_is_simple_reduction_1

2015-07-26 Thread Tom de Vries
On 24/07/15 16:39, Tom de Vries wrote: Hi, this patch allows parallelization and vectorization of reduction operators that are guaranteed to not overflow (such as min and max operators), independent of the overflow behaviour of the type. Bootstrapped and reg-tested on x86_64. OK for trunk? Th

OMP. More constification

2015-07-26 Thread Nathan Sidwell
Jakub, Ilya, I found some more missing consts. The size, kind, var and function arrays emitted by omp-low are read only, but are not so marked. This patch a) adds const qualifier and marks them read only. They now end up in .rodata and .data.ro.rel appropriately. b) adds const qualifier t

Re: [libstdc++/67015, patch] Fix regex POSIX bracket parsing

2015-07-26 Thread Tim Shen
On Sun, Jul 26, 2015 at 5:19 AM, Tim Shen wrote: > Kinda important, since "[a-z0-9-]" may be a common case. > > Bootstrapped and tested. Actual patch... -- Regards, Tim Shen commit e0e6c2e3b722e1453d29ad3a56d0de80046453b0 Author: Tim Shen Date: Sun Jul 26 04:37:45 2015 -0700 PR libs

[libstdc++/67015, patch] Fix regex POSIX bracket parsing

2015-07-26 Thread Tim Shen
Kinda important, since "[a-z0-9-]" may be a common case. Bootstrapped and tested. Guess it can also be backported to 5, or even 4.9? Thanks! -- Regards, Tim Shen

[PATCH, testsuite, alpha]: Use unsigned immediates to avoid shift-overflow warning

2015-07-26 Thread Uros Bizjak
2015-07-26 Uros Bizjak * gcc.target/alpha/pr66140.c (lpfc_bg_setup_bpl): Use unsigned immediates to avoid shift-overflow warnings. Tested on alpha-linux-gnu and committed to mainline SVN. Uros. Index: ChangeLog === --- Ch

[PATCH, alpha]: Use SUBREG_P predicate

2015-07-26 Thread Uros Bizjak
2015-07-26 Uros Bizjak * config/alpha/alpha.c: Use SUBREG_P predicate. * config/alpha/predicates.md: Ditto. Bootstrapped and regression tested on alpha-linux-gnu. Committed to mainline SVN. Uros. Index: config/alpha/alpha.c

[C++ Patch, preapproved] Prefer DECL_SOURCE_LOCATION to "+D" and "+#D" (1/n)

2015-07-26 Thread Paolo Carlini
Hi, a first rather straightforward set of changes. Tested x86_64-linux. Thanks, Paolo. / 2015-07-26 Paolo Carlini * decl.c (poplevel): Use Use DECL_SOURCE_LOCATION and "%qD" in warning_at instead of "%q+D" in warning. (warn_extern_redeclared_stati