Re: RFA (libstdc++): PATCH to implement C++17 over-aligned new

2016-09-10 Thread Marc Glisse
that just aborts I guess? -- Marc Glisse

Re: RFA (libstdc++): PATCH to implement C++17 over-aligned new

2016-09-08 Thread Marc Glisse
to gcc/config/i386/gmm_malloc.h)? A windows version with _aligned_malloc / _aligned_free would also be possible. -- Marc Glisse

Re: [patch, libstdc++] std::shuffle: Generate two swap positions at a time if possible

2016-09-01 Thread Marc Glisse
On Thu, 1 Sep 2016, Jonathan Wakely wrote: + const __uc_type __comp_range = __swap_range * (__swap_range + 1); If __swap_range is 3, then __comp_range is 10 and ??? -- Marc Glisse

match.pd: Revert a * (1 << b) relaxation

2016-08-31 Thread Marc Glisse
) +++ gcc/ChangeLog (working copy) @@ -1,10 +1,15 @@ +2016-08-31 Marc Glisse <marc.gli...@inria.fr> + + PR tree-optimization/73714 + * match.pd (a * (1 << b)): Revert change from 2016-05-23. + 2016-08-31 David Malcolm <dmalc...@redhat.com> * selftest.c: Move "names

Re: [x86] Don't use builtins for unaligned load/store

