[libstdc++] Assertion in optional

2017-05-14 Thread Marc Glisse
on powerpc64le-unknown-linux-gnu. 2017-05-15 Marc Glisse <marc.gli...@inria.fr> * include/std/optional (_Optional_base::_M_get): Check precondition. * testsuite/20_util/optional/cons/value_neg.cc: Update line numbers. -- Marc GlisseIndex: include/std/op

Re: [c++ PATCH] PR c++/80682

2017-05-09 Thread Marc Glisse
dg/ext/is_trivially_constructible1.C: Add tests for void target. What happens for "const void" and other variants? -- Marc Glisse

Re: [PATCH, RFC] warn about raw pointers that can be unique_ptr

2017-05-08 Thread Marc Glisse
On Sun, 7 May 2017, Trevor Saunders wrote: On Sun, May 07, 2017 at 07:32:48PM +0200, Marc Glisse wrote: On Sun, 7 May 2017, tbsaunde+...@tbsaunde.org wrote: This is a start at warning about various resource allocation issues that can be improved. Currently it only warns about functions

Re: [PATCH, RFC] warn about raw pointers that can be unique_ptr

2017-05-07 Thread Marc Glisse
and such an optimization? Or are the goals likely to diverge too soon for sharing to be practical? -- Marc Glisse

Re: [PATCH] [x86] Avoid builtins for SSE/AVX2 immidiate logical shifts

2017-05-02 Thread Marc Glisse
issue came up, and Ada folks asked us to keep the builtins... -- Marc Glisse

Re: [PATCH GCC8][22/33]Generate TMR in new reassociation order

2017-05-02 Thread Marc Glisse
ious version. This isn't a context diff. Thanks for reviewing. I used git diff -U20 to generate patch. Maybe 20 is too small? See option -c (instead of -u) in man diff. -- Marc Glisse

Re: [PATCH] PR libstdc++/80553 don't allow destroying non-destructible types

2017-05-02 Thread Marc Glisse
, even those with iterators much more complicated than vector's? I'd rather keep the special code in the library, if it doesn't cause too much trouble. -- Marc Glisse

Re: Add st[pr]ncpy to stmt_kills_ref_p

2017-04-30 Thread Marc Glisse
On Sun, 30 Apr 2017, Martin Sebor wrote: On 04/29/2017 01:17 AM, Marc Glisse wrote: Hello, this patch seems rather trivial, once one knows that those functions always write exactly n characters (they fill with 0 as needed at the end). Nice! Now it just needs to be made to work the other

Add st[pr]ncpy to stmt_kills_ref_p

2017-04-29 Thread Marc Glisse
Hello, this patch seems rather trivial, once one knows that those functions always write exactly n characters (they fill with 0 as needed at the end). Bootstrap+regtest on powerpc64le-unknown-linux-gnu. 2017-05-02 Marc Glisse <marc.gli...@inria.fr> PR tree-optimization/804

Re: Drop Z from X + Z < Y + Z

2017-04-28 Thread Marc Glisse
On Fri, 28 Apr 2017, Richard Biener wrote: On Fri, Apr 28, 2017 at 1:35 PM, Marc Glisse <marc.gli...@inria.fr> wrote: Hello, surprisingly, this did not cause any Wstrict-overflow failure. Some of it sounds more like reassoc's job, but it is convenient to handle simple cases in match

Drop Z from X + Z < Y + Z

2017-04-28 Thread Marc Glisse
ned types. I may still be able to remove the divisions, I'll see if I can sprinkle some 'convert' in recent transformations. Bootstrap+regtest on powerpc64le-unknown-linux-gnu. 2017-04-28 Marc Glisse <marc.gli...@inria.fr> gcc/ * match.pd (X+Z CMP Y+Z, X-Z CMP Y-Z, Z-X CMP

Re: std::vector move assign patch

2017-04-25 Thread Marc Glisse
as free/delete, deallocate can only be called with something allocate returned, not 0. So we don't have a choice. -- Marc Glisse

Re: std::vector move assign patch

