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

2016-03-03 Thread Marc Glisse
@ +/* 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

Re: [PATCH, match] Fix pr68714

2016-03-02 Thread Marc Glisse
akubs comment #4) given || and && associate. So I'd rather go down that route if possible. Still, if there are some easy cases that can be handled early in match.pd, that can't hurt... (if there aren't, that's fine) Just like x+y+x -> 2*x+y is for reassoc, but x+x -> 2*x can be done in match.pd. -- Marc Glisse

Re: [PATCH] Fix PR69595, bogus -Warray-bound warning

2016-02-13 Thread Marc Glisse
(bit_and:c (test1 @0 @1) (test2 @0 @1)) + (if (INTEGRAL_TYPE_P (TREE_TYPE (@0)) +|| VECTOR_INTEGER_TYPE_P (TREE_TYPE (@0))) +{ constant_boolean_node (false, type); }))) + /* -A CMP -B -> B CMP A. */ (for cmp (tcc_comparison) scmp (swapped_tcc_comparison) -- Marc Glisse

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-27 Thread Marc Glisse
On Wed, 27 Jan 2016, Jakub Jelinek wrote: On Wed, Jan 27, 2016 at 09:10:14AM +0100, Marc Glisse wrote: Revised: /* Returns true if TYPE is POD of one-byte or less in size for the purpose of layout and an empty class or an class with empty classes. */ static bool is_empty_record (tree type

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-27 Thread Marc Glisse
&& !is_empty_record (TREE_TYPE (field))) return false; return true; } -- Marc Glisse

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-26 Thread Marc Glisse
On Tue, 26 Jan 2016, H.J. Lu wrote: On Tue, Jan 26, 2016 at 12:23 PM, Marc Glisse wrote: On Tue, 26 Jan 2016, H.J. Lu wrote: On Tue, Jan 26, 2016 at 11:27 AM, Jason Merrill wrote: On 12/14/2015 05:08 PM, H.J. Lu wrote: + if (abi_version_at_least (10)) +TYPE_EMPTY_RECORD (t

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-26 Thread Marc Glisse
struct dummy i; }; extern true_type y; extern void xxx (true_type c); void yyy (void) { xxx (y); } [hjl@gnu-skl-1 gcc]$ -- Marc Glisse

Re: [patch] libstdc++/60637 Fix C++98 std::signbit

2016-01-18 Thread Marc Glisse
ople don't want such extensions. -- Marc Glisse

Re: [patch] libstdc++/69240 generic operator!= for random number distributions

2016-01-14 Thread Marc Glisse
On Thu, 14 Jan 2016, Jonathan Wakely wrote: On 14/01/16 20:13 +0100, Marc Glisse wrote: I didn't think about it much, but I am worried that __random_not_eq will accidentally become an associated namespace for more classes than we would expect. Yes, it would be an associated namespac

Re: [patch] libstdc++/69240 generic operator!= for random number distributions

2016-01-14 Thread Marc Glisse
n associated namespace for more classes than we would expect. -- Marc Glisse

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

2016-01-05 Thread Marc Glisse
On Tue, 5 Jan 2016, Marc Glisse wrote: On Tue, 5 Jan 2016, Bernd Edlinger wrote: an in-tree mpfr build enables inline asm code, which makes the mips-bootstrap fail, because at least mpfr 2.4.2 uses the "=h" constraint but in config/mips/constraints.md we find: "Former

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

2016-01-05 Thread Marc Glisse
gmp with --disable-assembly, the flag -DNO_ASM ends up in __GMP_CFLAGS (in gmp.h) and mpfr thus uses it automatically. -- Marc Glisse

Re: [wwwdocs] Document how to add a new SSH key

2015-12-23 Thread Marc Glisse
key < .ssh/id_dsa.pub /home/toon/.ssh/config line 3: Bad protocol spec '1'. toon@moene:~$ cat .ssh/config Host gcc.gnu.org ForwardX11 no Protocol 1 Any hints ? Wild guess (that you are using debian testing or unstable): apt-get install openssh-client-ssh1 ssh1 t...@gcc.gnu.org ... -- Marc Glisse