2016-08-29 Thread Marc Glisse
On Mon, 29 Aug 2016, Uros Bizjak wrote: On Mon, Aug 29, 2016 at 5:22 PM, Marc Glisse <marc.gli...@inria.fr> wrote: On Mon, 29 Aug 2016, Kirill Yukhin wrote: On 29.08.2016 14:58, Marc Glisse wrote: this patch gets rid of a few more builtins (well, I actually kept them, since Ada use

Re: [x86] Don't use builtins for unaligned load/store

2016-08-29 Thread Marc Glisse
On Mon, 29 Aug 2016, Kirill Yukhin wrote: On 29.08.2016 14:58, Marc Glisse wrote: this patch gets rid of a few more builtins (well, I actually kept them, since Ada users may still need them). I had to tweak the flags for pr59539-2.c, otherwise the compiler thinks it is more efficient to split

[x86] Don't use builtins for unaligned load/store

2016-08-29 Thread Marc Glisse
, (%rax){%k1} The changes in the signature of functions don't seem to matter, gcc apparently ignores the aligned attribute for that purpose. The last change (_mm_load_ps) is for consistency. Bootstrap+regtest on x86_64-pc-linux-gnu, with only the above regression. 2016-08-29 Marc Glisse

Re: Make max_align_t respect _Float128

2016-08-26 Thread Marc Glisse
ke powerpc didn't add the macro when they later gained __float128 support, but that would be easy to fix. -- Marc Glisse

Re: Merge switch statements in tree-cfgcleanup

2016-07-19 Thread Marc Glisse
On Tue, 19 Jul 2016, Bernd Schmidt wrote: On 07/19/2016 12:09 PM, Richard Biener wrote: I saw walks over stmts of a BB. IMHO that's a no-go. Only to find the first or last nondebug one. Is that unacceptable? Does gsi_start_nondebug_after_labels_bb not fit? -- Marc Glisse

Re: Implement -Wswitch-fallthrough

2016-07-13 Thread Marc Glisse
On Wed, 13 Jul 2016, Marek Polacek wrote: On Wed, Jul 13, 2016 at 08:39:28PM +0200, Marc Glisse wrote: On Wed, 13 Jul 2016, Marek Polacek wrote: Does "__attribute__((fallthrough));" have any advantages over "__builtin_fallthrough()"? Not a strong argument, but compi

Re: Implement -Wswitch-fallthrough

2016-07-13 Thread Marc Glisse
tribute (and ignore the comment, which makes both other versions less relevant). Unrelated question: are there cases where __builtin_fallthrough() has any impact on code generation? -- Marc Glisse

Re: Determine more IVs to be non-overflowing

2016-07-05 Thread Marc Glisse
on x86_64 (possibly more depending on the exact definition of largest integer). -- Marc Glisse

Re: [PATCH][vectorizer][2/2] Hook up mult synthesis logic into vectorisation of mult-by-constant

2016-07-05 Thread Marc Glisse
targets you care about? I don't have access to Sparc, you want Rainer here (added in Cc:). (thanks for completing the patch!) -- Marc Glisse

Re: [PATCH v2] extend shift count warnings to vector types

2016-07-02 Thread Marc Glisse
h. (OTOH, if you decided that the same message was good enough for both...) -- Marc Glisse

Re: [PATCH PR c/71699] Handle pointer arithmetic in nonzero tree checks

2016-06-30 Thread Marc Glisse
point is that we are not allowed to transform g into f below: char*f(char*p){return p+4;} char*g(char*p){return (char*)((intptr_t)p+4);} That makes sense and seems much easier to guarantee than I feared, nice. (on the other hand, only RTL is able to simplify (long)p+4-(long)(p+4)) -- Marc Glisse

Re: [PATCH PR c/71699] Handle pointer arithmetic in nonzero tree checks

2016-06-30 Thread Marc Glisse
sions. I think this is an exciting optimization, but I was always too scared to try anything like this. -- Marc Glisse

Re: [PATCH][vectorizer][2/2] Hook up mult synthesis logic into vectorisation of mult-by-constant

2016-06-15 Thread Marc Glisse
that's good :-) Otherwise, we might want to err on the side of caution. -- Marc Glisse

Re: [Patch] Implement is_[nothrow_]swappable (p0185r1) - 2nd try

2016-06-14 Thread Marc Glisse
ENOPATCH ;-) (I highly recommend https://gcc.gnu.org/wiki/CompileFarm ) -- Marc Glisse

Re: [PATCH][vectorizer][2/2] PR 65951: Hook up mult synthesis logic into vectorisation of mult-by-constant

2016-06-14 Thread Marc Glisse
On Tue, 14 Jun 2016, Kyrill Tkachov wrote: On 14/06/16 08:04, Marc Glisse wrote: On Mon, 13 Jun 2016, Kyrill Tkachov wrote: The new function vect_synth_mult_by_constant that does all the hard work is very similar in structure to expand_mult_const from expmed.c but it operates on gimple SSA

Re: [PATCH][vectorizer][2/2] PR 65951: Hook up mult synthesis logic into vectorisation of mult-by-constant

2016-06-14 Thread Marc Glisse
overflow from well-defined code. While this is fine in RTL, I would expect to need a cast to unsigned_type_for in gimple for some of the algorithms. (not completely sure, just something to look at) -- Marc Glisse

Re: [PATCH][vectorizer][2/2] PR 65951: Hook up mult synthesis logic into vectorisation of mult-by-constant

2016-06-13 Thread Marc Glisse
nd or vector lowering to turn them to additions (though the estimated cost might be off). Any idea on the best way to handle SPARC? -- Marc Glisse

Re: [PATCH][vectorizer][2/2] PR 65951: Hook up mult synthesis logic into vectorisation of mult-by-constant

2016-06-13 Thread Marc Glisse
://gcc.gnu.org/ml/gcc-patches/2016-06/msg00881.html This one seems much better. -- Marc Glisse

Re: Vectorize 2*x as x+x if needed

2016-06-13 Thread Marc Glisse
On Mon, 13 Jun 2016, Richard Biener wrote: On Sun, Jun 12, 2016 at 11:19 AM, Marc Glisse <marc.gli...@inria.fr> wrote: Hello, canonicalizing x+x to x*2 made us regress some vectorization tests on sparc. As suggested by Richard, this lets the vectorizer handle x*2 as x+x if that helps.

Vectorize 2*x as x+x if needed

2016-06-12 Thread Marc Glisse
her in later passes. ยป Rainer bootstrapped and regtested the patch on sparc. As a bonus, it now vectorizes one more loop in gcc.dg/vect/vect-iv-9.c, I'll let someone else tweak the test (which will temporarily appear as a FAIL). 2016-06-13 Marc Glisse <marc.gli...@inria.fr> PR

Move optimize_minmax_comparison to match.pd

2016-06-12 Thread Marc Glisse
Hello, this move is pretty straightforward. The transformation would probably work just fine for any type (floats, vectors), but I didn't want the headache of checking the behavior for NaN. Bootstrap+regtest on powerpc64le-unknown-linux-gnu. 2016-06-13 Marc Glisse <marc.gli...@inria

Re: [PATCH] Fold x/x to 1, 0/x to 0 and 0%x to 0 consistently

2016-06-08 Thread Marc Glisse
actually be, instead of !integer_zerop (@1): flag_non_call_exceptions ? tree_expr_nonzero_p (@1) : (GIMPLE || !integer_zerop (@1)) (or something similar at a different level in the call chain of course) (not that this helps in any way for the PR...) -- Marc Glisse

Re: [PATCH] Fold x/x to 1, 0/x to 0 and 0%x to 0 consistently

2016-06-08 Thread Marc Glisse
message about it, and folding might not be idempotent. But as long as we don't always perform the simplification, we need some other way to break the cycle for PR70992. -- Marc Glisse

Re: [PING] [PATCH] Fix asm X constraint (PR inline-asm/59155)

2016-06-06 Thread Marc Glisse
hing more generic). The goal of the experiment is described in PR59159 (for which "+X" is unlikely to be the right answer, in particular because it is meaningless for constants). I don't know in what context people use the "X" constraint, or even better "=X"... -- Marc Glisse