2017-04-25 Thread Marc Glisse
On Tue, 25 Apr 2017, Jonathan Wakely wrote: On 25/04/17 17:23 +0200, Marc Glisse wrote: On Tue, 25 Apr 2017, Jonathan Wakely wrote: On 24/04/17 22:10 +0200, Marc Glisse wrote: It seems that this patch had 2 consequences that may or may not have been planned. Consider this example (from

Re: std::vector move assign patch

2017-04-25 Thread Marc Glisse
On Tue, 25 Apr 2017, Jonathan Wakely wrote: On 24/04/17 22:10 +0200, Marc Glisse wrote: It seems that this patch had 2 consequences that may or may not have been planned. Consider this example (from PR64601) #include typedef std::vector V; void f(V,V){ V(std::move(w)).swap(v); } void g(V,V

Re: X /[ex] 4 < Y /[ex] 4

2017-04-25 Thread Marc Glisse
overlap with someone else's. I just have a couple more transformations of the type (X OP Y) CMP (X OP Z), but that will not affect std::vector. My first guess for improving std::vector would be around the lack of magic in new/delete, compared to malloc/free. -- Marc Glisse

Re: std::vector move assign patch

2017-04-24 Thread Marc Glisse
ms to turn v into a nice empty vector, while f(v,v) turns it into an invalid vector pointing at released memory. Since 2) is a nice side-effect, it may not be worth rewriting operator= in a way that improves 1) but loses 2). Anyway, just mentioning this here. -- Marc Glisse

Re: Let tree_single_nonzero_warnv_p use VRP

2017-04-24 Thread Marc Glisse
On Mon, 24 Apr 2017, Martin Sebor wrote: On 04/23/2017 03:38 PM, Marc Glisse wrote: Hello, this patches teaches tree_expr_nonzero_warnv_p to handle SSA_NAME using range information and known (non-)zero bits, by delegating to expr_not_equal_to which already knows how to handle all

Re: Let tree_single_nonzero_warnv_p use VRP

2017-04-24 Thread Marc Glisse
On Mon, 24 Apr 2017, Jakub Jelinek wrote: On Mon, Apr 24, 2017 at 09:41:01AM +0200, Richard Biener wrote: On Sun, Apr 23, 2017 at 11:38 PM, Marc Glisse <marc.gli...@inria.fr> wrote: Hello, this patches teaches tree_expr_nonzero_warnv_p to handle SSA_NAME using range information and

Re: X /[ex] 4 < Y /[ex] 4

2017-04-24 Thread Marc Glisse
On Mon, 24 Apr 2017, Jakub Jelinek wrote: +/* X / 4 < Y / 4 iif X < Y when the division is known to be exact. */ s/iif/iff/ ? Indeed, thanks, I've fixed it locally. -- Marc Glisse

X /[ex] 4 < Y /[ex] 4

2017-04-24 Thread Marc Glisse
Hello, we were missing this simplification on comparisons. Note that the testcase still does not simplify as much as one might like, we don't turn x+z

Let tree_single_nonzero_warnv_p use VRP

2017-04-23 Thread Marc Glisse
. 2017-04-24 Marc Glisse <marc.gli...@inria.fr> gcc/ * fold-const.c (tree_single_nonzero_warnv_p): Handle SSA_NAME. gcc/testsuite/ * gcc.dg/tree-ssa/cmpmul-1.c: New file. * gcc.dg/Wstrict-overflow-18.c: Xfail. -- Marc GlisseIndex: gcc/fold-c

Re: [PATCH] Fix PR80275

2017-04-04 Thread Marc Glisse
e-optimized" } #include Making g static should work even with PIC. -- Marc Glisse

Re: [PATCH] Fix PR80281

2017-04-03 Thread Marc Glisse
as well, it seems possible to transform X-INT_MIN into X+INT_MIN if INT_MIN comes as (int)(-(unsigned)INT_MIN). -- Marc Glisse

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

2017-03-20 Thread Marc Glisse
ging the condition that uses it? One of the tests for flag_check_new is redundant. In C++17 mode, you test for NULL return from throwing operator new, why? This is a DR, doesn't it mean that it should apply to all modes? Or is the hope that limiting it to an experimental mode might let it pass in

Re: [PATCH 2/5][P1][tree-optimization/71437] Record more equivalences in some cases

2017-03-16 Thread Marc Glisse
p;(b>=0) since it just tests for the sign bit (surprisingly we seem to generate different code for the 2 versions). -- Marc Glisse

Re: PR79697: Delete calls to strdup, strndup, realloc if there is no lhs

2017-02-25 Thread Marc Glisse
can perform the same optimization as with malloc, wouldn't it be better to optimize: realloc(0,n) -> malloc(n) and let the malloc optimizations happen? (realloc(p,0)->free(p) is more tricky because of the return value, like malloc(0)) -- Marc Glisse

