[PATCH] [libatomic] Add RTEMS support

2016-04-19 Thread Sebastian Huber
gcc/ * config/rtems.h (LIB_SPEC): Add -latomic. libatomic/ * configure.tgt (*-*-rtems*): New supported target. * config/rtems/host-config.h: New file. * config/rtems/lock.c: Likewise. --- gcc/config/rtems.h | 2 +- libatomic/config/rtems/host-c

Re: [PATCH] [AArch64] support -mfentry feature for arm64

2016-04-19 Thread Andrew Haley
On 18/04/16 18:34, Michael Matz wrote: > Hi, > > On Mon, 18 Apr 2016, Andrew Haley wrote: > That may not be safe. Consider an implementation which looks ahead in the instruction stream and decodes the instructions speculatively. >>> >>> It should go without saying that patching in

Re: [PATCH, rs6000] Expand vec_ld and vec_st during parsing to improve performance

2016-04-19 Thread Richard Biener
On Tue, Apr 19, 2016 at 12:05 AM, Bill Schmidt wrote: > Hi, > > Expanding built-ins in the usual way (leaving them as calls until > expanding into RTL) restricts the amount of optimization that can be > performed on the code represented by the built-ins. This has been > observed to be particularl

Re: [PATCH] Optimize strchr (s, 0) to strlen