Re: [PATCH] c++/58109 - alignas() fails to compile with constant expression

2015-12-22 Thread Marc Glisse
big road-block, which there might be), and a little bit more code duplication as in your patch seems appropriate at this stage. -- Marc Glisse

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-12 Thread Marc Glisse
o do it on linux-x86, but not on ios/mac where they dominate and compatibility with their own earlier versions matters more than compatibility with gcc? -- Marc Glisse

Re: [v3 PATCH] PR libstdc++/68139

2015-12-10 Thread Marc Glisse
On Fri, 11 Dec 2015, Ville Voutilainen wrote: On 11 December 2015 at 08:55, Marc Glisse wrote: On Fri, 11 Dec 2015, Ville Voutilainen wrote: Tested on Linux-PPC64. 2015-12-11 Ville Voutilainen PR libstdc++/68139 /libstdc++-v3 * libsupc++/nested_exception.h (_S_rethrow): Use

Re: [v3 PATCH] PR libstdc++/68139

2015-12-10 Thread Marc Glisse
* 18_support/nested_exception/68139.cc: New. -- Marc Glisse

Re: [PATCH] Convert manual unsigned +/- overflow checking into {ADD,SUB}_OVERFLOW (PR target/67089)

2015-12-04 Thread Marc Glisse
On Wed, 25 Nov 2015, Marc Glisse wrote: So, I'd really prefer doing x-y>x to y>x only for single use. Ok Let me post this patch (needs testing on x86, I only tested on ppc which does not implement the new optabs) so I can more easily find it again at next stage 1. It produce

Re: [PATCH] Convert manual unsigned +/- overflow checking into {ADD,SUB}_OVERFLOW (PR target/67089)

2015-11-25 Thread Marc Glisse
if (TYPE_UNSIGNED (TREE_TYPE (@0))) (cmp @1 @0 and a similar one for xagainst floats or whatever, but I could be wrong) -- Marc Glisse

Re: [PATCH] Convert manual unsigned +/- overflow checking into {ADD,SUB}_OVERFLOW (PR target/67089)

2015-11-25 Thread Marc Glisse
On Wed, 25 Nov 2015, Jakub Jelinek wrote: On Wed, Nov 25, 2015 at 09:58:15AM +0100, Marc Glisse wrote: I guess it got lost in my text, but if a user writes: unsigned diff = a - b; if (b > a) { /* overflow */ ... } else { ... } Your patch will not detect it. It seems that replacing x-y>

Re: [PATCH] Convert manual unsigned +/- overflow checking into {ADD,SUB}_OVERFLOW (PR target/67089)

2015-11-25 Thread Marc Glisse
On Wed, 25 Nov 2015, Jakub Jelinek wrote: On Wed, Nov 25, 2015 at 08:56:45AM +0100, Marc Glisse wrote: This is the GIMPLE side of Richard's i?86 uadd/usub overflow testing improvements. If unsigned addition or subtraction result is used both normally and in a GIMPLE_COND/COND

Re: [PATCH] Convert manual unsigned +/- overflow checking into {ADD,SUB}_OVERFLOW (PR target/67089)

2015-11-24 Thread Marc Glisse
dd a few more later, to detect widening operations that are only used for overflow testing, although the form of such tests is much less universal among users. -- Marc Glisse

Re: RFA: PATCH to match.pd for c++/68385

2015-11-21 Thread Marc Glisse
. Do other integer predicates strip nops? Yes, they do. I believe I added one or two of those, and the reason I added STRIP_NOPS is because they started as a copy-paste of integer_zerop... -- Marc Glisse

Re: More Division optimization using match and simplify

2015-11-21 Thread Marc Glisse
vert @1) Sorry, using wi::multiple_of_p makes no sense here. It can only work on constants, but for constants we have constant propagation. -- Marc Glisse

Re: [Patch, vrp] Allow VRP type conversion folding only for widenings upto word mode