Re: [PATCH] Look through clobber stmts in uninit (PR tree-optimization/79345)

2017-02-20 Thread Marc Glisse
are very far from the start of the function. -- Marc Glisse

Re: [PATCH] Fix PR79547

2017-02-17 Thread Marc Glisse
trcspn, __builtin_object_size and __builtin_constant_p without any constraints. We have EAF_NOESCAPE that we are using for non-builtins, though it probably gets little use there. Would it make sense to use it here as well, or would that be pointless? -- Marc Glisse

Re: [RFA][PR tree-optimization/79095] [PATCH 1/4] Improve ranges for MINUS_EXPR and EXACT_DIV_EXPR V2

2017-02-14 Thread Marc Glisse
On Mon, 13 Feb 2017, Jeff Law wrote: On 02/13/2017 09:15 AM, Marc Glisse wrote: On Mon, 13 Feb 2017, Jeff Law wrote: On 02/12/2017 12:13 AM, Marc Glisse wrote: On Tue, 7 Feb 2017, Jeff Law wrote: * tree-vrp.c (extract_range_from_binary_expr_1): For EXACT_DIV_EXPR, if the numerator has

Re: [RFA][PR tree-optimization/79095] [PATCH 1/4] Improve ranges for MINUS_EXPR and EXACT_DIV_EXPR V2

2017-02-13 Thread Marc Glisse
On Mon, 13 Feb 2017, Jeff Law wrote: On 02/12/2017 12:13 AM, Marc Glisse wrote: On Tue, 7 Feb 2017, Jeff Law wrote: * tree-vrp.c (extract_range_from_binary_expr_1): For EXACT_DIV_EXPR, if the numerator has the range ~[0,0] make the resultant range ~[0,0]. If I understand correctly, for x

Re: [PATCH] Improve x % y to x VRP optimization (PR tree-optimization/79408)

2017-02-13 Thread Marc Glisse
On Mon, 13 Feb 2017, Jakub Jelinek wrote: On Mon, Feb 13, 2017 at 09:59:12AM +0100, Richard Biener wrote: On Sun, 12 Feb 2017, Marc Glisse wrote: On Sun, 12 Feb 2017, Marc Glisse wrote: On Tue, 7 Feb 2017, Jakub Jelinek wrote: * tree-vrp.c (simplify_div_or_mod_using_ranges

Re: [RFA][PR tree-optimization/79095] [PATCH 1/4] Improve ranges for MINUS_EXPR and EXACT_DIV_EXPR V2

2017-02-11 Thread Marc Glisse
to the EXACT_DIV_EXPR case (and supposedly the patch will be reverted if we get a new non-contiguous version of ranges, where union would already work). Is that it? -- Marc Glisse

Re: [PATCH] Improve x % y to x VRP optimization (PR tree-optimization/79408)

2017-02-11 Thread Marc Glisse
On Sun, 12 Feb 2017, Marc Glisse wrote: On Tue, 7 Feb 2017, Jakub Jelinek wrote: * tree-vrp.c (simplify_div_or_mod_using_ranges): If op1 is not constant, but SSA_NAME with a known integer range, use the minimum of that range instead of op1 to determine if modulo can

Re: [PATCH] Improve x % y to x VRP optimization (PR tree-optimization/79408)

2017-02-11 Thread Marc Glisse
. Would it make sense to use something like the operand_less_p helper so we would also handle an INTEGER_CST lhs? unsigned f(unsigned x){ if(x<42)return 18; return 33%x; } -- Marc Glisse

Re: gcc.css colors

2017-02-01 Thread Marc Glisse
(assuming I read the doc correctly)? Possibly relax things even more if it helps other customization tools? -- Marc Glisse

Re: [PATCH][RFA][PR tree-optimization/79095] Improve overflow test optimization and avoid invalid warnings

2017-01-27 Thread Marc Glisse
1 == 0 will get canonicalized back into x == -1. Well, it doesn't always get canonicalized since I got different code above for b==0 and for a==-1. There may be another single_use check in there. But that was probably not a good idea anyway. -- Marc Glisse

Re: [PATCH][RFA][PR tree-optimization/79095] Improve overflow test optimization and avoid invalid warnings

2017-01-27 Thread Marc Glisse
ous. -- Marc Glisse

Re: [PATCH][RFA][PR tree-optimization/79095] Improve overflow test optimization and avoid invalid warnings

2017-01-25 Thread Marc Glisse
cmove %edx, %eax while with a==-1 we have the redundant comparison leal1(%rdi), %eax cmpl$-1, %edi movl$42, %edx cmove %edx, %eax Simplifying x + 1 < x to x + 1 == 0 might not be enough to simplify your examples though I guess? -- Marc Glisse

Re: A + B CMP A -> A CMP' CST' match.pd patterns [was [PATCH] avoid calling memset et al. with excessively large sizes (PR 79095)]

2017-01-24 Thread Marc Glisse
to match.pd. But I agree that most transformations do not look at ranges at all. -- Marc Glisse

Re: [PATCH] PR libstdc++/79206 check string_view sizes in operator==

2017-01-24 Thread Marc Glisse
On Tue, 24 Jan 2017, Jonathan Wakely wrote: I've just committed this, and then noticed that we don't do the same optimization for basic_string unless the char_type is char. Note the "see also" field in that PR ;-) -- Marc Glisse