2016-04-19 Thread Richard Biener
On Mon, Apr 18, 2016 at 7:00 PM, Wilco Dijkstra wrote: > Optimize strchr (s, 0) to s + strlen (s). strchr (s, 0) appears a common > idiom for finding the end of a string, however it is not a very efficient > way of doing so. Strlen is a much simpler operation which is significantly > faster (eg.

[HSA, PATCH] Load an HSA runtime via dlopen mechanism

2016-04-19 Thread Martin Liška
Hello. After brief discussions about packaging of an HSA runtime, we've decided to load an HSA runtime via dlopen mechanism. Following patch introduces necessary header files and all functions within the HSA plug-in are loaded via dlsym. Patch survives HSA regression tests, installed to the HSA b

Re: Please include ada-hurd.diff upstream (try2)

2016-04-19 Thread Arnaud Charlet
> The updated attachment was included in message > https://gcc.gnu.org/ml/gcc-patches/2016-03/msg01659.html You should just put a FSF copyright on s-osinte-gnu.adb OK with this change. Arno

Re: Re-apply reverted niter change 1/4

2016-04-19 Thread Bin.Cheng
On Mon, Apr 18, 2016 at 6:24 PM, Jan Hubicka wrote: > Hi, > as discussed on IRC today, I would like to re-apply the patch to fix bogus > realistic bounds in niter. As it turned out, we seem to rely on this bogus > estimate in few benchmarks and there is miscompilation with avx512. > > The perform

[PATCH] PR70674: S/390: Add memory barrier to stack pointer restore from fpr.

2016-04-19 Thread Andreas Krebbel
This patches fixes a problem with stack variable accesses being scheduled after the stack pointer restore instructions. In the testcase this happened with the stack variable 'a' accessed through the frame pointer. The existing stack_tie we have in the backend is basically useless when trying to b

[PATCH] Fix PR70724

2016-04-19 Thread Richard Biener
I am testing the following patch fixing a python miscompile with FDO (requires -ftracer to trigger). A previous fix to SCCVN made resetting of flow-sensitive SSA info from tail-merging ineffective by eventually restoring the original info. Fixed by splitting that part out of free_scc_vn and call

Re: [PATCH] PR70674: S/390: Add memory barrier to stack pointer restore from fpr.

2016-04-19 Thread Jakub Jelinek
On Tue, Apr 19, 2016 at 11:02:34AM +0200, Andreas Krebbel wrote: > I'll post the patches for the other two parts when gcc 7 entered stage > 1 again. It will not reenter stage 1 again, that happened last Friday ;) > This needs to go into 4.9/5/6 branches. Ok for 6, but I have formatting nit: > +

[PATCH] Fix PR70726

2016-04-19 Thread Richard Biener
I am testing the following to fix PR70726. Bootstrap and regtest running on x86_64-unknown-linux-gnu. Richard. 2016-04-19 Richard Biener PR tree-optimization/70726 * tree-vect-stmts.c (vectorizable_shift): Do not use scalar shift amounts from a pattern stmt operand.

Re: Re-apply reverted niter change 1/4

2016-04-19 Thread Jan Hubicka
> > Index: tree-ssa-loop-ivopts.c > > === > > --- tree-ssa-loop-ivopts.c (revision 235064) > > +++ tree-ssa-loop-ivopts.c (working copy) > > @@ -121,7 +121,11 @@ avg_loop_niter (struct loop *loop) > > { > >HOST_WIDE_INT

Re: [PATCH] Fix PR70726

2016-04-19 Thread Jakub Jelinek
On Tue, Apr 19, 2016 at 01:03:51PM +0200, Richard Biener wrote: > I am testing the following to fix PR70726. > > Bootstrap and regtest running on x86_64-unknown-linux-gnu. > > Richard. > > 2016-04-19 Richard Biener > > PR tree-optimization/70726 > * tree-vect-stmts.c (vectorizabl

Re: Re-apply reverted niter change 1/4

2016-04-19 Thread Bin.Cheng
On Tue, Apr 19, 2016 at 12:09 PM, Jan Hubicka wrote: >> > Index: tree-ssa-loop-ivopts.c >> > === >> > --- tree-ssa-loop-ivopts.c (revision 235064) >> > +++ tree-ssa-loop-ivopts.c (working copy) >> > @@ -121,7 +121,11 @@ avg_

Re: [wwwdocs] Document GCC 6 Solaris changes

2016-04-19 Thread Rainer Orth
Hi Gerald, > On Mon, 18 Apr 2016, Rainer Orth wrote: >> While updating docs for Solaris, here's a Solaris section for >> gcc-6/changes.html. Ok? > > Looks good to me, thanks. thanks, installed. Btw., I noticed that the subsections of `Operating Systems' are in random order. Shouldn't they be s

Re: [RFC][PATCH][PR40921] Convert x + (-y * z * z) into x - y * z * z

2016-04-19 Thread Richard Biener
On Mon, Feb 29, 2016 at 11:53 AM, kugan wrote: >> >> Err. I think the way you implement that in reassoc is ad-hoc and not >> related to reassoc at all. >> >> In fact what reassoc is missing is to handle >> >> -y * z * (-w) * x -> y * x * w * x >> >> thus optimize negates as if they were additio

Re: [RFC][PATCH][PR40921] Convert x + (-y * z * z) into x - y * z * z

2016-04-19 Thread Richard Biener
On Tue, Apr 19, 2016 at 1:35 PM, Richard Biener wrote: > On Mon, Feb 29, 2016 at 11:53 AM, kugan > wrote: >>> >>> Err. I think the way you implement that in reassoc is ad-hoc and not >>> related to reassoc at all. >>> >>> In fact what reassoc is missing is to handle >>> >>> -y * z * (-w) * x -

Re: [RFC][PATCH][PR63586] Convert x+x+x+x into 4*x

2016-04-19 Thread Richard Biener
On Wed, Mar 2, 2016 at 3:28 PM, Christophe Lyon wrote: > On 29 February 2016 at 05:28, kugan wrote: >> >>> That looks better, but I think the unordered_remove will break operand >>> sorting >>> and thus you probably don't handle x + x + x + x + y + y + y + y + y + >>> y + z + z + z + z >>> optima

Re: [RFC][PATCH][PR63586] Convert x+x+x+x into 4*x

2016-04-19 Thread Richard Biener
On Tue, Apr 19, 2016 at 1:56 PM, Richard Biener wrote: > On Wed, Mar 2, 2016 at 3:28 PM, Christophe Lyon > wrote: >> On 29 February 2016 at 05:28, kugan >> wrote: >>> That looks better, but I think the unordered_remove will break operand sorting and thus you probably don't handle

Re: [RFC][PATCH][PR40921] Convert x + (-y * z * z) into x - y * z * z

2016-04-19 Thread Richard Biener
On Tue, Apr 19, 2016 at 1:36 PM, Richard Biener wrote: > On Tue, Apr 19, 2016 at 1:35 PM, Richard Biener > wrote: >> On Mon, Feb 29, 2016 at 11:53 AM, kugan >> wrote: Err. I think the way you implement that in reassoc is ad-hoc and not related to reassoc at all. In fact

Re: [PATCH] Early "SSA" prerequesite - make SSA def stmt update cheaper

2016-04-19 Thread Richard Biener
On Thu, Jan 21, 2016 at 2:57 PM, Richard Biener wrote: > > This makes the SSA def stmt update during inlining cheaper by adjusting > it after remapping a SSA def instead of via an extra walk over all stmt > defs (which incidentially is not possible with FOR_EACH_SSA_* during > "early SSA" as we do

Re: [PATCH][GCC7] Remove scaling of COMPONENT_REF/ARRAY_REF ops 2/3

2016-04-19 Thread Richard Biener
On Fri, Feb 19, 2016 at 9:33 AM, Eric Botcazou wrote: >> The following experiment resulted from looking at making >> array_ref_low_bound and array_ref_element_size non-mutating. Again >> I wondered why we do this strange scaling by offset/element alignment. > > I personally never really grasped i

[Ada] Illegal use of type name in a context where it is not a current instance.

2016-04-19 Thread Arnaud Charlet
This patch fixes an omission in the code that checks the legality of a type name as a prefix of 'access. These uses are allowed when the type name is a current instance, but previously the compiler allowed these uses within aggregates not within the declarative region of the type. Compiling priori

[Ada] Withing Ghost units

2016-04-19 Thread Arnaud Charlet
This patch implements context clauses for Ghost compilation units. It is now possible to "with" and "use" a Ghost unit. If the Assertion_Policy for Ghost is set to "Ignore", the Ghost compilation units do not generate ALI or object files, and no cross-referencing information is present in living AL

[PATCH v2] [libatomic] Add RTEMS support

2016-04-19 Thread Sebastian Huber
v2: Do not use architecture configuration due to broken ARM libatomic support. gcc/ * config/rtems.h (LIB_SPEC): Add -latomic. libatomic/ * configure.tgt (*-*-rtems*): New supported target. * config/rtems/host-config.h: New file. * config/rtems/lock.c: Likewise.

[patch] Fix comment in header for gcc-6-branch

2016-04-19 Thread Jonathan Wakely
I already did this as part of a larger change on trunk, this just fixes the comment on the gcc-6-branch. Jakub approved this on IRC yesterday. commit 60c6d6865513d433a079c0fa0a6a152968c48721 Author: Jonathan Wakely Date: Mon Apr 18 20:30:40 2016 +0100 * include/bits/random.h: Fix filen

Re: [PATCH, rs6000] Expand vec_ld and vec_st during parsing to improve performance

2016-04-19 Thread Bill Schmidt
On Tue, 2016-04-19 at 10:09 +0200, Richard Biener wrote: > On Tue, Apr 19, 2016 at 12:05 AM, Bill Schmidt > wrote: > > Hi, > > > > Expanding built-ins in the usual way (leaving them as calls until > > expanding into RTL) restricts the amount of optimization that can be > > performed on the code re

Re: [PATCH] [AArch64] support -mfentry feature for arm64

2016-04-19 Thread Michael Matz
Hi, On Tue, 19 Apr 2016, Andrew Haley wrote: > > I will happily declare any implementation where it's impossible to > > safely patch the instruction stream by flushing the respective buffers > > or other means completely under control of the patching machinery, to > > be broken by design. > >

[Ada] Always require an elaboration counter when preserving control flow

2016-04-19 Thread Arnaud Charlet
When control flow preservation is requested, we want to be explicit about the units elaboration order in a partition, and we need to have the elaboration counter available for that. This patch ensures we do, even in circumstances where we are otherwise allowed to omit the elaboration counter, e.g.

[Ada] Use thread_id as lwp id on Darwin

2016-04-19 Thread Arnaud Charlet
Not a functional change, but allows the use of debugserver for task switching by gdb. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-19 Tristan Gingold * adaint.c (__gnat_lwp_self): New function (for darwin). * s-osinte-darwin.ads, s-osinte-darwin.adb (lwp_self): Im

Re: [PATCH] [AArch64] support -mfentry feature for arm64

2016-04-19 Thread Andrew Haley
On 04/19/2016 02:19 PM, Michael Matz wrote: > Well, yeah, that's traditional insn caches on multiple cores. From > user space you need kernel help for this, doing interprocess > interrupts to flush all such buffers on all cores (or at least those > potentially fetching stuff in the patched region

C++ PATCH for c++/70522 (friend hides name in unnamed namespace)

2016-04-19 Thread Jason Merrill
cp_binding_level_find_binding_for_name can find a binding for a hidden friend declaration, in which case we shouldn't stop looking into anonymous namespaces. This bug blocked the use of N4381 customization points. Tested x86_64-pc-linux-gnu, applying to trunk. commit 995a41f6f9153cbc4ec713ec6

Re: [PATCH] Remove UNSPEC_LOADU and UNSPEC_STOREU

2016-04-19 Thread Kirill Yukhin
Hi, On 18 Apr 21:13, Uros Bizjak wrote: > On Mon, Apr 18, 2016 at 8:40 PM, H.J. Lu wrote: > > On Sun, Jan 10, 2016 at 11:45 PM, Uros Bizjak wrote: > >> On Sun, Jan 10, 2016 at 11:32 PM, H.J. Lu wrote: > >>> Since *mov_internal and _(load|store)_mask patterns > >>> can handle unaligned load and s

[PATCH, i386]: Use lowpart_subreg instead of simplify_gen_subreg (... , 0).

2016-04-19 Thread Uros Bizjak
Trivial patch, no functional changes. 2016-04-19 Uros Bizjak * config/i386/i386.c (ix86_decompose_address): Use lowpart_subreg instead of simplify_gen_subreg (... , 0). (ix86_delegitimize_address): Ditto. (ix86_split_divmod): Ditto. (ix86_split_copysign_const): Ditto. (

Re: gomp_target_fini

2016-04-19 Thread Jakub Jelinek
On Tue, Apr 19, 2016 at 04:01:06PM +0200, Thomas Schwinge wrote: > Two other solutions have been proposed in the past months: Chung-Lin's > patches with subject: "Adjust offload plugin interface for avoiding > deadlock on exit", later: "Resolve libgomp plugin deadlock on exit", > later: "Resolve de

Re: [PATCH][GCC 7] Fix PR70171

2016-04-19 Thread Richard Biener
On Fri, Mar 11, 2016 at 3:01 PM, Richard Biener wrote: > > The following teaches phiprop to handle the case of aggregate copies > where the aggregate has non-BLKmode which means it is very likely > expanded as reg-reg moves (any better test for that apart from > checking for non-BLKmode?). This i

Re: gomp_target_fini

2016-04-19 Thread Thomas Schwinge
Hi! On Fri, 22 Jan 2016 11:16:07 +0100, Jakub Jelinek wrote: > On Thu, Jan 21, 2016 at 04:24:46PM +0100, Bernd Schmidt wrote: > > On 12/16/2015 01:30 PM, Thomas Schwinge wrote: > > >Now, with the above change installed, GOMP_PLUGIN_fatal will trigger the > > >atexit handler, gomp_target_fini, whi

[gomp-nvptx] doc: document nvptx shared attribute

2016-04-19 Thread Alexander Monakov
* doc/extend.texi (Nvidia PTX Variable Attributes): New section. --- Applied to amonakov/gomp-nvptx branch. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index e11ce4d..5eeb179 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -5469,6 +5469,7 @@ attributes. * MeP Vari

Re: [PATCH, libgomp] Fix deadlock in acc_set_device_type (ping x2)

2016-04-19 Thread Chung-Lin Tang
Ping x2. Hi Jakub, This patch is fairly straightforward, and solves a easily encountered deadlock. Please approve for trunk and gcc-6-branch. Thanks, Chung-Lin On 2016/4/16 03:39 PM, Chung-Lin Tang wrote: > Ping. > > On 2016/3/28 05:45 PM, Chung-Lin Tang wrote: >> Hi Jakub, there's a path for d

Re: [PATCH] [AArch64] support -mfentry feature for arm64

2016-04-19 Thread Pedro Alves
On 04/19/2016 02:25 PM, Andrew Haley wrote: > On 04/19/2016 02:19 PM, Michael Matz wrote: > >> Well, yeah, that's traditional insn caches on multiple cores. From >> user space you need kernel help for this, doing interprocess >> interrupts to flush all such buffers on all cores (or at least those

[PATCH] Remove ix86_legitimate_combined_insn

2016-04-19 Thread H.J. Lu
>From INSTRUCTION EXCEPTION SPECIFICATION section in Intel software developer manual volume 2, only legacy SSE instructions with memory operand not 16-byte aligned get General Protection fault. There is no need to check 1, 2, 4, 8 byte alignments. Since x86 backend has accurate constraints and p

[PATCH] Simplify ix86_expand_vector_move_misalign

2016-04-19 Thread H.J. Lu
Since mov_internal patterns handle both aligned/unaligned load and store, we can simplify ix86_avx256_split_vector_move_misalign and ix86_expand_vector_move_misalign. Tested on x86-64. OK for trunk? H.J. --- * config/i386/i386.c (ix86_avx256_split_vector_move_misalign): Short-cut

Re: [PATCH] [AArch64] support -mfentry feature for arm64

2016-04-19 Thread Andrew Haley
On 04/19/2016 03:37 PM, Pedro Alves wrote: > On 04/19/2016 02:25 PM, Andrew Haley wrote: >> On 04/19/2016 02:19 PM, Michael Matz wrote: >> >>> Well, yeah, that's traditional insn caches on multiple cores. From >>> user space you need kernel help for this, doing interprocess >>> interrupts to flush

Re: [PATCH] PR libitm/70456: Allocate aligned memory in gtm_thread operator new

2016-04-19 Thread H.J. Lu
On Sat, Apr 2, 2016 at 9:25 AM, H.J. Lu wrote: > On Wed, Mar 30, 2016 at 5:34 AM, H.J. Lu wrote: >> Since GTM::gtm_thread has >> >> gtm_thread *next_thread __attribute__((__aligned__(HW_CACHELINE_SIZE))); >> >> GTM::gtm_thread::operator new should allocate aligned memory. >> >> Tested on Linux/x8

Re: [PATCH] Remove ix86_legitimate_combined_insn

2016-04-19 Thread Uros Bizjak
On Tue, Apr 19, 2016 at 4:49 PM, H.J. Lu wrote: > > From INSTRUCTION EXCEPTION SPECIFICATION section in Intel software > developer manual volume 2, only legacy SSE instructions with memory > operand not 16-byte aligned get General Protection fault. There is > no need to check 1, 2, 4, 8 byte alig

[PATCH] Don't build 32-bit libgomp with -march=i486 on x86-64

2016-04-19 Thread H.J. Lu
Gcc uses the same -march= for both -m32 and -m64 on x86-64 unless --with-arch-32= is used. There is no need for -march=i486 to compile 32-bit libgomp on x86-64. Tested on x86-64. OK for trunk? H.J. --- PR target/70454 * configure.tgt (XCFLAGS): Don't add -march=i486 to compile

[PATCH] Don't build 32-bit libitm with -march=i486 on x86-64

2016-04-19 Thread H.J. Lu
Gcc uses the same -march= for both -m32 and -m64 on x86-64 unless --with-arch-32= is used. There is no need for -march=i486 to compile 32-bit libitm on x86-64. Tested on x86-64. OK for trunk? H.J. --- PR target/70454 * configure.tgt (XCFLAGS): Don't add -march=i486 to compile

[PATCH] Don't build 32-bit libatomic with -march=i486 on x86-64

2016-04-19 Thread H.J. Lu
Gcc uses the same -march= for both -m32 and -m64 on x86-64 unless --with-arch-32= is used. There is no need for -march=i486 to compile 32-bit libatomic on x86-64. Tested on x86-64. OK for trunk? H.J. --- PR target/70454 * configure.tgt (XCFLAGS): Don't add -march=i486 to compile

Re: [PATCH] Remove ix86_legitimate_combined_insn

2016-04-19 Thread H.J. Lu
On Tue, Apr 19, 2016 at 8:08 AM, Uros Bizjak wrote: > On Tue, Apr 19, 2016 at 4:49 PM, H.J. Lu wrote: >> >> From INSTRUCTION EXCEPTION SPECIFICATION section in Intel software >> developer manual volume 2, only legacy SSE instructions with memory >> operand not 16-byte aligned get General Protecti

Re: gomp_target_fini

2016-04-19 Thread Alexander Monakov
On Tue, 19 Apr 2016, Thomas Schwinge wrote: > Well, I certainly had done at least some thinking before proposing this: > we're talking about the libgomp "fatal exit" function, called when > something has gone very wrong, and we're about to terminate the process, > because there's no hope to recover

Re: [PATCH] Remove ix86_legitimate_combined_insn

2016-04-19 Thread Uros Bizjak
On Tue, Apr 19, 2016 at 5:18 PM, H.J. Lu wrote: > On Tue, Apr 19, 2016 at 8:08 AM, Uros Bizjak wrote: >> On Tue, Apr 19, 2016 at 4:49 PM, H.J. Lu wrote: >>> >>> From INSTRUCTION EXCEPTION SPECIFICATION section in Intel software >>> developer manual volume 2, only legacy SSE instructions with mem

Re: [PATCH] Remove ix86_legitimate_combined_insn

2016-04-19 Thread H.J. Lu
On Tue, Apr 19, 2016 at 8:27 AM, Uros Bizjak wrote: > On Tue, Apr 19, 2016 at 5:18 PM, H.J. Lu wrote: >> On Tue, Apr 19, 2016 at 8:08 AM, Uros Bizjak wrote: >>> On Tue, Apr 19, 2016 at 4:49 PM, H.J. Lu wrote: From INSTRUCTION EXCEPTION SPECIFICATION section in Intel software deve

Re: [PATCH] Don't build 32-bit libatomic with -march=i486 on x86-64

2016-04-19 Thread Uros Bizjak
__ 4 #define __SIZEOF_POINTER__ 4 #define __USER_LABEL_PREFIX__ @@ -80,6 +83,7 @@ #define __DEC128_EPSILON__ 1E-33DL #define __ATOMIC_HLE_RELEASE 131072 #define __PTRDIFF_MAX__ 0x7fff +#define __tune_i486__ 1 #define __STDC_NO_THREADS__ 1 #define __ATOMIC_HLE_ACQUIRE 65536 #define __LONG_LON

Re: [PATCH] Remove ix86_legitimate_combined_insn

2016-04-19 Thread Uros Bizjak
On Tue, Apr 19, 2016 at 5:36 PM, H.J. Lu wrote: > On Tue, Apr 19, 2016 at 8:27 AM, Uros Bizjak wrote: >> On Tue, Apr 19, 2016 at 5:18 PM, H.J. Lu wrote: >>> On Tue, Apr 19, 2016 at 8:08 AM, Uros Bizjak wrote: On Tue, Apr 19, 2016 at 4:49 PM, H.J. Lu wrote: > > From INSTRUCTION EXC

Re: [PATCH] [AArch64] support -mfentry feature for arm64

2016-04-19 Thread Torsten Duwe
On Mon, Apr 18, 2016 at 02:12:09PM +0200, Michael Matz wrote: > > . It can also be solved by having just one NOP after the function label, > and a number of them before, then no thread can be in the nop pad. That > seems to indicate that GCC should not try to be too clever and simply > leave

[PATCH, i386] Relax target requirement for vec_unpacks_lo_hi

2016-04-19 Thread Ilya Enkovich
Hi, vec_unpacks_lo_[si,hi,di] patterns for scalar masks don't need to extend mask elements. It means a simple register copy is good enough. Currently vec_unpacks_lo_hi pattern uses kmovb instruction which requires AVX512DQ target. But 16-bit masks to/from 8-bit masks conversion is typical for A

Re: [PATCH] PR70674: S/390: Add memory barrier to stack pointer restore from fpr.

2016-04-19 Thread Andreas Krebbel
On 04/19/2016 12:54 PM, Jakub Jelinek wrote: > Can you please: > rtx fpr = gen_rtx_REG (DImode, cfun_gpr_save_slot (i)); > if (i == STACK_POINTER_REGNUM) > insn = emit_insn (gen_stack_restore_from_fpr (fpr)); > else > insn = emit_move_insn (gen_rtx_REG (DImode, i),

Re: [PATCH] Optimize strchr (s, 0) to strlen

2016-04-19 Thread Wilco Dijkstra
Richard Biener wrote: > > This folding should be added to gimple-fold.c:gimple_fold_builtin instead, > the builtins.c foldings are purerly for folding to constants nowadays. So is this better? It's a lot more verbose for something so simple... Unfortunately match.pd doesn't support this kind of th

Re: [PATCH] PR libitm/70456: Allocate aligned memory in gtm_thread operator new

2016-04-19 Thread Torvald Riegel
On Sat, 2016-04-02 at 09:25 -0700, H.J. Lu wrote: > On Wed, Mar 30, 2016 at 5:34 AM, H.J. Lu wrote: > > Since GTM::gtm_thread has > > > > gtm_thread *next_thread __attribute__((__aligned__(HW_CACHELINE_SIZE))); > > > > GTM::gtm_thread::operator new should allocate aligned memory. > > > > Tested on

[PATCH GCC]Support BIT_AND_EXPR in scalar evolution

2016-04-19 Thread Bin Cheng
Hi, Type conversion from integer to smaller unsigned type could be transformed into BIT_AND_EXPR in compilation. For example, int i; for (i = 0; i < n; i++) { unsigned char uc = (unsigned char) i; // transformed into X = i && 255, in which both X and i are of int type. b[uc]

C++ PATCH for core issue 2137

2016-04-19 Thread Jason Merrill
Issue 2137 corrects the previous adjustment of list-initialization to allow copying of aggregates so that it also gives such an initialization the same implicit conversion sequence rank as the same copy constructor called with () syntax. Tested x86_64-pc-linux-gnu, applying to trunk. commit dd

C++ PATCH for some tiny cleanups

2016-04-19 Thread Jason Merrill
A few tiny bits that I noticed while working on other bugs during the GCC 6 process and decided to delay until stage 1. Tested x86_64-pc-linux-gnu, applying to trunk. commit f2d4d53e2e76715a0a4e6379e75dd9eebff93c54 Author: Jason Merrill Date: Tue Dec 8 15:18:22 2015 -0500 Tiny C++ clean

[PATCH] Improve detection of constant conditions during jump threading

2016-04-19 Thread Patrick Palka
This patch makes the jump threader look through the BIT_AND_EXPRs and BIT_IOR_EXPRs within a condition so that we could find dominating ASSERT_EXPRs that could help make the overall condition evaluate to a constant. For example, we currently don't perform any jump threading in the following test c

[patch] Add noexcept to Filesystem TS operators

2016-04-19 Thread Jonathan Wakely
This isn't terribly important, but these operators might as well be noexcept, and committing it now isn't going to cause any problems backporting anything to gcc-6-branch at the last minute. I have a couple more patches for Filesystem TS issues coming too. Tested x86_64-linux, committed to trunk

[patch] libstdc++/70609 fix filesystem::copy()

2016-04-19 Thread Jonathan Wakely
The conditional code in filesystem::copy() that uses stdio_filebuf didn't handle the case where the file to be copied is empty, and so the ostream insertion doesn't do anything. I was also failing to check for errors when closing the files. Rather embarassingly, the copy.cc test was actually a du

[patch] libstdc++/69703 ignore endianness in codecvt_utf8

2016-04-19 Thread Jonathan Wakely
This was reported as a bug in the Filesystem library, but it's actually a problem in the codecvt_utf8 facet that it uses. Tested x86_64-linux, committed to trunk. commit 7f3a547a9e80556030e77ac090e2ad8e04e44abc Author: Jonathan Wakely Date: Tue Apr 19 18:32:17 2016 +0100 libstdc++/69703

Re: [PATCH] Don't build 32-bit libatomic with -march=i486 on x86-64

2016-04-19 Thread H.J. Lu
On Tue, Apr 19, 2016 at 8:45 AM, Uros Bizjak wrote: > On Tue, Apr 19, 2016 at 5:07 PM, H.J. Lu wrote: >> Gcc uses the same -march= for both -m32 and -m64 on x86-64 unless >> --with-arch-32= is used. There is no need for -march=i486 to compile >> 32-bit libatomic on x86-64. >> >> Tested on x86-64

Re: [PATCH] Don't build 32-bit libatomic with -march=i486 on x86-64

2016-04-19 Thread Uros Bizjak
On Tue, Apr 19, 2016 at 8:08 PM, H.J. Lu wrote: > On Tue, Apr 19, 2016 at 8:45 AM, Uros Bizjak wrote: >> On Tue, Apr 19, 2016 at 5:07 PM, H.J. Lu wrote: >>> Gcc uses the same -march= for both -m32 and -m64 on x86-64 unless >>> --with-arch-32= is used. There is no need for -march=i486 to compile

Re: [PATCH] Don't build 32-bit libatomic with -march=i486 on x86-64

2016-04-19 Thread H.J. Lu
On Tue, Apr 19, 2016 at 11:18 AM, Uros Bizjak wrote: > On Tue, Apr 19, 2016 at 8:08 PM, H.J. Lu wrote: >> On Tue, Apr 19, 2016 at 8:45 AM, Uros Bizjak wrote: >>> On Tue, Apr 19, 2016 at 5:07 PM, H.J. Lu wrote: Gcc uses the same -march= for both -m32 and -m64 on x86-64 unless --with-ar

[patch] Fix configure test for sendfile()

2016-04-19 Thread Jonathan Wakely
One more fix for the Filesystem library: my configure test for the GNU and Solaris version of sendfile was failing because it used NULL without stddef.h, so we never used sendfile. That was useful, because it meant someone found and reported a bug in the alternative implementation that doesn't use

Re: [PATCH] Don't build 32-bit libatomic with -march=i486 on x86-64

2016-04-19 Thread Uros Bizjak
On Tue, Apr 19, 2016 at 8:24 PM, H.J. Lu wrote: > On Tue, Apr 19, 2016 at 11:18 AM, Uros Bizjak wrote: >> On Tue, Apr 19, 2016 at 8:08 PM, H.J. Lu wrote: >>> On Tue, Apr 19, 2016 at 8:45 AM, Uros Bizjak wrote: On Tue, Apr 19, 2016 at 5:07 PM, H.J. Lu wrote: > Gcc uses the same -march=

[PATCH] Fix ICE in predicate_mem_writes (PR tree-optimization/70725)

2016-04-19 Thread Marek Polacek
While predicate_mem_writes has a check to skip conditions that were evaluated to true, it's lacking the same check for false, so we hit an assert later on. So I'm adding is_false_predicate. Maybe it should be added to other spots as well, but I'm not sure about that. Bootstrapped/regtested on x86

Re: [PATCH] Don't build 32-bit libatomic with -march=i486 on x86-64

2016-04-19 Thread H.J. Lu
On Tue, Apr 19, 2016 at 11:30 AM, Uros Bizjak wrote: > On Tue, Apr 19, 2016 at 8:24 PM, H.J. Lu wrote: >> On Tue, Apr 19, 2016 at 11:18 AM, Uros Bizjak wrote: >>> On Tue, Apr 19, 2016 at 8:08 PM, H.J. Lu wrote: On Tue, Apr 19, 2016 at 8:45 AM, Uros Bizjak wrote: > On Tue, Apr 19, 2016

C++ PATCH for c++/68206, 68530 (ICE with loop in constexpr)

2016-04-19 Thread Jason Merrill
Well-formed C++14 code with a loop in a constexpr function works fine, but we were crashing while trying to diagnose an unsuitable constexpr function because potential_constant_expression_1 didn't understand loops. The second patch improves constexpr handling of EXIT_EXPR and loops around COMP

C++ PATCH for c++/66543 (-Wunused-but-set false positives)

2016-04-19 Thread Jason Merrill
We've been seeing false positives from these warnings in template code due to uses not making it through into the instantiation: 1) If a pack expansion has no elements 2) If a parameter used in a trailing-return-type is instantiated into a dummy distinct from the real instantiation 3) If a gen

Re: C++ PATCH for c++/66543 (-Wunused-but-set false positives)

2016-04-19 Thread Jakub Jelinek
On Tue, Apr 19, 2016 at 03:29:17PM -0400, Jason Merrill wrote: > We've been seeing false positives from these warnings in template code due > to uses not making it through into the instantiation: > > 1) If a pack expansion has no elements > 2) If a parameter used in a trailing-return-type is insta

moxie-rtems patch for libgcc/config.host

2016-04-19 Thread Joel Sherrill
Hi For some unknown reason, moxie-rtems has its own stanza in libgcc/config.host which does not include extra_parts. This results in C++ RTEMS applications not linking. Also the tmake_file variable is overridden by the shared moxie stanza rather than being added to. This patch addresses both is

Re: [PATCH, rs6000] Expand vec_ld and vec_st during parsing to improve performance

2016-04-19 Thread Bill Schmidt
On Tue, 2016-04-19 at 10:09 +0200, Richard Biener wrote: > On Tue, Apr 19, 2016 at 12:05 AM, Bill Schmidt > wrote: > > Hi, > > > > Expanding built-ins in the usual way (leaving them as calls until > > expanding into RTL) restricts the amount of optimization that can be > > performed on the code re

Re: [PATCH] Fix missed DSE opportunity with operator delete.

2016-04-19 Thread Mikhail Maltsev
On 04/18/2016 12:14 PM, Richard Biener wrote: > > Enlarging tree_function_decl is bad. Probably using 3 bits for malloc_flag, operator_new_flag and free_flag is redundant. I packed the state into 2 bits. > > Passes should get at the info via flags_from_decl_or_type () and a new > ECF_FREE. Fixed.

[PING][PATCH] libgcc: Fix typos in comments for ARM FP emulation routines

2016-04-19 Thread Martin Galvan
A lifetime ago I contributed a patch that added CFI directives to ieee754-df.S, among other files. For unrelated reasons I looked at that file again and saw that some of the comments have extra '@' characters interwined; this is probably the result of splitting lines because they were too long. Thi

Re: [PATCH] [AArch64] support -mfentry feature for arm64

2016-04-19 Thread AKASHI Takahiro
On Tue, Apr 19, 2016 at 09:44:37AM +0300, Alexander Monakov wrote: > On Tue, 19 Apr 2016, AKASHI Takahiro wrote: > > > looking at [2] i don't see why > > > > > > func: > > > mov x9, x30 > > > bl _tracefunc > > > > > > > Actually, > > mov x9, x30 > > bl _tracefunc > > mov x30, x

Re: [PATCH] [AArch64] support -mfentry feature for arm64

2016-04-19 Thread AKASHI Takahiro
On Tue, Apr 19, 2016 at 09:39:39AM +0300, Alexander Monakov wrote: > On Tue, 19 Apr 2016, AKASHI Takahiro wrote: > > > > But if Szabolcs' two-instruction > > > > sequence in the adjacent subthread is sufficient, this is moot. > > > > > > . It can also be solved by having just one NOP after the f

[committed] Fix handling of OpenMP implicit linear/lastprivate clauses (PR middle-end/70680)

2016-04-19 Thread Jakub Jelinek
Hi! The following testcases show incorrect handling of implicit linear or lastprivate clauses on the #pragma omp simd iterators, if the vars aren't private in the outer context and they aren't in combined constructs, they should be noticed in the outer context. Bootstrapped/regtested on x86_64-li

Re: [PING][PATCH] libgcc: Fix typos in comments for ARM FP emulation routines

2016-04-19 Thread Sandra Loosemore
On 04/19/2016 03:53 PM, Martin Galvan wrote: A lifetime ago I contributed a patch that added CFI directives to ieee754-df.S, among other files. For unrelated reasons I looked at that file again and saw that some of the comments have extra '@' characters interwined; this is probably the result of

[PATCH 00/18] towards removing rtx_insn_list and rtx_expr_list

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders Hi, I have some more patches that almost completely eliminate these, but I haven't tested the rest yet, and this is already a long series so it would be nice to get some of it out of my tree and reviewed. patches individually bootstrapped and regtested on x86_64-linux-gnu,

[PATCH 01/18] stop using rtx_insn_list in reorg.c

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2016-04-19 Trevor Saunders * reorg.c (try_merge_delay_insns): Make merged_insns a vector. --- gcc/reorg.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/gcc/reorg.c b/gcc/reorg.c index 7b28821..8fb91

[PATCH 03/18] make antic_stores a vec

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2016-04-19 Trevor Saunders * store-motion.c (struct st_expr): Make antic_stores a vector. (st_expr_entry): Adjust. (free_st_expr_entry): Likewise. (print_store_motion_mems): Likewise. (find_moveable_store): Likewise

[PATCH 02/18] make avail_stores a vec

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2016-04-19 Trevor Saunders * print-rtl.c (print_rtx_insn_vec): New function. * print-rtl.h: New prototype. * rtl.h: Likewise. * store-motion.c (struct st_expr): Make avail_stores a vector. (st_expr_entry): Adjust.

[PATCH 07/18] loop-iv.c: make cond_list a vec

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2016-04-19 Trevor Saunders * loop-iv.c (simplify_using_initial_values): Make cond_list a vector. --- gcc/loop-iv.c | 55 ++- 1 file changed, 18 insertions(+), 37 deletions(-) diff --git a/gcc/l

[PATCH 05/18] make stores rtx_insn_list a vec

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2016-04-19 Trevor Saunders * gcse.c (struct ls_expr): make stores field a vector. (ldst_entry): Adjust. (free_ldst_entry): Likewise. (print_ldst_list): Likewise. (compute_ld_motion_mems): Likewise. (update_l

[PATCH 04/18] remove unused loads rtx_insn_list

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2016-04-19 Trevor Saunders * gcse.c (struct ls_expr): Remove loads field. (ldst_entry): Adjust. (free_ldst_entry): Likewise. (print_ldst_list): Likewise. (compute_ld_motion_mems): Likewise. --- gcc/gcse.c | 14 +---

[PATCH 08/18] make side_effects a vec

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2016-04-19 Trevor Saunders * var-tracking.c (struct adjust_mem_data): Make side_effects a vector. (adjust_mems): Adjust. (adjust_insn): Likewise. (prepare_call_arguments): Likewise. --- gcc/var-tracking.c | 30 +++-

[PATCH 06/18] move reg_equivs out of gc memory

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders It used the gc vector type, but isn't marked as a gc route, and appears to be manually managed, so it should be safe to use the normal heap vector. gcc/ChangeLog: 2016-04-19 Trevor Saunders * ira-emit.c (emit_move_list): Adjust. * ira.c (fix_reg_equiv_i

[PATCH 13/18] haifa-sched.c: make twins a auto_vec

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2016-04-19 Trevor Saunders * haifa-sched.c (add_to_speculative_block): Make twins a vector. --- gcc/haifa-sched.c | 25 - 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c

[PATCH 11/18] add some utility methods to vec

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders Later patches use these functions, and I believe Mikhail has mentioned before he'd like to have begin / end () on vec before. gcc/ChangeLog: 2016-04-19 Trevor Saunders * vec.h (vec_safe_contains): New function. (vec::contains): Likewise. (vec::b

[PATCH 16/18] make forced labels a vec

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2016-04-20 Trevor Saunders * cfgbuild.c (make_edges): Adjust. * cfgrtl.c (can_delete_label_p): Likewise. * dwarf2cfi.c (create_trace_edges): Likewise. * except.c (sjlj_emit_dispatch_table): Likewise. * function.h (s

[PATCH 09/18] make pattern_regs a vec

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2016-04-19 Trevor Saunders * store-motion.c (struct st_expr): Make pattern_regs a vector. (st_expr_entry): Adjust. (store_ops_ok): Likewise. (extract_mentioned_regs): Likewise. (store_killed_in_insn): Likewise.

[PATCH 17/18] make pending_{read,write}_insns vec

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders The old versions of the functions copied here are removed in later patches in my queue once all the lists are gone from sched-*. However they are necessary temporarily to not have to convert all the lists at once which made writing and hopefully reviewing these patches much

[PATCH 15/18] make nonlocal_goto_handler_labels a vec

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2016-04-20 Trevor Saunders * builtins.c (expand_builtin): Adjust. * cfgbuild.c (make_edges): Likewise. * cfgrtl.c (delete_insn): Likewise. (cfg_layout_initialize): Likewise. * dwarf2cfi.c (create_trace_edges): Likew

[PATCH 10/18] merge adjust_cost and adjust_cost_2 target hooks

2016-04-19 Thread tbsaunde+gcc
From: Trevor Saunders gcc/ChangeLog: 2016-04-19 Trevor Saunders * config/alpha/alpha.c (alpha_adjust_cost): Adjust. * config/arm/arm-protos.h (struct tune_params): Likewise. * config/arm/arm.c (xscale_sched_adjust_cost): Likewise. (cortex_a9_sched_adjust_cost)

  1   2   >