2015-11-14 Thread Marc Glisse
result of the discussion was that the transformation is ok if either it is narrowing or it widens but to something no bigger than word_mode. So you should have 2 comparisons, or 1 with a max. -- Marc Glisse

Re: [PATCH, x86] Fix posix_memalign declaration in mm_malloc.h

2015-11-13 Thread Marc Glisse
uch. Couldn't this bug be fixed by either - just overallocating and aligning manually (eliminating the dependence entirely) gmm_malloc.h does that, the whole point of pmm_malloc.h is to avoid it. - or moving _mm_malloc into libgcc.a? -- Marc Glisse

Re: Division Optimization in match and simplify

2015-11-05 Thread Marc Glisse
write :-( I indeed like tree_int_cst_sgn (@2) > 0 better than looking at the sign bit, but I don't know why you re-introduced !TYPE_UNSIGNED (type) at the same time. The whole reason I prefer tree_int_cst_sgn is that it also applies when type is unsigned and @2 is 2^31. -- Marc Glisse

Re: [PATCH] Add configure flag for operator new (std::nothrow)

2015-11-05 Thread Marc Glisse
tually, it is optimized for the case where it does *not* loop (gcc by default optimizes by assuming that loops do loop). -- Marc Glisse

Re: Division Optimization in match and simplify

2015-11-04 Thread Marc Glisse
is, the 'convert?' becomes much less useful on this transformation (simplify (convert (bit_and:s @0 INTEGER_CST@1)) (if (tree_nop_conversion_p (type, TREE_TYPE (@0))) (bit_and (convert @0) (convert @1 -- Marc Glisse

Re: Division Optimization in match and simplify

2015-11-04 Thread Marc Glisse
... With that the pattern looks ok to me. As long as it comes with (convert @0) in the result... I think the fold-const.c pattern is lucky that (int)(x&-4u) gets folded to (int)x&-4, or it might ICE for ((int)(x&-4u))/4. -- Marc Glisse

Re: [PATCH] Make CCP effectively remove UNDEFINED defs

2015-11-04 Thread Marc Glisse
On Wed, 4 Nov 2015, Richard Biener wrote: On Wed, 4 Nov 2015, Richard Biener wrote: On Wed, 4 Nov 2015, Marc Glisse wrote: On Wed, 4 Nov 2015, Richard Biener wrote: The following patch makes sure that CCP when it computes a lattice value to UNDEFINED ends up replacing uses with default

Re: Division Optimization in match and simplify

2015-11-04 Thread Marc Glisse
or 2 patterns. I don't really remember what the tests !TYPE_UNSIGNED (type) and tree_int_cst_sgn are for in the other pattern, but since you are only moving the transformation... -- Marc Glisse

Re: [PATCH] Make CCP effectively remove UNDEFINED defs

2015-11-04 Thread Marc Glisse
rap / test completes successfully) I'm going to enhance VRP and will also look at how value-numbering could do a similar job. Cool, the VN part might help with https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01556.html :-) It might also help removing unreachable (undefined) code earlier of co

Re: Division Optimization in match and simplify

2015-11-04 Thread Marc Glisse
PE (@2), @2, @1); } Don't you want to require that @1 is INTEGER_CST? And then you could use const_binop, or even wi::add. + (if (sum && integer_zerop (sum)) +(rshift (convert @0) { build_int_cst (integer_type_node, + wi::exact_log2 (@2)); }) -- Marc Glisse

Re: [PATCH] Add configure flag for operator new (std::nothrow)

2015-11-04 Thread Marc Glisse
laced new had it been called instead. (Some implementations, including libstdc++, fail to conform to this requirement.) That's also the interpretation I remember, and I find it contradictory with the C++ philosophy that exceptions are heavy, expensive, and should be avoided for local use. (of cou

Re: [PATCH 4/4] Add -Wmisleading-indentation to -Wall

2015-11-02 Thread Marc Glisse
etween levels 1 and 2?) You mean something like -Wstrict-overflow=n? -- Marc Glisse

Re: Multiply Optimization in match and Simplify

2015-10-30 Thread Marc Glisse
it overflows. So I think we should _not_ allow nop conversions here (it's fine if all ops are signed or unsigned). Is there a reason why the simple transformation A+A->2*A is not generally a desirable canonicalization? We currently restrict it to SCALAR_FLOAT_TYPE_P. -- Marc Glisse

Fix X - (X / Y) * Y in match.pd

2015-10-29 Thread Marc Glisse
and mult, but that's a separate generalization and I did not want to think of the proper conditions for its validity. Bootstrap+regtest on ppc64le-redhat-linux. 2015-10-30 Marc Glisse * match.pd (X-(X/Y)*Y): Properly handle conversions and commutativity. -- Marc GlisseIndex

Re: Move some comparison simplifications to match.pd

2015-10-27 Thread Marc Glisse
s we could consider gating the transformation by the existence of lt in the mode of @0, but I don't see any query of optabs in match.pd yet... Still, a testcase would be necessary to go with whatever patch, and I may be completely on the wrong track. -- Marc Glisse

Re: Move some comparison simplifications to match.pd

2015-10-27 Thread Marc Glisse
On Tue, 27 Oct 2015, Kyrill Tkachov wrote: Hi Marc, On 30/08/15 08:57, Marc Glisse wrote: Hello, just trying to shrink fold-const.c a bit more. initializer_zerop is close to what I was looking for with zerop, but I wasn't sure if it would be safe (it accepts some CONSTRUCTOR and STRIN

Re: [PATCH] Adjust some patterns wrt :c

2015-10-26 Thread Marc Glisse
(minus (bit_xor @0 @1) @1)) Sorry, I should have listed them all, but the same applies to /* Fold (A & B) - (A & ~B) into B - (A ^ B). */ a few lines below. -- Marc Glisse

Re: Move expN folds to match.pd

2015-10-26 Thread Marc Glisse
On Mon, 26 Oct 2015, Richard Sandiford wrote: + /* expN(logN(x)) -> x. */ + (simplify + (exps (logs @0)) + @0)) We are not very consistent about it, but wasn't there an idea that we should use non_lvalue in most such places? -- Marc Glisse

