Re: [PATCH][25/25] Remove GENERIC stmt combining from SCCVN

2015-10-01 Thread Richard Biener
On Wed, 30 Sep 2015, Richard Biener wrote: > > This is the last patch in the series and it finally ditches the > stmt combining code from SCCVN which uses GENERIC. I've been sitting > on this for a while because of the "bad" interface that new mprts_hook > is but I couldn't think of a better

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

2015-10-01 Thread Michael Collison
ChangeLog formatting and test case fixed. On 09/30/2015 12:30 PM, Marc Glisse wrote: On Fri, 18 Sep 2015, Marc Glisse wrote: +(bit_and:c (op @0 @1) (op @0 @2)) :c seems useless here. On the other hand, it might make sense to use op:s since this is mostly useful if it removes the 2 original

Re: [PATCH 2/2] call scev analysis in scop-detection as in sese-to-poly

2015-10-01 Thread Tobias Grosser
On 10/01/2015 12:11 AM, Sebastian Pop wrote: Before our rewrite of the scop detection, we used to not have a valid SESE region under hand, and so we used to do more ad-hoc analysis of data references by trying to prove that at all levels of a loop nest the data references would be still valid.

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

2015-10-01 Thread Marc Glisse
On Thu, 1 Oct 2015, Michael Collison wrote: ChangeLog formatting and test case fixed. Oups, sorry for the lack of precision, but I meant indenting the code in match.pd, I hadn't even looked at the ChangeLog. -- Marc Glisse

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

2015-10-01 Thread Michael Collison
Marc, Ah I did misunderstand you. Patch with match.pd formatting fix. On 10/01/2015 01:05 AM, Marc Glisse wrote: On Thu, 1 Oct 2015, Michael Collison wrote: ChangeLog formatting and test case fixed. Oups, sorry for the lack of precision, but I meant indenting the code in match.pd, I

Re: [PATCH] Clear flow-sensitive info in phiopt (PR tree-optimization/67769)

2015-10-01 Thread Richard Biener
On Wed, 30 Sep 2015, Marek Polacek wrote: > Another instance of out of date SSA range info. Before phiopt1 we had > > : > if (N_2(D) >= 0) > goto ; > else > goto ; > > : > iftmp.0_3 = MIN_EXPR ; > > : > # iftmp.0_5 = PHI <0(2), iftmp.0_3(3)> > value_4 =

Re: [gomp4] remove goacc locking

2015-10-01 Thread Thomas Schwinge
Hi Nathan! On Mon, 28 Sep 2015 11:56:09 -0400, Nathan Sidwell wrote: > I've committed this to remove the now no longer needed lock and unlock > builtins > and related infrastructure. If I understand correctly, it is an implementation detail of the nvptx offloading

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-01 Thread Andrew Haley
On 09/29/2015 04:21 PM, Sandra Loosemore wrote: > What is "weak compare_exchange", and what is "the strong variation", and > how do they differ in terms of behavior? It's in C++11 29.6.5: Remark: The weak compare-and-exchange operations may fail spuriously, that is, return false while leaving

Re: [build] Support PIE on Solaris

2015-10-01 Thread Rainer Orth
Rainer Orth writes: > Rainer Orth writes: > >> Beyond the reasons for the bundled Solaris CRTs already cited in >> >> https://gcc.gnu.org/ml/gcc-patches/2015-09/msg01638.html >> >> they need to be PIC to support position

[PATCH] Tune for lakemont

2015-10-01 Thread Yulia Koval
Hi, The patch below contains some tuning changes for Lakemont, introduced by H.J. Lu. Bootstraped/regtested for Linux/x86_64. Ok for trunk? * gcc/config/i386/x86-tune.def (X86_TUNE_USE_BT): Enable for Lakemont. (X86_TUNE_ZERO_EXTEND_WITH_AND): Disable for Lakemont. Julia

[patch] Add counter inits to zero_iter_bb in expand_omp_for_init_counts

2015-10-01 Thread Tom de Vries
Hi, this patch adds initialization in zero_iter_bb of counters introduced in expand_omp_for_init_counts. This removes the need to set TREE_NO_WARNING on those counters. Build on x86_64 and reg-tested with gomp.exp and target-libgomp c.exp. OK for trunk, if bootstrap and reg-test on x86_64

Re: Fold acc_on_device

2015-10-01 Thread Richard Biener
On Thu, Oct 1, 2015 at 2:33 PM, Nathan Sidwell wrote: > On 10/01/15 06:03, Richard Biener wrote: >> >> On Wed, Sep 30, 2015 at 9:22 PM, Jakub Jelinek wrote: > > >>> Wouldn't it be better to just emit GIMPLE here instead? >>> So >>>tree res = make_ssa_name

[PATCH] Fix PR67783, quadraticness in IPA inline analysis

2015-10-01 Thread Richard Biener
The following avoids quadraticness in the loop depth by only considering loop header defs as IVs for the analysis of the loop_stride predicate. This will miss cases like foo (int inv) { for (i = inv; i < n; ++i) { int derived_iv = i + i * inv; ... } } but I doubt that's important