Re: A + B CMP A -> A CMP' CST' match.pd patterns [was [PATCH] avoid calling memset et al. with excessively large sizes (PR 79095)]

2017-01-24 Thread Marc Glisse
certainly don't want to re-fold everything all the time. VRP is kind of a special case, every variable for which it finds a new/improved range could be considered changed, since it may trigger some extra transformation in match.pd (same for CCP and the nonzero mask). -- Marc Glisse

Re: A + B CMP A -> A CMP' CST' match.pd patterns [was [PATCH] avoid calling memset et al. with excessively large sizes (PR 79095)]

2017-01-21 Thread Marc Glisse
plicate parts of what match.pd does, but certainly doable -- I've even prototyped it. Thoughts? I believe we are supposed to call match.pd from VRP eventually (though that may not have happened yet), so the test could probably also be done there, if that looks more convenient and we decide not to remove single_use completely for this transformation. -- Marc Glisse

Re: [PATCH][GIMPLE FE] Add parsing of MEM_REFs

2017-01-12 Thread Marc Glisse
456ULL), something else? Yes, unless we teach libcpp about larger than 64bit literals. Teaching libcpp about 128bit literals sounds like a much nicer idea indeed... -- Marc Glisse

Re: [PATCH] Optimize X << Y with low bits of Y known to be 0 (PR tree-optimization/71563)

2016-12-20 Thread Marc Glisse
R tree-optimization/71563 * match.pd: Simplify X << Y into X if Y is known to be 0 or out of range value - has low bits known to be zero. Hello, would it make sense to extend it to rotates later? Note that you can write (shift @0 SSA_NAME@1) in the pattern instead of a separate tes

Re: [PATCH] [x86] Don't use builtins for SIMD shifts

2016-12-13 Thread Marc Glisse
On Tue, 13 Dec 2016, Richard Biener wrote: On Sat, Dec 10, 2016 at 7:59 PM, Marc Glisse <marc.gli...@inria.fr> wrote: On Sat, 10 Dec 2016, Allan Sandfeld Jensen wrote: On Saturday 10 December 2016, Marc Glisse wrote: On Sat, 10 Dec 2016, Marc Glisse wrote: On Sat, 10 Dec 2016,

Re: [PATCH] [x86] Don't use builtins for SIMD shifts

2016-12-10 Thread Marc Glisse
On Sat, 10 Dec 2016, Allan Sandfeld Jensen wrote: On Saturday 10 December 2016, Marc Glisse wrote: On Sat, 10 Dec 2016, Marc Glisse wrote: On Sat, 10 Dec 2016, Allan Sandfeld Jensen wrote: Replaces the definitions of the shift intrinsics with GCC extension syntax to allow GCC to reason about

Re: [PATCH] [x86] Don't use builtins for SIMD shifts

2016-12-10 Thread Marc Glisse
On Sat, 10 Dec 2016, Marc Glisse wrote: On Sat, 10 Dec 2016, Allan Sandfeld Jensen wrote: Replaces the definitions of the shift intrinsics with GCC extension syntax to allow GCC to reason about what the instructions does. Tests are added to ensure the intrinsics still produce the right

Re: [PATCH] [x86] Don't use builtins for SIMD shifts