Re: Move some bit and binary optimizations in simplify and match

2015-10-24 Thread Marc Glisse
redundant. -- Marc Glisse

Re: Move some bit and binary optimizations in simplify and match

2015-10-20 Thread Marc Glisse
@1 (bit_xor @0 @1 place a :c on the minus of the one not matching INTEGER_CSTs. Will that really work? -- Marc Glisse

Re: Move some bit and binary optimizations in simplify and match

2015-10-19 Thread Marc Glisse
ady in your other patch, and I am not really in favor of the indentation change (or the comment). -- Marc Glisse

Re: Move some bit and binary optimizations in simplify and match

2015-10-16 Thread Marc Glisse
/* Simplify ~X & X as zero. */ +(simplify + (bit_and:c (convert? @0) (convert? (bit_not @0))) + { build_zero_cst (type); }) to simplify the case where X is not a truth value. (detail: the indentation looks off for (C1/X)*C2) -- Marc Glisse

Re: Add simple sign-stripping cases to match.pd

2015-10-15 Thread Marc Glisse
gt; ccos(x). Similarly for ccosh. */ +(for ccoss (CCOS CCOSH) + (simplify + (ccoss (negate @0)) + (ccoss @0))) /* X % Y is smaller than Y. */ (for cmp (lt ge) -- Marc Glisse

Re: [PATCH] Fix wrong-code when folding X - (X / Y) * Y (PR tree-optimization/67953)

2015-10-15 Thread Marc Glisse
On Thu, 15 Oct 2015, Marek Polacek wrote: On Wed, Oct 14, 2015 at 08:54:11PM +0200, Marc Glisse wrote: On Wed, 14 Oct 2015, Marek Polacek wrote: Evidently, the X - (X / Y) * Y -> X % Y pattern can't change the signedness of X from signed to unsigned, otherwise we'd generate wron

Re: [PATCH] Fix wrong-code when folding X - (X / Y) * Y (PR tree-optimization/67953)

2015-10-14 Thread Marc Glisse
; +} + +signed int +fn5 (unsigned int a) +{ + return (signed) a - (int) ((a / 3) * 3); +} + +int +main () +{ + if (fn1 (-5) != -2 + || fn2 (-5) != -2 + || fn3 (-5) != -2 + || fn4 (-5) != -2) +__builtin_abort (); +} Marek -- Marc Glisse

Re: Move some bit and binary optimizations in simplify and match

2015-10-14 Thread Marc Glisse
On Wed, 14 Oct 2015, Richard Biener wrote: On Wed, Oct 14, 2015 at 12:45 PM, Marc Glisse wrote: On Wed, 14 Oct 2015, Richard Biener wrote: +/* Fold (a * (1 << b)) into (a << b) */ +(simplify + (mult:c @0 (convert? (lshift integer_onep@1 @2))) + (if (! FLOAT_

Re: Move some bit and binary optimizations in simplify and match

2015-10-14 Thread Marc Glisse
@1) - 1u << 33 is undefined, isn't it? x * (int)(1ul << b), which for b=33 should yield 0, would give the undefined x << b so some check does seem needed indeed. -- Marc Glisse

Re: Move some bit and binary optimizations in simplify and match

2015-10-13 Thread Marc Glisse
on't need/want to convert @2 (fold-const doesn't convert, does it?), and you don't need to check for tree_nop_conversion_p. -- Marc Glisse

Re: Move some bit and binary optimizations in simplify and match

2015-10-13 Thread Marc Glisse
onvert1? and convert2? Is it? Maybe if it also checked tree_nop_conversion_p for @1... -- Marc Glisse

Re: Move some bit and binary optimizations in simplify and match

2015-10-13 Thread Marc Glisse
TREE_TYPE (@0))) + (lshift @0 (convert @2 Wrong test, did you mean TREE_TYPE (@1) maybe? -- Marc Glisse

Re: Move some bit and binary optimizations in simplify and match

2015-10-12 Thread Marc Glisse
i::eq_p (@1, @3)) + (bit_xor @0 @3))) I don't think we need the :s when the result of the transformation is so simple. +/* Simplify ~X & X as zero. */ +(simplify + (bit_and:c (convert? @0) (convert? (bit_not @0))) + (convert { build_zero_cst (TREE_TYPE (@0)); })) Can't you build 0 directly in the right type? -- Marc Glisse