Re: [PATCH] match.pd: optimize unsigned mul overflow check

2016-05-29 Thread Marc Glisse
n't ask because I was assuming the latter, but I am not 100% certain) -- Marc Glisse

Re: [PATCH] match.pd: optimize unsigned mul overflow check

2016-05-29 Thread Marc Glisse
is may require an extra check like tree_expr_nonzero_p, although we are quite inconsistent about this (we don't simplify x/x to 1, but we do simplify 0%x to 0 if x is not (yet) known to be the constant 0). We'll see what the reviewers think... Any plan on optimizing the 'B && ovf' form? -- Marc Glisse

Re: tuple move constructor

2016-05-26 Thread Marc Glisse
On Thu, 26 May 2016, Jonathan Wakely wrote: On 25/05/16 14:54 +0100, Jonathan Wakely wrote: On 23/05/16 20:39 +0200, Marc Glisse wrote: Ping (re-attaching, I just added a one-line comment before the tag class as asked by Ville) This is OK for trunk - thanks. On second thoughts - does

Re: tuple move constructor

2016-05-23 Thread Marc Glisse
Ping (re-attaching, I just added a one-line comment before the tag class as asked by Ville) On Thu, 21 Apr 2016, Marc Glisse wrote: On Thu, 21 Apr 2016, Jonathan Wakely wrote: On 20 April 2016 at 21:42, Marc Glisse wrote: Hello, does anyone remember why the move constructor

match.pd: Relax some tree_nop_conversion_p

2016-05-22 Thread Marc Glisse
ay require extra :s). It could also interfere with a narrowing/promotion pass. Bootstrap+regtest on powerpc64le-unknown-linux-gnu. 2016-05-23 Marc Glisse <marc.gli...@inria.fr> gcc/ * match.pd (a * (1 << b), ~x & ~y, ~X ^ ~Y, (X ^ Y) ^ Y, ~ (-A), ~ (A - 1), ~(~X >

Re: [PATCH][RFC] Introduce BIT_FIELD_INSERT

2016-05-20 Thread Marc Glisse
On Fri, 20 May 2016, Andi Kleen wrote: On Fri, May 20, 2016 at 05:11:59PM +0200, Marc Glisse wrote: On Fri, 20 May 2016, Andi Kleen wrote: Richard Biener <rguent...@suse.de> writes: The following patch adds BIT_FIELD_INSERT, an operation to facilitate doing bitfield inserts on reg

Re: [PATCH][RFC] Introduce BIT_FIELD_INSERT

2016-05-20 Thread Marc Glisse
helped by BIT_FIELD_INSERT (PDEP seems too hard). There is one BMI1 instruction we don't use much, bextr (only defined with an UNSPEC in i386.md, unlike the TBM version), but it is about extracting. -- Marc Glisse

Re: PR71206: inconsistent types after match.pd transformation

2016-05-20 Thread Marc Glisse
On Fri, 20 May 2016, Marc Glisse wrote: Hello, this was bootstrapped and regtested on powerpc64le-unknown-linux-gnu. 2016-05-20 Marc Glisse <marc.gli...@inria.fr> PR tree-optimization/71079 PR tree-optimization/71206 gcc/ * match.pd ((X ^ Y) ^ (X ^ Z)): C

PR71206: inconsistent types after match.pd transformation

2016-05-19 Thread Marc Glisse
Hello, this was bootstrapped and regtested on powerpc64le-unknown-linux-gnu. 2016-05-20 Marc Glisse <marc.gli...@inria.fr> gcc/ * match.pd ((X ^ Y) ^ (X ^ Z)): Convert the arguments. gcc/testsuite/ * gcc.dg/tree-ssa/pr71206.c: New testcase. -- Marc GlisseIndex: gcc/ma

Re: [PATCH, GCC] PR middle-end/55299, fold bitnot through ASR and rotates

2016-05-17 Thread Marc Glisse
On Tue, 17 May 2016, Richard Biener wrote: On Fri, May 13, 2016 at 3:36 PM, Marc Glisse <marc.gli...@inria.fr> wrote: On Fri, 13 May 2016, Mikhail Maltsev wrote: I don't know if we might want some :c / single_use restrictions, maybe on the outer convert and the rshift/rotate. I don't

Re: VRP: range info of new variables

2016-05-17 Thread Marc Glisse
- your call on asserting the variable is not a pointer before calling set_range_info. Similarly on the check that the TYPE_PRECISION (TREE_TYPE (tem)) > 1. -- Marc Glisse

match.pd: x & C -> x if we know that x & ~C == 0

2016-05-17 Thread Marc Glisse
). Bootstrap+regtest on powerpc64le-unknown-linux-gnu. 2016-05-17 Marc Glisse <marc.gli...@inria.fr> gcc/ * match.pd (X & C): New transformation. gcc/testsuite/ * gcc.dg/tree-ssa/and-1.c: New testcase. -- Marc GlisseIndex: gc

Re: match.pd: ~X & Y to X ^ Y in some cases

2016-05-16 Thread Marc Glisse
On Mon, 16 May 2016, Jeff Law wrote: Please use if (GIMPLE && ((get_nonzero_bits ...) Rather than #if GIMPLE Richard asked for the reverse in some previous patch: https://gcc.gnu.org/ml/gcc-patches/2016-04/msg01617.html I don't really care which one we settle on... -- Marc Glisse

match.pd: ~X & Y to X ^ Y in some cases

2016-05-13 Thread Marc Glisse
are doing bit_not on it, but it looks like I should because we can do bitops on pointers? Adjustment for pr69270.c is exactly the same as in the previous patch from today :-) Bootstrap+regtest on powerpc64le-unknown-linux-gnu. 2016-05-16 Marc Glisse <marc.gli...@inria.fr>

VRP: range info of new variables

2016-05-13 Thread Marc Glisse
-gnu. 2016-05-16 Marc Glisse <marc.gli...@inria.fr> gcc/ * tree-vrp.c (simplify_truth_ops_using_ranges): Set range information for new SSA_NAME. (simplify_switch_using_ranges): Get range through get_range_info instead of get_value_range. gcc/tes

Re: [PATCH, GCC] PR middle-end/55299, fold bitnot through ASR and rotates

2016-05-13 Thread Marc Glisse
will happen in gimple (most likely the first forwprop pass). The patch looks good to me, now wait for Richard's comments. -- Marc Glisse

Re: Simple bitop reassoc in match.pd

2016-05-12 Thread Marc Glisse
ts. Just to be sure: is the fact that VRP doesn't apply fold_stmt on purpose? The restriction makes sense, it is just that it may yield a bit of duplication. We already indirectly use get_range_info in match.pd and may miss out on opportunities that only occur in branches during the VRP pass.

Re: Simple bitop reassoc in match.pd

2016-05-11 Thread Marc Glisse
On Wed, 11 May 2016, Jeff Law wrote: On 05/11/2016 10:17 AM, Marc Glisse wrote: The transformation seems right to me, but we are then missing another transformation like ~X & Y -> X ^ Y when we know that X & ~Y is 0 (the 1 bits of X are included in those of Y). That may

Re: Simple bitop reassoc in match.pd

2016-05-11 Thread Marc Glisse
On Wed, 11 May 2016, Marc Glisse wrote: We could also use set_range_info and make simplify_conversion_using_ranges use get_range_info instead of get_value_range. Something like this seems to fix the testcase. I'll try to submit it properly, but I don't know when. (I also added the ~X

Re: Simple bitop reassoc in match.pd

2016-05-11 Thread Marc Glisse
move the whole function to match.pd then ;-) -- Marc Glisse

Re: Simple bitop reassoc in match.pd (was: Canonicalize X u< X to UNORDERED_EXPR)

2016-05-11 Thread Marc Glisse
iable y, and by the time the next VRP pass comes, it is too late. In the mean time, I propose xfailing this test... -- Marc Glisse

Re: [PATCH, GCC] PR middle-end/55299, fold bitnot through ASR and rotates

2016-05-11 Thread Marc Glisse
On Tue, 10 May 2016, Mikhail Maltsev wrote: On 05/08/2016 10:57 PM, Marc Glisse wrote: On Sun, 8 May 2016, Mikhail Maltsev wrote: Hi! I decided to revive this patch: https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00999.html. I addressed review comments about sign conversions. Bootstrapped

Re: Simple bitop reassoc in match.pd (was: Canonicalize X u< X to UNORDERED_EXPR)

2016-05-10 Thread Marc Glisse
On Fri, 6 May 2016, Marc Glisse wrote: Here they are. I did (X) and (X)&(X). The next one would be ((X)), but at some point we have to defer to reassoc. I didn't add the convert?+tree_nop_conversion_p to the existing transform I modified. I guess at some point we should make a pass and

Re: [PATCH] Take known zero bits into account when checking extraction.

2016-05-09 Thread Marc Glisse
y/must be non-zero. It may be possible to enhance it to handle this case. -- Marc Glisse

Re: [PATCH] Fix PR70497, missed "subreg" CSE on GIMPLE

2016-05-09 Thread Marc Glisse
how_bug.cgi?id=28367 (reading an element from a vector through a union)? -- Marc Glisse

Re: Simple bitop reassoc in match.pd (was: Canonicalize X u< X to UNORDERED_EXPR)

2016-05-08 Thread Marc Glisse
On Fri, 6 May 2016, Marc Glisse wrote: 2016-05-06 Marc Glisse <marc.gli...@inria.fr> gcc/ * fold-const.c (fold_binary_loc) [(X ^ Y) & Y]: Remove and merge with... * match.pd ((X & Y) ^ Y): ... this. ((X & Y) & Y, (X | Y) | Y, (X ^ Y) ^ Y, (X

Re: [PATCH, GCC] PR middle-end/55299, fold bitnot through ASR and rotates

2016-05-08 Thread Marc Glisse
transformations are safe for any kind of conversion? -- Marc Glisse

Re: tuple move constructor

2016-05-06 Thread Marc Glisse
On Fri, 6 May 2016, Ville Voutilainen wrote: On 6 May 2016 at 20:51, Marc Glisse <marc.gli...@inria.fr> wrote: Hi Ville, since you wrote the latest patches on tuple constructors, do you have an opinion on this patch, or alternate strategies to achieve the same goal? https://gcc.gnu.

Re: tuple move constructor

2016-05-06 Thread Marc Glisse
Hi Ville, since you wrote the latest patches on tuple constructors, do you have an opinion on this patch, or alternate strategies to achieve the same goal? https://gcc.gnu.org/ml/libstdc++/2016-04/msg00041.html On Thu, 21 Apr 2016, Marc Glisse wrote: On Thu, 21 Apr 2016, Jonathan Wakely

Simple bitop reassoc in match.pd (was: Canonicalize X u< X to UNORDERED_EXPR)

2016-05-06 Thread Marc Glisse
On Tue, 3 May 2016, Richard Biener wrote: On Tue, May 3, 2016 at 3:26 PM, Marc Glisse <marc.gli...@inria.fr> wrote: On Tue, 3 May 2016, Richard Biener wrote: On Tue, May 3, 2016 at 8:36 AM, Marc Glisse <marc.gli...@inria.fr> wrote: This removes the duplication. I also remo

Re: Canonicalize X u< X to UNORDERED_EXPR

2016-05-03 Thread Marc Glisse
On Tue, 3 May 2016, Richard Biener wrote: On Tue, May 3, 2016 at 8:36 AM, Marc Glisse <marc.gli...@inria.fr> wrote: This removes the duplication. I also removed the case (A)&(A) which is handled by reassoc. And I need 2 NOP checks, for the case where @0 is a constant (that could

Re: Canonicalize X u< X to UNORDERED_EXPR

2016-05-03 Thread Marc Glisse
64le-unknown-linux-gnu. 2016-05-03 Marc Glisse <marc.gli...@inria.fr> * match.pd ((A | B) & (A | C)): Generalize to BIT_XOR_EXPR. Mark as commutative. Check both conversions are NOP. ((A & B) OP (C & B)): Remove. -- Marc Gli

Re: Canonicalize X u< X to UNORDERED_EXPR

2016-05-02 Thread Marc Glisse
On Mon, 2 May 2016, Richard Biener wrote: On Sat, Apr 30, 2016 at 8:44 PM, Marc Glisse <marc.gli...@inria.fr> wrote: Hello, this case seemed to be missing in the various X cmp X transformations. It does not change the generated code in the testcase. The missing :c is rather trivial.

Canonicalize X u< X to UNORDERED_EXPR

2016-04-30 Thread Marc Glisse
Hello, this case seemed to be missing in the various X cmp X transformations. It does not change the generated code in the testcase. The missing :c is rather trivial. I can commit it separately if you prefer. Bootstrap+regtest on powerpc64le-unknown-linux-gnu. 2016-05-02 Marc Glisse

Re: Move "X +- C1 CMP C2 to X CMP C2 -+ C1" to match.pd

2016-04-29 Thread Marc Glisse
On Fri, 29 Apr 2016, Richard Biener wrote: Another option is to move the enum declaration from flag-types.h to coretypes.h. I think I like that best. This works. 2016-05-02 Marc Glisse <marc.gli...@inria.fr> gcc/ * flag-types.h (enum warn_strict_overflow_code)

Re: Move "X +- C1 CMP C2 to X CMP C2 -+ C1" to match.pd

2016-04-28 Thread Marc Glisse
ee-ssa-scopedtables.c. Including options.h in those 2 files seems to work (I didn't check if all the files in config/ that include fold-const.h also indirectly include options.h). If you really think that's better, I'll do it... -- Marc Glisse

Re: match.pd: unsigned A - B > A --> A < B

2016-04-27 Thread Marc Glisse
enabled for both. -- Marc Glisse

Re: Move "X +- C1 CMP C2 to X CMP C2 -+ C1" to match.pd

2016-04-26 Thread Marc Glisse
Apr 2016, Marc Glisse wrote: On Tue, 26 Apr 2016, Richard Biener wrote: On Sun, Apr 24, 2016 at 7:14 PM, Marc Glisse <marc.gli...@inria.fr> wrote: Hello, trying to move a first pattern from fold_comparison. I first tried without single_use. It brought the number of 'free' in g++.dg/tr

Re: Move "X +- C1 CMP C2 to X CMP C2 -+ C1" to match.pd

2016-04-26 Thread Marc Glisse
On Tue, 26 Apr 2016, Richard Biener wrote: On Sun, Apr 24, 2016 at 7:14 PM, Marc Glisse <marc.gli...@inria.fr> wrote: Hello, trying to move a first pattern from fold_comparison. I first tried without single_use. It brought the number of 'free' in g++.dg/tree-ssa/pr61034.C down to 11, c

Re: [RFC] Update gmp/mpfr/mpc minimum versions

2016-04-26 Thread Marc Glisse
interoperability, even for in-tree builds. It is just a matter what versions we want to test, I have not really any idea where the limits will be, just that it can no longer be 4.3.2. Even if in-tree builds work with several versions, we may still want to document only one as supported. -- Marc Glisse

Re: [RFC] Update gmp/mpfr/mpc minimum versions

2016-04-26 Thread Marc Glisse
gmp-6.1.1 is supposed to be out any day now and will not require -DNO_ASM anymore. -- Marc Glisse

Re: match.pd: unsigned A - B > A --> A < B

2016-04-26 Thread Marc Glisse
On Tue, 26 Apr 2016, Richard Biener wrote: On Sun, Apr 24, 2016 at 7:42 PM, Marc Glisse <marc.gli...@inria.fr> wrote: Hello, the first part is something that was discussed last stage3, and Jakub argued in favor of single_use. The second part is probably less useful, it notices that

Re: match.pd patch: u + 3 < u is u > UINT_MAX - 3

2016-04-26 Thread Marc Glisse
uted_op(op) at the place where the regular commutation gets lowered. If it is significantly more complicated, I guess it isn't that urgent... -- Marc Glisse

Re: match.pd: x+x -> 2*x

2016-04-26 Thread Marc Glisse
ind? -- Marc Glisse

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

2016-04-26 Thread Marc Glisse
ator new wrote there. Depending on inline decisions, DSE-ing part of new could be problematic (IIRC those functions are technically not allowed to be marked 'inline', but that's not quite the same thing). -- Marc Glisse

match.pd: x+x -> 2*x

2016-04-25 Thread Marc Glisse
that). Bootstrap+regtest on powerpc64le-unknown-linux-gnu. 2016-04-26 Marc Glisse <marc.gli...@inria.fr> gcc/ * genmatch.c (write_predicate): Add ATTRIBUTE_UNUSED. * fold-const.c (fold_binary_loc): Remove 2 transformations superseded by match.pd. * match.pd (x+x

match.pd: unsigned A - B > A --> A < B

2016-04-24 Thread Marc Glisse
the result of that function. Bootstrap+regtest on powerpc64le-unknown-linux-gnu. (hmm, I probably should have done it on x86_64 instead, I don't know if the ppc backend has implemented the overflow functions recently) 2016-04-25 Marc Glisse <marc.gli...@inria.fr> gcc/ * match.pd

Re: match.pd patch: u + 3 < u is u > UINT_MAX - 3

2016-04-24 Thread Marc Glisse
On Fri, 22 Apr 2016, Marc Glisse wrote: On Fri, 22 Apr 2016, Richard Biener wrote: On Fri, Apr 22, 2016 at 5:29 AM, Marc Glisse <marc.gli...@inria.fr> wrote: Hello, this optimizes a common pattern for unsigned overflow detection, when one of the arguments turns out to be a co

Move "X +- C1 CMP C2 to X CMP C2 -+ C1" to match.pd

2016-04-24 Thread Marc Glisse
integers anyway. I split the equality case, because it was already getting ugly. Bootstrap+regtest on powerpc64le-unknown-linux-gnu. 2016-04-25 Marc Glisse <marc.gli...@inria.fr> gcc/ * fold-const.h: Include flag-types.h. (fold_overflow_warning): Declare.

Re: match.pd patch: min(-x, -y), min(~x, ~y)

2016-04-22 Thread Marc Glisse
On Fri, 22 Apr 2016, Kyrill Tkachov wrote: On 22/04/16 10:43, Kyrill Tkachov wrote: On 22/04/16 10:42, Marc Glisse wrote: On Fri, 22 Apr 2016, Kyrill Tkachov wrote: 2016-04-21 Marc Glisse <marc.gli...@inria.fr> gcc/ * match.pd (min(-x, -y), max(-x, -y), min(~x, ~y), max(

Re: match.pd patch: min(-x, -y), min(~x, ~y)

2016-04-22 Thread Marc Glisse
On Fri, 22 Apr 2016, Kyrill Tkachov wrote: 2016-04-21 Marc Glisse <marc.gli...@inria.fr> gcc/ * match.pd (min(-x, -y), max(-x, -y), min(~x, ~y), max(~x, ~y)): New transformations. gcc/testsuite/ * gcc.dg/tree-ssa/minmax-2.c: New testcase. I see the new testcase f

Re: match.pd patch: u + 3 < u is u > UINT_MAX - 3

2016-04-22 Thread Marc Glisse
On Fri, 22 Apr 2016, Richard Biener wrote: On Fri, Apr 22, 2016 at 5:29 AM, Marc Glisse <marc.gli...@inria.fr> wrote: Hello, this optimizes a common pattern for unsigned overflow detection, when one of the arguments turns out to be a constant. There are more ways this could look like, (

match.pd patch: u + 3 < u is u > UINT_MAX - 3

2016-04-21 Thread Marc Glisse
016-04-22 Marc Glisse <marc.gli...@inria.fr> gcc/ * match.pd (X + CST CMP X): New transformation. gcc/testsuite/ * gcc.dg/tree-ssa/overflow-1.c: New testcase. -- Marc GlisseIndex: gcc/match.pd === --- gcc

Re: tuple move constructor

2016-04-21 Thread Marc Glisse
On Thu, 21 Apr 2016, Jonathan Wakely wrote: On 20 April 2016 at 21:42, Marc Glisse wrote: Hello, does anyone remember why the move constructor of _Tuple_impl is not defaulted? The attached patch does not cause any test to fail (whitespace kept to avoid line number changes). Maybe something

match.pd patch: min(-x, -y), min(~x, ~y)

2016-04-21 Thread Marc Glisse
need. We could generalize to cases where overflow is not undefined if we know (VRP) that the variables are not TYPE_MIN_VALUE, but that didn't look like a priority. Bootstrap+regtest on powerpc64le-unknown-linux-gnu. 2016-04-21 Marc Glisse <marc.gli...@inria.fr> gcc/ * matc

match.pd patch: max(int_min, x)->x

2016-04-20 Thread Marc Glisse
on powerpc64le-unknown-linux-gnu (some noise in libgomp testcases). 2016-04-21 Marc Glisse <marc.gli...@inria.fr> gcc/ * match.pd (min(int_max, x), max(int_min, x)): New transformations. gcc/testsuite/ * gcc.dg/tree-ssa/minmax-1.c: New testcase. -- Marc GlisseIndex: gcc/ma

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

2016-04-17 Thread Marc Glisse
for _aligned_free. I am concerned about what happens when a user replaces a global operator delete. Does the replacement function have to satisfy the properties for this attribute? -- Marc Glisse

Re: PATCH] Fix PR 31531: A microoptimization of isnegative of signed integer

2016-04-15 Thread Marc Glisse
be boolean for instance. Asking for tree_nop_conversion_p between @0 and that type seems strange. Also, you are not allowed to use TYPE_PRECISION on a vector type. -- Marc Glisse

Re: [PATCH] Fix PR31096

2016-04-15 Thread Marc Glisse
iewer), though you could now move the test tree_expr_nonzero_p next to tree_expr_nonnegative_p (it is redundant for the last case). -- Marc Glisse

Re: [PATCH] Fix PR31096

2016-04-12 Thread Marc Glisse
e it even reaches this pattern. Multiplying by a third variable 'c' (where the compiler has no idea what the sign of c is) could be nicer. Then you'll need to wait for a real reviewer to show up. -- Marc Glisse

Re: [PATCH] Fix PR31096

2016-04-07 Thread Marc Glisse
he other transformation has similar issues. -- Marc Glisse

Re: [PATCH] Fix PR31096

2016-04-05 Thread Marc Glisse
nt, so that's still invalid. It is also invalid for unsigned. The :s are useless since the output is a single insn. -- Marc Glisse

Re: [PATCH] Fix PR31096

2016-03-31 Thread Marc Glisse
-31 Naveen H.S <naveen.hurugalaw...@caviumnetworks.com> * match.pd (cmp (mult:cs @0 @1) (mult:cs @2 @1)) : New Pattern. * gcc.dg/pr31096.c: New testcase. Looks like you are turning x*-1 < y*-1 into x<y? That doesn't work... -- Marc Glisse

Re: [PATCH] Fix PR23471

2016-03-31 Thread Marc Glisse
com> * fold-const.c (tree_binary_nonnegative_warnv_p) : Handle the case a * a; where it should be positive always. * gcc.dg/pr23471.c: New testcase. Er, the code just below your patch should already handle this case, no? -- Marc Glisse

Re: [PATCH] Fix PR70372

2016-03-23 Thread Marc Glisse
f; + v ^= ~v; + v &= ~u; + v -= -u; + return v; + } -- Marc Glisse

Re: [PATCH] Adjust PR70251 fix

2016-03-22 Thread Marc Glisse
On Tue, 22 Mar 2016, Richard Biener wrote: On March 22, 2016 4:55:13 PM GMT+01:00, Marc Glisse <marc.gli...@inria.fr> wrote: On Tue, 22 Mar 2016, Richard Biener wrote: This adjusts the PR70251 fix as discussed in the PR audit trail and fixes a bug in genmatch required (bah, stupid G

Re: [PATCH] Adjust PR70251 fix

2016-03-22 Thread Marc Glisse
@2) It seems that the references to @0 in the "if" should use @1 instead (at least the last one). I assume this test is to make sure that A has as many integer elements of the same size as the result of the vec_cond_expr. Sorry for giving you an incomplete change in the PR. -- Marc Glisse

Re: [PATHCH] Disable inline asm for in-tree mpfr (PR69134)

2016-03-20 Thread Marc Glisse
On Sun, 20 Mar 2016, Andreas Schwab wrote: Marc Glisse <marc.gli...@inria.fr> writes: For most packages, providing CFLAGS for configure is enough, you don't have to give them *again* to make. The toplevel GCC Makefile needs to pass down any CFLAGS setting that has been passed in by th

Re: [PATHCH] Disable inline asm for in-tree mpfr (PR69134)

2016-03-20 Thread Marc Glisse
On Sun, 20 Mar 2016, Bernd Edlinger wrote: On 20.03.2016 11:03, Marc Glisse wrote: On Sun, 20 Mar 2016, Bernd Edlinger wrote: So I looked for a way to disable the asm code, and found it can be done, but differently than for in-tree gmp. See the attached patch. As noted in PR 67728

Re: [PATHCH] Disable inline asm for in-tree mpfr (PR69134)

2016-03-20 Thread Marc Glisse
e-assembly, gcc will still manage to break things because it calls make CFLAGS=-g, which bypasses the GMP mechanism for defining NO_ASM. We might change that mechanism at some point in the future in GMP: https://gmplib.org/list-archives/gmp-devel/2016-March/004257.html but that's not for right now

Re: [PATHCH] Disable inline asm for in-tree mpfr (PR69134)

2016-03-19 Thread Marc Glisse
patch. As noted in PR 67728, it seems that gcc's intrusive way of overriding CFLAGS also breaks GMP itself, not just MPFR, by hiding the macro NO_ASM that GMP tries to define through its own CFLAGS. So maybe Bernd's patch should be duplicated to also apply to GMP? -- Marc Glisse

Re: [PATCH] Fix ICE with vector types in X % -Y pattern (PR middle-end/70050)

2016-03-03 Thread Marc Glisse
.c @@ -0,0 +1,11 @@ +/* PR middle-end/70025 */ +/* { dg-do compile } */ +/* { dg-options "-Wno-psabi" } */ + +typedef int v8si __attribute__ ((vector_size (32))); + +v8si +foo (v8si v) +{ + return v %= -v; +} -- Marc Glisse

<    1   2   3   4   5   6   7   8   9   10   >