2016-12-10 Thread Marc Glisse
revent from discussing it) -- Marc Glisse

Re: [PATCH] Fix A < 0 ? C : 0 optimization (PR tree-optimization/78720)

2016-12-10 Thread Marc Glisse
s for now. -- Marc Glisse

Re: [PATCH] Fix A < 0 ? C : 0 optimization (PR tree-optimization/78720)

2016-12-09 Thread Marc Glisse
d), so it already has the appropriate 1 or 0 in the right place. -- Marc Glisse

Re: [PATCH] improve folding of expressions that move a single bit around

2016-11-26 Thread Marc Glisse
ild_int_cst (integer_type_node, shift); }) + (convert (rshift @2 { build_int_cst (integer_type_node, -shift); }) What happens if @1 is the sign bit, in a signed type? Do we get an arithmetic shift right? -- Marc Glisse

Re: [Patch][i386] PR 70118: Fix ubsan warning on SSE2 loadl_epi64 and storel_epi64

2016-11-26 Thread Marc Glisse
much, in places where the lack of may_alias might be an issue... Or maybe I am afraid for no reason and even here the may_alias is unnecessary. Looking at dumps also makes me wonder if we could simplify view_convert_expr(bit_field_expr) to just bit_field_expr when it is the only use. -- Marc Glisse

Re: [PATCH GCC]Move simplification of (A == C1) ? A : C2 to match.pd

2016-11-23 Thread Marc Glisse
= TREE_CODE (@0), cmp_code = TREE_CODE (@0); Note that you can use cmp directly, it is already equal to LT_EXPR or one of the others. -- Marc Glisse

Re: [PING] [PATCH] Fix PR31096

2016-11-22 Thread Marc Glisse
at the testsuite), but you'll need a real reviewer to approve the patch... -- Marc Glisse

Re: [PATCH, testsuite]: Fix detection of -j make argument

2016-11-22 Thread Marc Glisse
doesn't work in the later case. Attached patch reworks this functionality to detect -j correctly in all cases. Hello, I didn't read the patch, but do you think this also fixes PR 53155 ? -- Marc Glisse

Re: [libgcc] Protect __TMC_END__ - __TMC_LIST__ == 0

2016-11-20 Thread Marc Glisse
On Fri, 4 Nov 2016, Andrew Pinski wrote: On Fri, Nov 4, 2016 at 7:08 AM, Marc Glisse <marc.gli...@inria.fr> wrote: Ping https://gcc.gnu.org/ml/gcc-patches/2016-10/msg02220.html I think this is obvious. Ok, I've committed it. -- Marc Glisse

Re: Fix PR78154

2016-11-16 Thread Marc Glisse
the patch. Note also that memcpy already has both an attribute that says that it returns its first argument, and an attribute that says that said first argument is nonnull. (I've heard some noise in C++-land about making memcpy(0,0,0) valid, but that may have just been noise) -- Marc Glisse

Re: [PATCH] Fix PR78305

2016-11-16 Thread Marc Glisse
On Wed, 16 Nov 2016, Michael Matz wrote: Hi, On Wed, 16 Nov 2016, Marc Glisse wrote: The first sentence about ORing the sign bit sounds strange (except for a sign-magnitude representation). With 2's complement, INT_MIN is -2^31, the divisors are the 2^k and -(2^k). -2 * 2^30 yields INT_MIN

Re: [PATCH] Fix PR78305

2016-11-16 Thread Marc Glisse
On Wed, 16 Nov 2016, Richard Biener wrote: On Wed, 16 Nov 2016, Marc Glisse wrote: On Wed, 16 Nov 2016, Richard Biener wrote: On Wed, 16 Nov 2016, Marc Glisse wrote: On Wed, 16 Nov 2016, Richard Biener wrote: I am testing the following to avoid undefined behavior when negating

Re: [PATCH] Fix PR78305

2016-11-16 Thread Marc Glisse
On Wed, 16 Nov 2016, Richard Biener wrote: On Wed, 16 Nov 2016, Marc Glisse wrote: On Wed, 16 Nov 2016, Richard Biener wrote: I am testing the following to avoid undefined behavior when negating a multiplication (basically extending a previous fix to properly handle negative power of two

Re: [PATCH] Fix PR78305

2016-11-16 Thread Marc Glisse
lus } */ +/* { dg-do run } */ + +int main () +{ + int a = 2; + int b = 1; + + int t = -1 * ( -0x4000 * a / ( -0x2000 + b ) ) / -1; + + if (t != 4) __builtin_abort(); + + return 0; +} -- Marc Glisse

Re: [PATCH] Add AVX512 k-mask intrinsics

2016-11-11 Thread Marc Glisse
example) Is a builtin really needed here? What would happen if you used return __A & __B; ? -- Marc Glisse