Re: Move sqrt and cbrt simplifications to match.pd

2015-10-06 Thread Marc Glisse
eal_truncate (type, dconst<1, 6> ()); })) I think you swapped the comments (not that it matters). -- Marc Glisse

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

2015-10-05 Thread Marc Glisse
E_TYPE & dconst (void) { static dconst_value x; return x.value; } Why are you calling this load-time initialization? As far as I know, such a static object is still initialized lazily (with all the overhead this implies). Did you mean to make value a static member of dconst_value? -- Marc Glisse

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-09-30 Thread Marc Glisse
y,z)) * testsuite/gcc.dg/tree-ssa/minmax-loopend.c: New test. You are still missing at least the indentation. +/* { dg-final { scan-tree-dump "MIN_EXPR" 1 "optimized" } } */ I believe it is only scan-tree-dump-times that takes a number. scan-tree-dump seems to have only 2 arguments. -- Marc Glisse

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

2015-09-30 Thread Marc Glisse
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 comparisons. As I was saying, :c is useless. (x:c y z) is replaced by two copies of

Re: [C PATCH] Fix missing warning (PR c/67730)

2015-09-29 Thread Marc Glisse
e the return type from void to int) is not fixed at the same time? -- Marc Glisse

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

2015-09-18 Thread Marc Glisse
ion wraps around for exps). -- Marc Glisse

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

2015-09-18 Thread Marc Glisse
make sure reviewers are ok with the first transformation before generalizing) On Fri, 18 Sep 2015, Marc Glisse wrote: On Thu, 17 Sep 2015, Michael Collison wrote: Here is the the patch modified with test cases for MIN_EXPR and MAX_EXPR expressions. I need some assistance; this test case will

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

