On 9/9/19 8:53 PM, Jeff Law wrote:
On 9/6/19 7:36 AM, Martin Liška wrote:
Hi.

I've been working on transition of cond expressions to match.pd.
With my changes I noticed there's one wrong pattern that leads to:

Transforming _6 > _7 & _6 < _7 into 0
...
/home/marxin/Programming/gcc/gcc/testsuite/c-c++-common/vector-compare-3.c:20:1:
 error: the first argument of a ‘vec_cond_expr’ must be of a boolean vector 
type of the same number of elements as the result
    20 | g (v4i *x, v4i const *y, v4i *z, v4i *t)
       | ^
vector(4) int
_Bool
_9 = VEC_COND_EXPR <0, { -1, -1, -1, -1 }, { 0, 0, 0, 0 }>;

which is wrong.

Proper simlification is:
Transforming _6 > _7 & _6 < _7 into { 0, 0, 0, 0 }

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

gcc/ChangeLog:

2019-09-06  Martin Liska  <mli...@suse.cz>

        * match.pd: For vector types, take type from a vector argument
        of the expression.
Seems like you're going to have an overly long time in match.pd.

We'll see ;)

Perhaps store the desired type into a local or split the line.

As Marc pointed out the patch is incorrect. I'm working on the proper
fix.

Martin


OK with that change.

jeff


Reply via email to