[PATCH][RTL ifcvt] PR 67786, 67787: Check that intermediate instructions in the basic block don't clobber a reg used in condition

2015-10-01 Thread Kyrill Tkachov
Hi all, This patch fixes the two wrong-code PRs. The problem is related to the way the noce_emit_cmove helper function emits conditional moves. For some targets it re-emits the comparison from the condition block and then the conditional move after we have emitted the two basic blocks. Later

Re: [PATCH] fortran/67758 -- Prevent ICE caused by misplaced COMMON

2015-10-01 Thread Mikael Morin
Le 01/10/2015 14:16, Mikael Morin a écrit : Le 01/10/2015 02:07, Steve Kargl a écrit : On Wed, Sep 30, 2015 at 05:06:30PM -0700, Steve Kargl wrote: Patch built and regression tested on x86_64-*-freebsd. OK to commit? The patch prevents the dereferencing of a NULL pointer by jumping out of the

Re: [PATCH] Clear flow-sensitive info in phiopt (PR tree-optimization/67769)

2015-10-01 Thread Marek Polacek
On Thu, Oct 01, 2015 at 03:26:34PM +0200, Richard Biener wrote: > No, this looks fine. Thanks. Let me do proper testing then. (And I suppose we might want this in gcc-5 as well.) Marek

[gomp4.1] Fixup doacross lastprivate handling

2015-10-01 Thread Jakub Jelinek
On Thu, Sep 24, 2015 at 08:32:10PM +0200, Jakub Jelinek wrote: > some edge for that case and condition checking), lastprivate also needs > checking for all the cases, This patch handles lastprivate in the doacross loops. In certain cases (C++ class iterators and addressable iterators) the user

Re: [PATCH] Fix PR67783, quadraticness in IPA inline analysis

2015-10-01 Thread Richard Biener
On Thu, 1 Oct 2015, Richard Biener wrote: > > The following avoids quadraticness in the loop depth by only considering > loop header defs as IVs for the analysis of the loop_stride predicate. > This will miss cases like > > foo (int inv) > { > for (i = inv; i < n; ++i) > { > int

Re: [PATCH] Tune for lakemont

2015-10-01 Thread Uros Bizjak
On Thu, Oct 1, 2015 at 2:37 PM, Yulia Koval wrote: > Hi, > > The patch below contains some tuning changes for Lakemont, introduced > by H.J. Lu. Bootstraped/regtested for Linux/x86_64. Ok for trunk? > > * gcc/config/i386/x86-tune.def (X86_TUNE_USE_BT): Enable >

[PATCH, testsuite]: Fix gcc.target/i386/pr65105-1.c test

2015-10-01 Thread Uros Bizjak
Hello! Attached patch fixes gcc.target/i386/pr65105-1.c: a) As a runtime SSE2 test, we have to check for target SSE2 support and use proper test infrastructure. b) A runtime test can't check output assembly without -save-temps. The patch also use another misuse of -save-temps in

Re: [PATCH, testsuite]: Fix gcc.target/i386/pr65105-1.c test

2015-10-01 Thread Ilya Enkovich
2015-10-01 13:12 GMT+03:00 Uros Bizjak : > Hello! > > Attached patch fixes gcc.target/i386/pr65105-1.c: Thanks! Ilya > > a) As a runtime SSE2 test, we have to check for target SSE2 support > and use proper test infrastructure. > > b) A runtime test can't check output assembly

[PATCH][AArch64] Don't allow -mgeneral-regs-only to change the .arch assembler directives

2015-10-01 Thread Kyrill Tkachov
Hi all, As part of the SWITCHABLE_TARGET work I inadvertently changed the behaviour of -mgeneral-regs-only with respect to the .arch directives that we emit. The behaviour of -mgeneral-regs-only in GCC 5 and earlier is such that it disallows the usage of FP/SIMD registers but does *not* stop

Re: [PATCH] rs6000: Add "cannot_copy" attribute, use it (PR67788, PR67789)

2015-10-01 Thread Richard Biener
On Thu, Oct 1, 2015 at 8:08 AM, Segher Boessenkool wrote: > After the shrink-wrapping patches the prologue will often be pushed > "deeper" into the function, which in turn means the software trace cache > pass will more often want to duplicate the basic block

Re: Fold acc_on_device

2015-10-01 Thread Nathan Sidwell
On 10/01/15 06:03, Richard Biener wrote: On Wed, Sep 30, 2015 at 9:22 PM, Jakub Jelinek wrote: Wouldn't it be better to just emit GIMPLE here instead? So tree res = make_ssa_name (boolean_type_node); gimple g = gimple_build_assign (res, EQ_EXPR, arg0,

Re: [PATCH] fortran/67758 -- Prevent ICE caused by misplaced COMMON

2015-10-01 Thread Mikael Morin
Le 01/10/2015 02:07, Steve Kargl a écrit : On Wed, Sep 30, 2015 at 05:06:30PM -0700, Steve Kargl wrote: Patch built and regression tested on x86_64-*-freebsd. OK to commit? The patch prevents the dereferencing of a NULL pointer by jumping out of the cleanup of a list of COMMON blocks. Hold