2015-09-18 Thread Marc Glisse
} +a[i] = b[i] + c[i]; +} + +void add2 (unsigned int m, unsigned int n) +{ + unsigned int i; + for (i = N-1; i > m && i > n; --i) +a[i] = b[i] + c[i]; +} + +/* { dg-final { scan-tree-dump "MIN_EXPR" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump "MAX_EXPR" 1 "optimized" } } */ -- Marc Glisse

Re: [Patch] PR67351 Implement << N & >> N optimizers

2015-09-02 Thread Marc Glisse
+/* Optimize (x >> c) << c into x & (-1<It looks like vectors might match, so please use element_precision instead of TYPE_PRECISION, as in the fold-const.c code you are converting from. -- Marc Glisse

Re: [Patch, libstdc++] Fix data races in basic_string implementation

2015-09-02 Thread Marc Glisse
also fix some of them? (ChangeLog entry appears to be missing) -- Marc Glisse

Move some comparison simplifications to match.pd

2015-08-30 Thread Marc Glisse
n the simplification confused the machinery too much. I added an "overload" of element_precision like the one in element_mode, for convenience. Bootstrap+testsuite on ppc64le-redhat-linux. 2015-08-31 Marc Glisse gcc/ * tree.h (zerop): New function. * tree.c (z

Move some complex simplifications to match.pd

2015-08-30 Thread Marc Glisse
%rdi, %rax ... Bootstrap+testsuite on ppc64le-redhat-linux. 2015-08-31 Marc Glisse gcc/ * match.pd (SIN, COS, TAN, COSH): Reorder for consistency. (CEXPI): New operator list. (real (conj (x)), imag (conj (x)), real (x +- y), real (cexpi (x)), imag (cexpi (

Re: [PATCH][GCC] Algorithmic optimization in match and simplify

2015-08-28 Thread Marc Glisse
after ','. Having wide_int_storage in many places is surprising, I can't find similar code anywhere else in gcc. -- Marc Glisse

Re: Move remaining flag_unsafe_math_optimizations using simplify and match

2015-08-27 Thread Marc Glisse
might be to add a special pattern sqrt(x)*sqrt(x), or to disable some patterns for GENERIC so CSE has a chance to run first. -- Marc Glisse

Re: [patch] libstdc++/67374 declare valarray begin/end overloads in

2015-08-27 Thread Marc Glisse
ction begin like every other container ? It should at least be legal to implement it this way. -- Marc Glisse

Re: Move some flag_unsafe_math_optimizations using simplify and match

2015-08-20 Thread Marc Glisse
On Thu, 20 Aug 2015, Richard Biener wrote: On Thu, Aug 20, 2015 at 7:38 AM, Marc Glisse wrote: On Thu, 20 Aug 2015, Hurugalawadi, Naveen wrote: The following testcase does not generate "x" as needed. double t (double x) { x = sqrt (x) * sqrt (x)

Re: Move some flag_unsafe_math_optimizations using simplify and match

2015-08-19 Thread Marc Glisse
-fno-math-errno... -- Marc Glisse

Re: [PR16107] Convert cos (-x) into cos (x)

2015-08-16 Thread Marc Glisse
t;div" about? Thanks, -- Marc Glisse

Re: [PATCH] Move A - (A & B) -> ~B & A

2015-08-13 Thread Marc Glisse
a, int b) +{ + return a - (unsigned) (b & a); +} + +/* { dg-final { scan-tree-dump-not " - " "cddce1" } } */ Marek -- Marc Glisse

Re: [PATCH] Fix PR67053

2015-08-11 Thread Marc Glisse
On Tue, 11 Aug 2015, Richard Biener wrote: On Tue, 11 Aug 2015, Marc Glisse wrote: On Wed, 29 Jul 2015, Richard Biener wrote: The following fixes PR67053 by more closely mirror what fold_binary()s STRIP_NOPS does to avoid the C++ FE constexpr code to regress. Bootstrapped on x86_64-unknown

