[PATCH] Build proper false constant for VECTOR_TYPEs.

Martin Liška mliska@suse.cz
Sat Sep 7 07:02:00 GMT 2019


On 9/7/19 8:27 AM, Marc Glisse wrote:
> On Fri, 6 Sep 2019, Martin Liška wrote:
> 
>> 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?
> 
> I don't think so. I believe you are calling the transformation with a wrong 'type' and that's what needs fixing.
> 

I see, lemme check it then.

Martin



More information about the Gcc-patches mailing list