Re: [PATCH] x86 interrupt attribute

2015-10-01 Thread Yulia Koval
Ok, here is the patch. The interrupt and exception handlers are called by x86 processors. X86 hardware pushes information onto stack and calls the handler. The requirements are 1. Both interrupt and exception handlers must use the 'IRET' instruction, instead of the 'RET' instruction, to return

Re: [PATCH] rs6000: Add "cannot_copy" attribute, use it (PR67788, PR67789)

2015-10-01 Thread Bernd Schmidt
Do we have other ports with local labels in define_insns? I see some in darwin.md as well which your patch doesn't handle btw., otherwise suspicious %0: also appears (only) in h8300.md. arc.md also has a suspicious case in its doloop_end_i pattern. It is reasonably common, and defining

Re: [patch] Leave errno unchanged by successful std::stoi etc

2015-10-01 Thread Jonathan Wakely
commit 502928c8061343e82e982e06299c11d465f64b6c Author: Jonathan Wakely Date: Wed Sep 30 14:10:58 2015 +0100 Save-and-restore errno more carefully in libstdc++ * doc/xml/manual/diagnostics.xml: Document use of errno. * config/locale/generic/c_locale.cc

Re: [PATCH] fortran/66979 -- FLUSH requires a UNIT number in the spec-list

2015-10-01 Thread Mikael Morin
Le 01/10/2015 01:58, Steve Kargl a écrit : When FLUSH is used with a flulsh-spec-list, a unit is required. Thus, a statement like 'flush(iostat=i)' would lead to an ICE because gfortran was dereference a pointer to a non-existant unit number. The attached patch was built and tested on

Re: [PATCH] fortran/67616 -- Fix ICE in BLOCK with a DATA statement

2015-10-01 Thread Mikael Morin
Le 01/10/2015 02:03, Steve Kargl a écrit : The attached patch was built and tested on x86_64-*-freebsd. OK to commit? The patch prevents an ICE in a BLOCK construct that uses a DATA statement and default initialization. The problem was that the derived typed was declared in the host and was

Re: [gomp4] remove goacc locking

2015-10-01 Thread Nathan Sidwell
On 10/01/15 04:14, Thomas Schwinge wrote: Hi Nathan! On Mon, 28 Sep 2015 11:56:09 -0400, Nathan Sidwell wrote: I've committed this to remove the now no longer needed lock and unlock builtins and related infrastructure. If I understand correctly, it is an implementation

[PATCH, testsuite]: Skip gcc.dg/lto/pr55113_0.c on all x86 targets.

2015-10-01 Thread Uros Bizjak
Hello! There is no point to use -fshort-double on x86 targets, although it works with -mno-sse, where it avoids construction of DFmode based vector builtins. So, disable non-sensical test on all x86 targets. 2015-10-01 Uros Bizjak * gcc.dg/lto/pr55113_0.c: Skip on all

[C PATCH, committed] Explain parameters better for convert_for_assignment

2015-10-01 Thread Marek Polacek
The location parameters description was IMHO inadequate. The following should be much clearer. Applying to trunk. 2015-10-01 Marek Polacek * c-typeck.c (convert_for_assignment): Improve commentary. diff --git gcc/c/c-typeck.c gcc/c/c-typeck.c index

[PATCH, i386, AVX-512] Update extract_even_odd w/ AVX-512BW insns.