Re: [PATCH] Fix PR67053

2015-08-10 Thread Marc Glisse
)) (with { HOST_WIDE_INT off0, off1; -- Marc Glisse

Re: [PR25529] Convert (unsigned t * 2)/2 into unsigned (t & 0x7FFFFFFF)

2015-07-07 Thread Marc Glisse
On Tue, 7 Jul 2015, Richard Biener wrote: On Tue, Jul 7, 2015 at 8:06 AM, Marc Glisse wrote: On Tue, 7 Jul 2015, Hurugalawadi, Naveen wrote: Please find attached the patch "PR25529.patch" that converts the pattern:- (unsigned * 2)/2 is into unsigned &0x7FFF +/* Simpli

Re: [PR25529] Convert (unsigned t * 2)/2 into unsigned (t & 0x7FFFFFFF)

2015-07-06 Thread Marc Glisse
YPE (@0))) + (bit_and @0 (rshift (lshift { build_minus_one_cst (TREE_TYPE (@0)); } + { n2; }) { n2; })) What happens if you write t*3/3? -- Marc Glisse

Re: [PR23664] Fold (a & C1) + (b & C2) to (a & C1) | (b & C2) iff (C1 & C2) == 0

2015-07-06 Thread Marc Glisse
em (use a 'for'). (simplify (bit_xor (convert1? (bit_and@4 @0 INTEGER_CST@1)) (convert2? (bit_and@5 @2 INTEGER_CST@3))) (if (tree_nop_conversion_p (type, TREE_TYPE (@0)) && tree_nop_conversion_p (type, TREE_TYPE (@2)) && wi::bit_and (@1, @3) == 0) (bit_ior (convert @4) (convert @5 -- Marc Glisse

Re: move a * (1 << b) -> a << b pattern from fold-const.c to match.pd

2015-07-06 Thread Marc Glisse
the result of a shift, so integer, fixed-point or vector. Its lhs is integer_onep, which rules out fixed-point. (I think it is the first pattern using @letter and not @number) -- Marc Glisse

Clean-ups in match.pd

2015-07-04 Thread Marc Glisse
Hello, these are just some minor changes. I believe I had already promised a build_ function to match integer_each_onep. Bootstrap+testsuite on powerpc64le-unknown-linux-gnu (it looks like *-match.c takes about 10 minutes to compile in stage2 these days). 2015-07-06 Marc Glisse

Re: C++ PATCH to change default dialect to C++14

2015-07-01 Thread Marc Glisse
until libraries get updated is to include or before any headers from that library." Can you try modifying the graphite* files accordingly? See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65988#c1 system.h looks like the right way to include gmp.h in gcc, currently. -- Marc Glisse

Re: [PATCH] Move ~X | X -> -1 folding

2015-06-30 Thread Marc Glisse
in TREE_TYPE (@0) and convert that to type" help for that? -- Marc Glisse

Re: [PATCH] Move ~X | X -> -1 folding

2015-06-30 Thread Marc Glisse
convert that to type). For my curiosity, could you explain a bit more? -- Marc Glisse

Re: [PATCH] Move X - (X / Y) * Y folding to match.pd

2015-06-29 Thread Marc Glisse
highlights a trap I regularly fall into: several @0 in the same pattern may have different types (for INTEGER_CST, operand_equal_p mostly ignores the type). So for an int x, 42L-42/x*x should fail to match, while using convert1? and convert2? should match. -- Marc Glisse

Re: [RFA] Factor conversion out of COND_EXPR using match.pd pattern

2015-06-29 Thread Marc Glisse
n you write @1 twice, genmatch emits a call to operand_equal_p to check that they are "the same". -- Marc Glisse

Re: Move ABS detection from fold-const.c to match.pd

2015-06-28 Thread Marc Glisse
f the above on GIMPLE? So mostly the VEC_COND_EXPR version? We don't seem to have that much COND_EXPR left in gimple. -- Marc Glisse

Re: Remove redundant AND from count reduction loop

2015-06-28 Thread Marc Glisse
cially for avx512 (and at least one other arch, maybe sparc). It would be nice if these constraints would also be checked in the gimple verifier... This passed bootstrap+testsuite on powerpc64le-unknown-linux-gnu. 2015-06-29 Marc Glisse * tree-cfg.c (verify_gimple_assign_ternary)

Re: [PATCH] Move X - (X / Y) * Y folding to match.pd

2015-06-27 Thread Marc Glisse
(C - 1)", if X and C are positive. Also optimize A % (C << N) where C is a power of 2, Marek -- Marc Glisse

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

2015-06-27 Thread Marc Glisse
or @1 (convert @2)) I guess we'll have to generalize this to vectors at some point... -- Marc Glisse

Re: C PATCH to use VECTOR_TYPE_P

2015-06-26 Thread Marc Glisse
On Fri, 26 Jun 2015, Marek Polacek wrote: - if (TREE_CODE (TREE_TYPE (mask)) != VECTOR_TYPE + if (!VECTOR_TYPE_P (TREE_TYPE (mask)) || TREE_CODE (TREE_TYPE (TREE_TYPE (mask))) != INTEGER_TYPE) This one looks like !VECTOR_INTEGER_TYPE_P -- Marc Glisse

Re: Remove redundant AND from count reduction loop

2015-06-25 Thread Marc Glisse
On Wed, 24 Jun 2015, Richard Biener wrote: On Wed, Jun 24, 2015 at 11:57 AM, Richard Sandiford wrote: Richard Biener writes: On Tue, Jun 23, 2015 at 11:27 PM, Marc Glisse wrote: On Tue, 23 Jun 2015, Richard Sandiford wrote: +/* Vector comparisons are defined to produce all-one or all

Re: Remove redundant AND from count reduction loop

2015-06-23 Thread Marc Glisse
uot; } } */ +/* { dg-final { scan-assembler-not "\tst\[^\t\]*\t\[wx\]" } } */ +/* { dg-final { scan-assembler "\tldr\tq" } } */ +/* { dg-final { scan-assembler "\tstr\tq" } } */ -- Marc Glisse

Re: match.pd: Three new patterns

2015-06-19 Thread Marc Glisse
robably not worth the trouble adding the variant: x+(y-(x&y)) -> x|y since it decomposes as y-(x&y) -> y&~x x+(y&~x) -> x|y x+(y-(x|y)) -> x-(x&~y) -> x&y is less likely to happen because the first transform y-(x|y) -> -(x&~y) increases the number of insns. Bah, we can't handle everything... -- Marc Glisse

Re: New type-based pool allocator code miscompiled due to aliasing issue?

2015-06-16 Thread Marc Glisse
On Tue, 16 Jun 2015, Martin Liška wrote: On 06/15/2015 07:31 PM, Marc Glisse wrote: On Mon, 15 Jun 2015, Martin Liška wrote: Ah, I overlooked that it's not a placement new, but just static casting. Anyway, if I added: cselib_val () {} to struct cselib_val and changed the cast to plac

Re: New type-based pool allocator code miscompiled due to aliasing issue?

2015-06-15 Thread Marc Glisse
:16: note: candidate expects 1 argument, 2 provided #include -- Marc Glisse

Re: match.pd: Optimize (x & y) ^ (x | y)

2015-06-13 Thread Marc Glisse
h sounds complicated. -- Marc Glisse

Re: match.pd: Three new patterns

2015-06-13 Thread Marc Glisse
| y) -> x + y */ Again for symmetry, it seems like this comes with x + y - (x | y) -> x & y x + y - (x & y) -> x | y which seem fine when overflow is undefined or wraps, but not if for instance it saturates. -- Marc Glisse

Re: match.pd: Optimize (x & y) ^ (x | y)

2015-06-11 Thread Marc Glisse
n_p (type, TREE_TYPE (@2))) (bit_xor (convert @0) (convert @1 which simplifies Jakub's testcase without exploding the size of *-match.c, but it is still not very satisfying. -- Marc Glisse

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