Re: [RFC] Check number of uses in simplify_cond_using_ranges().

2016-11-10 Thread Marc Glisse
am not convinced we need the overflow stuff at all here. +(for cmp (eq ne gt ge lt le) (for cmp (simple_comparison) + (cmp (convert@0 @1) INTEGER_CST@2) + (if (TREE_CODE (@1) == SSA_NAME (cmp (convert@0 SSA_NAME@1) INTEGER_CST@2) + (cmp { @1; } (convert @2)) (cmp @1 (convert @2)) -- Marc Glisse

Re: [PATCH] Fix PR71762

2016-11-10 Thread Marc Glisse
We have a number of other optimizations that take advantage of the fact that bool is in [0, 1], even without looking at VRP, say for instance x != 0 -> x. Are we supposed to remove all of them? -- Marc Glisse

Re: [PATCH] simplify-rtx: Transform (xor (and (xor A B) C) B) with C const

2016-11-09 Thread Marc Glisse
On Wed, 9 Nov 2016, Marc Glisse wrote: On Wed, 9 Nov 2016, Segher Boessenkool wrote: On Wed, Nov 09, 2016 at 10:54:53PM +0100, Marc Glisse wrote: match.pd transforms (A)|(B&~C) to ((A^B))^B, which is fewer operations if C is not const (and it is not on simple tests at least, this trans

Re: [PATCH] simplify-rtx: Transform (xor (and (xor A B) C) B) with C const

2016-11-09 Thread Marc Glisse
On Wed, 9 Nov 2016, Segher Boessenkool wrote: On Wed, Nov 09, 2016 at 10:54:53PM +0100, Marc Glisse wrote: match.pd transforms (A)|(B&~C) to ((A^B))^B, which is fewer operations if C is not const (and it is not on simple tests at least, this transform is done very early already). Var

Re: [PATCH] simplify-rtx: Transform (xor (and (xor A B) C) B) with C const

2016-11-09 Thread Marc Glisse
because C only becomes a constant at that stage? -- Marc Glisse

Re: [RFC] Check number of uses in simplify_cond_using_ranges().

2016-11-08 Thread Marc Glisse
your point. (and yes, the first half would give a very general (simplify (cmp SSA_NAME@0 INTEGER_CST@1) ...), that doesn't seem so bad) -- Marc Glisse

Simplify X / X, 0 / X and X % X

2016-11-04 Thread Marc Glisse
that instruction and clear the following code, which likely gives better code than replacing 0/0 with 1. Bootstrap+regtest on powerpc64le-unknown-linux-gnu. 2016-11-07 Marc Glisse <marc.gli...@inria.fr> gcc/ * match.pd (0 / X, X / X, X % X): New simplifications. gcc/tes

Re: [libgcc] Protect __TMC_END__ - __TMC_LIST__ == 0

2016-11-04 Thread Marc Glisse
Ping https://gcc.gnu.org/ml/gcc-patches/2016-10/msg02220.html On Thu, 27 Oct 2016, Marc Glisse wrote: Hello, some optimization patch I was working on simplified __TMC_END__ - __TMC_LIST__ == 0 to false, which is not wanted (I assume that's why it wasn't written __TMC_END__ == __TMC_LIST__

Re: Simplify X /[ex] 8 == 0

2016-11-04 Thread Marc Glisse
On Fri, 4 Nov 2016, Richard Biener wrote: On Fri, Nov 4, 2016 at 2:15 PM, Richard Biener <richard.guent...@gmail.com> wrote: On Fri, Nov 4, 2016 at 1:34 PM, Marc Glisse <marc.gli...@inria.fr> wrote: Hello, this kind of simplification is already handled by fold_comparison,

Simplify X /[ex] 8 == 0

2016-11-04 Thread Marc Glisse
org/ml/gcc-patches/2016-10/msg02220.html , I'll rerun the testsuite when that patch is in. 2016-11-07 Marc Glisse <marc.gli...@inria.fr> gcc/ * fold-const.c (fold_comparison): Ignore EXACT_DIV_EXPR. * match.pd (A /[ex] B CMP C): New simplifications. gcc/testsuite/

Re: [match.pd] Fix for PR35691

2016-11-03 Thread Marc Glisse
(double&)c==0; less so... (and I am assuming that signaling NaNs don't make the whole transformation impossible, which might be wrong) -- Marc Glisse

Re: [match.pd] Fix for PR35691

2016-11-03 Thread Marc Glisse
. (related to PR 68714) -- Marc Glisse

Re: [match.pd] Fix for PR35691

2016-11-03 Thread Marc Glisse
be cool to do the same for floats (most likely at the RTL level). -- Marc Glisse

Re: [PATCH] Fix PR77407

2016-11-01 Thread Marc Glisse
On Mon, 31 Oct 2016, Richard Biener wrote: On Fri, 28 Oct 2016, Marc Glisse wrote: On Wed, 28 Sep 2016, Richard Biener wrote: The following patch implements patterns to catch x / abs (x) and x / -x, taking advantage of undefinedness at x == 0 as opposed to the PR having testcases

Re: [PATCH, RFC, rs6000] Add overloaded built-in function support to altivec.h, and re-implement vec_add

2016-11-01 Thread Marc Glisse
specific vector types (that people probably didn't have in mind when developing the C extension)? -- Marc Glisse

Re: [PATCH] Fix PR77407

2016-10-28 Thread Marc Glisse
visions by zero. This is the reason why we don't simplify x / x to 1 or 0 / x to 0. */ Did we give up on preserving divisions by 0? Can we now do the 2 simplifications listed by the comment? -- Marc Glisse

[libgcc] Protect __TMC_END__ - __TMC_LIST__ == 0

2016-10-27 Thread Marc Glisse
Hello, some optimization patch I was working on simplified __TMC_END__ - __TMC_LIST__ == 0 to false, which is not wanted (I assume that's why it wasn't written __TMC_END__ == __TMC_LIST__ in the first place). Bootstrap+regtest on powerpc64le-unknown-linux-gnu. 2016-10-27 Marc Glisse

Re: [PATCH GCC][1/4]Simplify (convert1 (minmax ((convert2 (x) c)))) into minmax (x c)

2016-10-26 Thread Marc Glisse
On Wed, 26 Oct 2016, Bin.Cheng wrote: On Wed, Oct 26, 2016 at 3:10 PM, Bin.Cheng <amker.ch...@gmail.com> wrote: On Wed, Oct 26, 2016 at 3:04 PM, Marc Glisse <marc.gli...@inria.fr> wrote: On Wed, 26 Oct 2016, Bin.Cheng wrote: Thanks for reviewing, updated patch attache

Re: [PATCH GCC][1/4]Simplify (convert1 (minmax ((convert2 (x) c)))) into minmax (x c)

2016-10-26 Thread Marc Glisse
d long)(-2),3ul) seems to satisfy your conditions, but is not the same as max(-2,3) -- Marc Glisse

Re: [PATCH] Also fold bmi/bmi2/tbm bextr/bextri/bzhi/pext/pdep builtins

2016-10-22 Thread Marc Glisse
erations, which would allow constant folding as well as other optimizations. -- Marc Glisse

Re: [PATCH] Fix PR77826

2016-10-15 Thread Marc Glisse
explained in an earlier message, but we can do that later as the need arises) -- Marc Glisse

Re: [PATCH] Fix PR77826

2016-10-12 Thread Marc Glisse
absurd way to go about it ;-) -- Marc Glisse

Re: [PATCH GCC]Simplify (convert)(X op const) -> (convert)X op (convert)const by match

2016-10-11 Thread Marc Glisse
patch). It is better to write tests for the gimple version of transformations, i.e. don't write everything as a single expression, use intermediate variables. -- Marc Glisse

Re: [PATCH] Fix PR77826

2016-10-11 Thread Marc Glisse
se (int)(b-a) could be a truncation in which case multiplying with 4 might not result in the same value as b-a truncated(?). The comment before the unpatched patterns said "sign-changing conversions" but nothign actually verified this. Might be that truncations are indeed ok now that I think

Re: [PATCH] Fix PR77826

2016-10-10 Thread Marc Glisse
On Fri, 7 Oct 2016, Richard Biener wrote: On Thu, 6 Oct 2016, Marc Glisse wrote: On Wed, 5 Oct 2016, Richard Biener wrote: The following will fix PR77826, the issue that in match.pd matching up two things uses operand_equal_p which is too lax about the type of the toplevel entity (at least

Re: [PATCH] Optimize a >= 0 && a < b if VR info says b >= 0 (PR tree-optimization/77664)

2016-10-06 Thread Marc Glisse
nd a >= b in the second). I guess that the slightly more general: X >= A && X < B where we know that A <= B --> (unsigned)X - (unsigned)A < (unsigned)B - (unsigned)A generates too many operations and does not gain anything? The case where A and B are constants seems to be handled by ifcombine, currently. -- Marc Glisse

Re: [PATCH] Fix PR77826

2016-10-06 Thread Marc Glisse
does? * match.pd ((X /[ex] A) * A -> X): Properly handle converted and constant A. This regressed int f(int*a,int*b){return 4*(int)(b-a);} -- Marc Glisse

Re: C++ PATCH for C++17 class template placeholders

2016-10-05 Thread Marc Glisse
On Wed, 5 Oct 2016, Jason Merrill wrote: On Wed, Oct 5, 2016 at 5:29 AM, Marek Polacek <pola...@redhat.com> wrote: On Wed, Oct 05, 2016 at 08:58:08AM +0200, Marc Glisse wrote: On Tue, 4 Oct 2016, Jason Merrill wrote: C++17 adds the ability to omit the template arguments for a class te

Re: [PATCH] 77864 Fix noexcept conditions for map/set default constructors

2016-10-05 Thread Marc Glisse
__noexcept_auto__ spelling) and just use that in most places where we want a conditional noexcept. -- Marc Glisse

Re: C++ PATCH for C++17 class template placeholders

2016-10-05 Thread Marc Glisse
. Is there a macro to test for this feature? I couldn't find it in the latest sg10 list. -- Marc Glisse

Re: [PATCH] Fix PR55152

2016-10-04 Thread Marc Glisse
On Tue, 4 Oct 2016, Richard Biener wrote: Possibly. Though then for FP we also want - abs (a) -> copysign (a, -1). I thought this might fix PR 62055, but at least on x86_64, we generate much worse code for copysign(,-1) than for -abs :-( -- Marc Glisse

Re: [PATCH] Fix PR77407

2016-10-01 Thread Marc Glisse
tor_size(16))); vec f(vec x){ vec y=(x<0)?-x:x; return x/y; } (I wasn't sure if you had added a feature to turn cond into vec_cond automatically in some cases) -- Marc Glisse

Re: [PATCH] Define 3-argument overloads of std::hypot for C++17 (P0030R1)

2016-09-28 Thread Marc Glisse
the C semantics. On the other hand, the paper mentions speed and convenience as the main selling points. Maybe LWG could clarify the intent? -- Marc Glisse

Re: [PATCH] Define 3-argument overloads of std::hypot for C++17 (P0030R1)

2016-09-27 Thread Marc Glisse
for errno? Otherwise, I have a hard time believing that 3 multiplications and 2 additions can be slower than 4 multiplications, 2 additions, plus a bunch of tests and divisions. -- Marc Glisse

Re: [PATCH] Handle VECTOR_CST in integer_nonzerop()

2016-09-20 Thread Marc Glisse
On Mon, 19 Sep 2016, Patrick Palka wrote: On Wed, Sep 14, 2016 at 1:58 AM, Marc Glisse <marc.gli...@inria.fr> wrote: On Fri, 19 Aug 2016, Patrick Palka wrote: On Fri, Aug 19, 2016 at 7:30 PM, Patrick Palka <patr...@parcs.ath.cx> wrote: integer_nonzerop() currently uncondition

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

2016-09-16 Thread Marc Glisse
(align - 1), for instance. I guess people interested in performance will do for aligned new the same as for the old new: provide an inline version that skips all the overhead to forward directly to malloc/aligned_alloc (and avoid questionable calls in their code). -- Marc Glisse

Re: Fix compilation errors with libstdc++v3 for AVR target and allow --enable-libstdcxx

2016-09-15 Thread Marc Glisse
entry would also help. -- Marc Glisse

Re: [PATCH] Handle VECTOR_CST in integer_nonzerop()

2016-09-14 Thread Marc Glisse
eger_each_nonzerop vs integer_not_all_zerop? -- Marc Glisse

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