2015-10-01 Thread Kirill Yukhin
Hello, Patch in the bottom improves insns sequences for strided loads. E.g. on `-march=skylake-avx512' for this test: unsigned char yy[1]; unsigned char xx[1]; void __attribute__ ((noinline)) generateMTFValues (unsigned char s) { unsigned char i; for (i = 0; i < s; i++)

Re: [SH][committed] Improve treg_set_expr matching

2015-10-01 Thread Oleg Endo
On Mon, 2015-09-28 at 23:03 +0900, Oleg Endo wrote: > Hi, > > This patch has been hanging around in my queue for a while. Basically, > it uses reverse_condition to get better matching for treg_set_expr. > Tested on sh-elf with > make -k check RUNTESTFLAGS="--target_board=sh-sim >

Re: [patch] Add counter inits to zero_iter_bb in expand_omp_for_init_counts

2015-10-01 Thread Jakub Jelinek
On Thu, Oct 01, 2015 at 02:46:01PM +0200, Tom de Vries wrote: > this patch adds initialization in zero_iter_bb of counters introduced in > expand_omp_for_init_counts. > > This removes the need to set TREE_NO_WARNING on those counters. Why do you think it is a good idea? I'd be afraid it slows

Re: [PATCH] Clear flow-sensitive info in phiopt (PR tree-optimization/67769)

2015-10-01 Thread Marek Polacek
On Thu, Oct 01, 2015 at 09:57:54AM +0200, Richard Biener wrote: > On Wed, 30 Sep 2015, Marek Polacek wrote: > > > Another instance of out of date SSA range info. Before phiopt1 we had > > > > : > > if (N_2(D) >= 0) > > goto ; > > else > > goto ; > > > > : > > iftmp.0_3 =

Re: [Patch match.pd] Add a simplify rule for x * copysign (1.0, y);

2015-10-01 Thread James Greenhalgh
On Thu, Oct 01, 2015 at 03:28:22PM +0100, pins...@gmail.com wrote: > > > > On Oct 1, 2015, at 6:57 AM, James Greenhalgh > > wrote: > > > > > > Hi, > > > > If it is cheap enough to treat a floating-point value as an integer and > > to do bitwise arithmetic on it (as

[PATCH, i386, AVX-512, doc] Mention all AVX-512 switches in invoke.texi.

2015-10-01 Thread Kirill Yukhin
Hello, This patch adds missing AVX-512 switches to invoke.texi. `make pdf` looks ok. Is it ok for trunk and gcc-5-branch (a week after check in to trunk)? gcc/ * doc/invoke.texi: Mention -mavx512vl, -mavx512bw, -mavx512dq, -mavx521vbmi, -mavx512ifma. Add missing opindex-es. --

Re: [Patch match.pd] Add a simplify rule for x * copysign (1.0, y);

2015-10-01 Thread pinskia
> On Oct 1, 2015, at 7:51 AM, James Greenhalgh wrote: > > On Thu, Oct 01, 2015 at 03:28:22PM +0100, pins...@gmail.com wrote: >>> >>> On Oct 1, 2015, at 6:57 AM, James Greenhalgh >>> wrote: >>> >>> >>> Hi, >>> >>> If it is cheap enough to

Re: Do not use TYPE_CANONICAL in useless_type_conversion

2015-10-01 Thread Eric Botcazou
> After dropping the check I needed to solve two issues. First is that we need > a definition of useless conversions for aggregates. As discussed earlier I > made it to depend only on size. The basic idea is that only operations you > can do on gimple with those are moves and field accesses. Field

Re: Fold acc_on_device

2015-10-01 Thread Nathan Sidwell
On 10/01/15 08:46, Richard Biener wrote: On Thu, Oct 1, 2015 at 2:33 PM, Nathan Sidwell wrote: use TREE_TYPE (arg0) for the integer cst. Otherwise looks good to me. thanks, fixed up and applied (also noticed a copy & paste malfunction setting the location) nathan

Re: [PATCH] vectorizing conditional expressions (PR tree-optimization/65947)

2015-10-01 Thread Alan Hayward
On 30/09/2015 13:45, "Richard Biener" wrote: >On Wed, Sep 23, 2015 at 5:51 PM, Alan Hayward >wrote: >> >> >> On 18/09/2015 14:53, "Alan Hayward" wrote: >> >>> >>> >>>On 18/09/2015 14:26, "Alan Lawrence"

[PATCH] Remove gimplifier use from PRE

2015-10-01 Thread Richard Biener
The following patch from the match-and-simplify branch removes gimplifier use from PRE replacing it with use of the gimple_build API building GIMPLE directly. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard. 2015-10-01 Richard Biener *

Re: Cache reals for 1/4, 1/6 and 1/9

2015-10-01 Thread Bernd Schmidt
On 10/01/2015 03:51 PM, Richard Sandiford wrote: We have a global 1/2 and a cached 1/3, but recalculate 1/4, 1/6 and 1/9 each time we need them. That seems a bit arbitrary and makes the folding code more noisy (especially once it's moved to match.pd). This patch caches the other three

Re: [PATCH] rs6000: Add "cannot_copy" attribute, use it (PR67788, PR67789)

2015-10-01 Thread David Edelsohn
On Thu, Oct 1, 2015 at 2:08 AM, Segher Boessenkool wrote: > After the shrink-wrapping patches the prologue will often be pushed > "deeper" into the function, which in turn means the software trace cache > pass will more often want to duplicate the basic block

[PATCH, MIPS, PR/61114] Migrate to reduc_..._scal optabs.

2015-10-01 Thread Simon Dardis
Hello, This patch migrates the MIPS backend to the new vector reduction optabs. No new regressions, ok to apply? Thanks, Simon gcc/ChangeLog: * config/mips/loongson.md (vec_loongson_extract_lo_): New, extract low part to scalar. (reduc_uplus_): Remove.

[gomp4] gimple fold acc_on_device

2015-10-01 Thread Nathan Sidwell
I've applied this version of the acc_on_device folding to gomp4. See https://gcc.gnu.org/ml/gcc-patches/2015-10/msg00074.html for the trunk discussion. nathan 2015-10-01 Nathan Sidwell * builtins.c: Don't include gomp-constants.h. (fold_builtin_1): Don't fold

Re: [patch] Add counter inits to zero_iter_bb in expand_omp_for_init_counts

2015-10-01 Thread Tom de Vries
On 01/10/15 14:49, Jakub Jelinek wrote: On Thu, Oct 01, 2015 at 02:46:01PM +0200, Tom de Vries wrote: this patch adds initialization in zero_iter_bb of counters introduced in expand_omp_for_init_counts. This removes the need to set TREE_NO_WARNING on those counters. Why do you think it is a

Re: Add a build_real_truncate helper function

2015-10-01 Thread Bernd Schmidt
On 10/01/2015 03:48 PM, Richard Sandiford wrote: ...which simplifies the match.pd patterns I'm about to add. Bootstrapped & regression-tested on x86_64-linux-gnu. OK to install? Ok. Bernd

Re: Do not use TYPE_CANONICAL in useless_type_conversion

2015-10-01 Thread Eric Botcazou
> Do we require that to match? I don't remember that we do. For scalar types (and arrays of scalars), the alignment is essentially encoded in the size/mode pair but that's not the case for non-array aggregate types, so declaring a conversion that changes the alignment as useless seems weird.

Re: [PATCH] Tune for lakemont

2015-10-01 Thread H.J. Lu
On Thu, Oct 1, 2015 at 5:42 AM, Uros Bizjak wrote: > On Thu, Oct 1, 2015 at 2:37 PM, Yulia Koval wrote: >> Hi, >> >> The patch below contains some tuning changes for Lakemont, introduced >> by H.J. Lu. Bootstraped/regtested for Linux/x86_64. Ok for trunk?

C PATCH for c/65345 (file-scope _Atomic expansion with floats)

2015-10-01 Thread Marek Polacek
Joseph reminded me that I had forgotten about this patch. As mentioned here , I'm removing the XFAILs in the tests so people are likely to see new FAILs. I think the following targets will need similar fix as the one below: * MIPS *

Re: C PATCH for c/65345 (file-scope _Atomic expansion with floats)

2015-10-01 Thread David Edelsohn
On Thu, Oct 1, 2015 at 10:49 AM, Marek Polacek wrote: > Joseph reminded me that I had forgotten about this patch. As mentioned > here , I'm > removing the XFAILs in the tests so people are likely to see new FAILs. > >

[Patch match.pd] Add a simplify rule for x * copysign (1.0, y);

2015-10-01 Thread James Greenhalgh
Hi, If it is cheap enough to treat a floating-point value as an integer and to do bitwise arithmetic on it (as it is for AArch64) we can rewrite: x * copysign (1.0, y) as: x ^ (y & (1 << sign_bit_position)) This patch implements that rewriting rule in match.pd, and a testcase expecting

Re: [PATCH] rs6000: Add "cannot_copy" attribute, use it (PR67788, PR67789)

2015-10-01 Thread David Edelsohn
On Thu, Oct 1, 2015 at 2:08 AM, Segher Boessenkool wrote: > After the shrink-wrapping patches the prologue will often be pushed > "deeper" into the function, which in turn means the software trace cache > pass will more often want to duplicate the basic block

Re: Do not use TYPE_CANONICAL in useless_type_conversion

2015-10-01 Thread Richard Biener
On Thu, 1 Oct 2015, Eric Botcazou wrote: > > After dropping the check I needed to solve two issues. First is that we need > > a definition of useless conversions for aggregates. As discussed earlier I > > made it to depend only on size. The basic idea is that only operations you > > can do on

Re: [Patch match.pd] Add a simplify rule for x * copysign (1.0, y);

2015-10-01 Thread pinskia
> > On Oct 1, 2015, at 6:57 AM, James Greenhalgh wrote: > > > Hi, > > If it is cheap enough to treat a floating-point value as an integer and > to do bitwise arithmetic on it (as it is for AArch64) we can rewrite: > > x * copysign (1.0, y) > > as: > > x ^ (y &

Re: [PATCH] Clear flow-sensitive info in phiopt (PR tree-optimization/67769)

2015-10-01 Thread Richard Biener
On Thu, 1 Oct 2015, Marek Polacek wrote: > On Thu, Oct 01, 2015 at 09:57:54AM +0200, Richard Biener wrote: > > On Wed, 30 Sep 2015, Marek Polacek wrote: > > > > > Another instance of out of date SSA range info. Before phiopt1 we had > > > > > > : > > > if (N_2(D) >= 0) > > > goto ; > >

[gomp4] backport some changes

2015-10-01 Thread Nathan Sidwell
I've applied this to gomp4 to apply some changes to these areas that occurred on merging to trunk. nathan 2015-10-01 Nathan Sidwell * config/nvptx/nvptx.c (nvptx_validate_dims): Rename to ... (nvptx_goacc_validate_dims): ... here. (TARGET_GOACC_VALIDATE_DIMS):

Re: [PATCH] Clear flow-sensitive info in phiopt (PR tree-optimization/67769)

2015-10-01 Thread Richard Biener
On Thu, 1 Oct 2015, Marek Polacek wrote: > On Thu, Oct 01, 2015 at 03:26:34PM +0200, Richard Biener wrote: > > No, this looks fine. > > Thanks. Let me do proper testing then. (And I suppose we might want this > in gcc-5 as well.) Yes. All the bugs are latent for GCC 5 (and also 4.9), they

Cache reals for 1/4, 1/6 and 1/9

2015-10-01 Thread Richard Sandiford
We have a global 1/2 and a cached 1/3, but recalculate 1/4, 1/6 and 1/9 each time we need them. That seems a bit arbitrary and makes the folding code more noisy (especially once it's moved to match.pd). This patch caches the other three constants too. Bootstrapped & regression-tested on

Add a build_real_truncate helper function

2015-10-01 Thread Richard Sandiford
...which simplifies the match.pd patterns I'm about to add. Bootstrapped & regression-tested on x86_64-linux-gnu. OK to install? Thanks, Richard gcc/ * real.h (build_real_truncate): Declare. * real.c (build_real_truncate): New function. (strip_float_extensions): Use it.

Go patch committed: Only check OPT_m32 if TARGET_CAN_SPLIT_STACK_64BIT

2015-10-01 Thread Ian Lance Taylor
The option OPT_m32 is not defined on all targets. This patch only checks for it if TARGET_CAN_SPLIT_STACK_64BIT is defined, which is the only case where we need to know the value. Bootstrapped on x86_64-unknown-linux-gnu. Committed to mainline. Ian 2015-10-01 Ian Lance Taylor

Re: Fold acc_on_device

2015-10-01 Thread Andrew MacLeod
On 09/30/2015 08:46 AM, Richard Biener wrote: On Wed, Sep 30, 2015 at 2:18 PM, Nathan Sidwell wrote: Please don't add any new GENERIC based builtin folders. Instead add to gimple-fold.c:gimple_fold_builtin Otherwise you're just generating more work for us who move foldings

Do not describe -std=c11 etc. as experimental in c.opt help text

2015-10-01 Thread Joseph Myers
I noticed that c.opt still described -std=c11 and related options as experimental in the --help text. This patch fixes this. Jason, note that -std=gnu++11 and -std=gnu++14 still have that text, contrary to the descriptions of -std=c++11 and -std=c++14. Bootstrapped with no regressions on

Re: Fold acc_on_device

2015-10-01 Thread Nathan Sidwell
On 10/01/15 13:00, Andrew MacLeod wrote: btw, not that it's necessarily important, but I'm about to submit the include reduction patches today, and it turns out this line is the first use of anything from cgraph.h in builtins.c. So if this is "the way" of doing the test, be aware it adds a

Re: [PATCH] x86 interrupt attribute

2015-10-01 Thread H.J. Lu
On Thu, Oct 1, 2015 at 8:59 AM, Uros Bizjak wrote: > On Thu, Oct 1, 2015 at 2:24 AM, H.J. Lu wrote: >> On Wed, Sep 30, 2015 at 12:53 PM, Yulia Koval wrote: >>> Done. >>> >> >> + /* If true, the current function is an interrupt

Re: [Patch match.pd] Add a simplify rule for x * copysign (1.0, y);

2015-10-01 Thread Michael Matz
Hi, On Thu, 1 Oct 2015, Joseph Myers wrote: > On Thu, 1 Oct 2015, Michael Matz wrote: > > > both cases. The catch is that strictly speaking (NaN * -1.0) needs to > > deliver NaN, not -NaN (operations involving quiet NaNs need to provide > > one of the input NaNs as result), and here both are

Re: [PATCH] fortran/67758 -- Prevent ICE caused by misplaced COMMON

2015-10-01 Thread Steve Kargl
On Thu, Oct 01, 2015 at 03:29:05PM +0200, Mikael Morin wrote: > Le 01/10/2015 14:16, Mikael Morin a écrit : > > Le 01/10/2015 02:07, Steve Kargl a écrit : > >> On Wed, Sep 30, 2015 at 05:06:30PM -0700, Steve Kargl wrote: > >>> Patch built and regression tested on x86_64-*-freebsd. > >>> OK to

RE: [PATCH][AArch64] Add separate insn sched class for vector LDP & STP

2015-10-01 Thread Evandro Menezes
Hi, Rama. My patch changed the type of a couple of A64 insns from "neon_load2_2reg_q" and "neon_store2_2reg_q". However, neither ThunderX nor Xgene referred to these types, only A57 and A53 did. So I didn't feel that I'd be the best person to add them to those machines. Thank you, --

Re: [Patch match.pd] Add a simplify rule for x * copysign (1.0, y);

2015-10-01 Thread Jakub Jelinek
On Thu, Oct 01, 2015 at 05:43:15PM +0200, Michael Matz wrote: > Hi, > > On Thu, 1 Oct 2015, James Greenhalgh wrote: > > > > > x * copysign (1.0, y) > > > > > > > > x ^ (y & (1 << sign_bit_position)) > > > > > > Also I think this can only be done for finite and non trapping types. > > > >

Re: [Patch match.pd] Add a simplify rule for x * copysign (1.0, y);

2015-10-01 Thread Michael Matz
Hi, On Thu, 1 Oct 2015, Jakub Jelinek wrote: > But if x is a sNaN, then the multiplication will throw an exception, while > the transformed operation will not. Hmm, that's right, silly me. > So perhaps it should be guarded by > !HONOR_SNANS (TYPE_MODE (type)) > ? That makes sense, yes.

Re: [PATCH] Fix warnings building pdp11 port

2015-10-01 Thread Jeff Law
On 10/01/2015 03:49 AM, Richard Biener wrote: On Wed, Sep 30, 2015 at 6:43 PM, Jeff Law wrote: On 09/30/2015 01:48 AM, Richard Biener wrote: On Tue, Sep 29, 2015 at 6:55 PM, Jeff Law wrote: The pdp11 port fails to build with the trunk because of a

Re: [Patch match.pd] Add a simplify rule for x * copysign (1.0, y);

2015-10-01 Thread Joseph Myers
On Thu, 1 Oct 2015, Michael Matz wrote: > both cases. The catch is that strictly speaking (NaN * -1.0) needs to > deliver NaN, not -NaN (operations involving quiet NaNs need to provide > one of the input NaNs as result), and here both are not equivalent. OTOH > the sign of NaNs isn't

Re: C PATCH for c/65345 (file-scope _Atomic expansion with floats)

2015-10-01 Thread Marek Polacek
On Thu, Oct 01, 2015 at 11:02:09AM -0400, David Edelsohn wrote: > On Thu, Oct 1, 2015 at 10:49 AM, Marek Polacek wrote: > > Joseph reminded me that I had forgotten about this patch. As mentioned > > here , I'm > >

Re: [PATCH] x86 interrupt attribute

2015-10-01 Thread Uros Bizjak
On Thu, Oct 1, 2015 at 6:08 PM, H.J. Lu wrote: > On Thu, Oct 1, 2015 at 8:59 AM, Uros Bizjak wrote: >> On Thu, Oct 1, 2015 at 2:24 AM, H.J. Lu wrote: >>> On Wed, Sep 30, 2015 at 12:53 PM, Yulia Koval wrote:

[PATCH] correctly handle non affine data references

2015-10-01 Thread Sebastian Pop
PR tree-optimization/66980 * graphite-scop-detection.c (stmt_has_simple_data_refs_p): Return false when data reference analysis has failed. --- gcc/graphite-scop-detection.c| 7 +++ gcc/testsuite/gcc.dg/graphite/scop-pr66980.c | 10 ++ 2 files

Re: [PATCH] rs6000: Add "cannot_copy" attribute, use it (PR67788, PR67789)

2015-10-01 Thread Segher Boessenkool
On Thu, Oct 01, 2015 at 12:14:44PM +0200, Richard Biener wrote: > On Thu, Oct 1, 2015 at 8:08 AM, Segher Boessenkool > wrote: > > After the shrink-wrapping patches the prologue will often be pushed > > "deeper" into the function, which in turn means the software trace

Re: [Patch match.pd] Add a simplify rule for x * copysign (1.0, y);

2015-10-01 Thread Michael Matz
Hi, On Thu, 1 Oct 2015, James Greenhalgh wrote: > > > x * copysign (1.0, y) > > > > > > x ^ (y & (1 << sign_bit_position)) > > > > Also I think this can only be done for finite and non trapping types. > > That may be well true, I swithered either way and went for no checks, > but I'd

Re: [PATCH] x86 interrupt attribute

2015-10-01 Thread Uros Bizjak
On Thu, Oct 1, 2015 at 2:24 AM, H.J. Lu wrote: > On Wed, Sep 30, 2015 at 12:53 PM, Yulia Koval wrote: >> Done. >> > > + /* If true, the current function is an interrupt service > + routine as specified by the "interrupt" attribute. */ > +

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-01 Thread Jonathan Wakely
On 01/10/15 12:28 +0100, Andrew Haley wrote: On 09/29/2015 04:21 PM, Sandra Loosemore wrote: What is "weak compare_exchange", and what is "the strong variation", and how do they differ in terms of behavior? It's in C++11 29.6.5: Remark: The weak compare-and-exchange operations may fail

Re: Do not use TYPE_CANONICAL in useless_type_conversion

2015-10-01 Thread Jan Hubicka
> > - /* For aggregates we rely on TYPE_CANONICAL exclusively and require > > - explicit conversions for types involving to be structurally > > - compared types. */ > > + /* For aggregates compare only the size and mode. Accesses to fields do > > have > > + a type information by

[C++ PATCH] PR c++/54430

2015-10-01 Thread Ville Voutilainen
Tested on Linux-PPC64. /cp 2015-10-01 Ville Voutilainen PR c++/54430 * name-lookup.c (push_binding): Make non-static. * name-lookup.h (push_binding): Declare it. * parser.c (cp_parser_range_for): Use it, get the range declaration away from the

Re: [PATCH][RTL ifcvt] PR 67786, 67787: Check that intermediate instructions in the basic block don't clobber a reg used in condition

2015-10-01 Thread Bernd Schmidt
This patch fixes the two wrong-code PRs. The problem is related to the way the noce_emit_cmove helper function emits conditional moves. For some targets it re-emits the comparison from the condition block and then the conditional move after we have emitted the two basic blocks. Later passes

Re: [C++ PATCH] PR c++/54430

2015-10-01 Thread Jason Merrill
OK. Jason

Re: [PATCH] rs6000: Add "cannot_copy" attribute, use it (PR67788, PR67789)

2015-10-01 Thread Segher Boessenkool
On Thu, Oct 01, 2015 at 10:08:50AM -0400, David Edelsohn wrote: > Is this expensive enough that it is worth limiting the definition of > the hook to configurations that include 32-bit SVR4 support so that > not every configuration incurs the overhead? I don't think so. That won't save the call

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-01 Thread Sandra Loosemore
On 10/01/2015 05:28 AM, Andrew Haley wrote: On 09/29/2015 04:21 PM, Sandra Loosemore wrote: What is "weak compare_exchange", and what is "the strong variation", and how do they differ in terms of behavior? It's in C++11 29.6.5: Remark: The weak compare-and-exchange operations may fail

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-01 Thread Jonathan Wakely
On 01/10/15 11:57 -0600, Sandra Loosemore wrote: H, yes. Looking at the section as a whole, is it a bug in the implementation that the built-ins only "approximately match" the C++11 requirements? AFAIK they exactly match, so I don't know why the docs say that. If there were an exact

Re: [patch] libstdc++/67747 Allocate space for dirent::d_name

2015-10-01 Thread Jonathan Wakely
On 01/10/15 18:23 +0100, Jonathan Wakely wrote: +struct op_delete { + void operator()(void* p) const { ::operator delete(p); } +}; +std::unique_ptr<::dirent*, op_delete> ptr; Oops, that should be dirent not dirent* i.e. std::unique_ptr<::dirent, op_delete> ptr; (Found on

Re: [patch] libstdc++/67747 Allocate space for dirent::d_name

2015-10-01 Thread Jonathan Wakely
On 30/09/15 09:30 -0600, Martin Sebor wrote: On 09/30/2015 05:01 AM, Jonathan Wakely wrote: On 29/09/15 12:54 -0600, Martin Sebor wrote: On 09/29/2015 05:37 AM, Jonathan Wakely wrote: POSIX says that dirent::d_name has an unspecified length, so calls to readdir_r must pass a buffer with

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-01 Thread Jonathan Wakely
On 01/10/15 18:34 +0100, Andrew Haley wrote: On 10/01/2015 06:32 PM, Jonathan Wakely wrote: I would suggest we don't try to reproduce the standard definition, but just say the weak version can fail spuriously and the strong can't. IMHO this isn't the place to educate people in the fine points

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-01 Thread Jonathan Wakely
There's a typo in an example too. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index ce1b4ae..599ad87 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -9471,7 +9471,7 @@ alignment. A value of 0 indicates typical alignment should be used. The compiler may also ignore

Re: [PATCH] correctly handle non affine data references

2015-10-01 Thread Tobias Grosser
On 10/01/2015 06:31 PM, Sebastian Pop wrote: create mode 100644 gcc/testsuite/gcc.dg/graphite/scop-pr66980.c diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c LGTM. Tobias

[PATCH] fortran/67802 -- Numeric constant character length must ...

2015-10-01 Thread Steve Kargl
be an integer expression. The attached patch checks that a numerical constant in a CHARACTER(LEN=x) declaration is an integer. Regression tested on x86_64-*-freebsd*. OK to commit? 2015-10-01 Steven G. Kargl PR fortran/67802 * decl.c

Re: [PATCH] fortran/67802 -- Numeric constant character length must ...

2015-10-01 Thread FX
> 2015-10-01 Steven G. Kargl > > PR fortran/67802 > * decl.c (add_init_expr_to_sym): Numeric constant for character > length must be an INTEGER. > > 2015-10-01 Steven G. Kargl > > PR fortran/67802 > *

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-01 Thread Andrew Haley
On 10/01/2015 06:32 PM, Jonathan Wakely wrote: > I would suggest we don't try to reproduce the standard definition, but > just say the weak version can fail spuriously and the strong can't. > IMHO this isn't the place to educate people in the fine points of > low-level atomics. As it says, "when

Re: Do not use TYPE_CANONICAL in useless_type_conversion

2015-10-01 Thread Jan Hubicka
> > Do we require that to match? I don't remember that we do. > > For scalar types (and arrays of scalars), the alignment is essentially > encoded > in the size/mode pair but that's not the case for non-array aggregate types, > so declaring a conversion that changes the alignment as useless

[patch mingw]: Fix PR/51726 - LTO and attribute 'selectany'

2015-10-01 Thread Kai Tietz
Hello, This patch fixes the reported LTO issue, which is caused by not implemented case of uniinitialized variables with selectany-attribute (as common), as such variables couldn't be placed into linkonce-section for pe-coff. I adjusted existing testcase to reflect now supported case of

Re: [Patch match.pd] Add a simplify rule for x * copysign (1.0, y);

2015-10-01 Thread Jakub Jelinek
On Thu, Oct 01, 2015 at 02:57:15PM +0100, James Greenhalgh wrote: > 2015-10-01 James Greenhalgh > > * match.pd (mult (COPYSIGN:s real_onep @0) @1): New simplifier. Also, please note that + wide_int m = wi::min_value (TYPE_PRECISION (type), SIGNED); +

  1   2   >