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
dg/ext/is_trivially_constructible1.C: Add tests for void target.
What happens for "const void" and other variants?
--
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
and such an optimization? Or are the goals
likely to diverge too soon for sharing to be practical?
--
Marc Glisse
issue came up, and Ada folks
asked us to keep the builtins...
--
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
, 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
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
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
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
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
as free/delete, deallocate can
only be called with something allocate returned, not 0. So we don't have a
choice.
--
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
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
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
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
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
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
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
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
.
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
e-optimized" }
#include
Making g static should work even with PIC.
--
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
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
p;(b>=0) since it just tests for the sign
bit (surprisingly we seem to generate different code for the 2 versions).
--
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
are very far from the start of the function.
--
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
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
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
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
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
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
.
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
(assuming I read
the doc correctly)? Possibly relax things even more if it helps other
customization tools?
--
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
ous.
--
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
to match.pd. But I
agree that most transformations do not look at ranges at all.
--
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
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
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
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
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
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,
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
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
revent from discussing it)
--
Marc Glisse
s for now.
--
Marc Glisse
d), so it already has the
appropriate 1 or 0 in the right place.
--
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
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
= 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
at the testsuite), but you'll
need a real reviewer to approve the patch...
--
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
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
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
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
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
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
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
example)
Is a builtin really needed here? What would happen if you used
return __A & __B;
?
--
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
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
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
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
because C only
becomes a constant at that stage?
--
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
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
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__
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,
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/
(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
.
(related to PR 68714)
--
Marc Glisse
be cool to do the same for floats (most
likely at the RTL level).
--
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
specific vector types (that people probably didn't have in mind when
developing the C extension)?
--
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
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
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
d long)(-2),3ul)
seems to satisfy your conditions, but is not the same as
max(-2,3)
--
Marc Glisse
erations, which
would allow constant folding as well as other optimizations.
--
Marc Glisse
explained in an earlier
message, but we can do that later as the need arises)
--
Marc Glisse
absurd
way to go about it ;-)
--
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
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
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
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
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
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
__noexcept_auto__ spelling) and just use that
in most places where we want a conditional noexcept.
--
Marc Glisse
. Is there a macro to test for this feature? I couldn't find it in the
latest sg10 list.
--
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
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
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
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
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
(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
entry would also help.
--
Marc Glisse
eger_each_nonzerop vs integer_not_all_zerop?
--
Marc Glisse
401 - 500 of 1573 matches
Mail list logo