@
+/* 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
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
(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
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
&& !is_empty_record (TREE_TYPE (field)))
return false;
return true;
}
--
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
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
ople don't want such
extensions.
--
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
n associated namespace for more classes than we would
expect.
--
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
gmp with
--disable-assembly, the flag -DNO_ASM ends up in __GMP_CFLAGS (in gmp.h)
and mpfr thus uses it automatically.
--
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
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
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
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
* 18_support/nested_exception/68139.cc: New.
--
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
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
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>
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
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
.
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
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
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
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
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
tually, it is optimized for the case where it does *not* loop (gcc by
default optimizes by assuming that loops do loop).
--
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
...
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
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
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
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
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
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
etween levels 1 and 2?)
You mean something like -Wstrict-overflow=n?
--
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
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
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
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
(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
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
redundant.
--
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
ady in your other patch, and I am not really in favor
of the indentation change (or the comment).
--
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
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
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
;
+}
+
+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
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_
@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
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
onvert1? and convert2?
Is it? Maybe if it also checked tree_nop_conversion_p for @1...
--
Marc Glisse
TREE_TYPE (@0)))
+ (lshift @0 (convert @2
Wrong test, did you mean TREE_TYPE (@1) maybe?
--
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
eal_truncate (type, dconst<1, 6> ()); }))
I think you swapped the comments (not that it matters).
--
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
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
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
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
e the return type from void to int)
is not fixed at the same time?
--
Marc Glisse
ion wraps around for exps).
--
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
}
+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
+/* 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
also fix some of them?
(ChangeLog entry appears to be missing)
--
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
%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 (
after ','.
Having wide_int_storage in many places is surprising, I can't find similar
code anywhere else in gcc.
--
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
ction begin like every other container ? It
should at least be legal to implement it this way.
--
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)
-fno-math-errno...
--
Marc Glisse
t;div" about?
Thanks,
--
Marc Glisse
a, int b)
+{
+ return a - (unsigned) (b & a);
+}
+
+/* { dg-final { scan-tree-dump-not " - " "cddce1" } } */
Marek
--
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
))
(with
{
HOST_WIDE_INT off0, off1;
--
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
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
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
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
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
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
in TREE_TYPE (@0) and
convert that to type" help for that?
--
Marc Glisse
convert that to type). For my curiosity, could you
explain a bit more?
--
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
n you write @1 twice, genmatch emits a
call to operand_equal_p to check that they are "the same".
--
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
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)
(C - 1)", if X and C are positive.
Also optimize A % (C << N) where C is a power of 2,
Marek
--
Marc Glisse
or @1 (convert @2))
I guess we'll have to generalize this to vectors at some point...
--
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
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
uot; } } */
+/* { dg-final { scan-assembler-not "\tst\[^\t\]*\t\[wx\]" } } */
+/* { dg-final { scan-assembler "\tldr\tq" } } */
+/* { dg-final { scan-assembler "\tstr\tq" } } */
--
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
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
:16: note: candidate expects 1 argument, 2 provided
#include
--
Marc Glisse
h sounds complicated.
--
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
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
601 - 700 of 1598 matches
Mail list logo